Preview an automation

Every send_sms step as it would go out, without sending anything.

GET/v1/automations/{id}/preview

Path Parameters

  • idstringrequired

Query Parameters

  • propertiesstring

    Sample event properties: a JSON object, e.g. {"plan":"pro","amount":9.99}

  • tostring

    E.164. Fills contact merge fields and reads what this person has already been shown

Details

Works on drafts. Merge fields are filled from the sample event properties and, with to, that contact; the brand and opt-out wording we would add are added, in step order.

Each step gives the final text, segments, encoding, estimated cost, any merge field that would come out empty, its send_time and max_wait_seconds, and, for an optimal-user-time step with to, next_send: when it would go for that person (at, local_time, time_zone), and basis: history, default or limit.

Responses

  • 200JSON object

    The rendered texts

  • 400Error

    Invalid properties or to

  • 401Error

    Missing, malformed, or revoked API key

  • 402Error

    Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged

  • 429Error

    Rate limit or quota exceeded

Response Fields

  • objectautomation_preview
  • automation_idstring
  • statusstring
  • trigger_eventstring
  • fromstring

    The number this text would go from; with to, that person's. Nullable.

  • senderobject

    Who it comes from.

  • sender.automaticboolean

    True when TextKit picks the number.

  • sender.categorystring

    Nullable.

  • sender.numbersarray of string

    The numbers it sends from right now. Each recipient keeps one.

  • sender.blockedstring

    Why it cannot send: nothing is approved for this yet. Nullable.

  • tostring

    Nullable.

  • testboolean

    Nullable.

  • contact_foundboolean
  • propertiesobject
  • stepsarray of object
  • steps[].step_idstring
  • steps[].indexinteger
  • steps[].templatestring
  • steps[].textstring

    What the recipient would read. Null when the step would be skipped Nullable.

  • steps[].skippedempty_after_merge, null

    Nullable.

  • steps[].disclosures_addedarray of brand, opt_out
  • steps[].merge_fieldsarray of string
  • steps[].empty_merge_fieldsarray of string
  • steps[].segmentsinteger
  • steps[].encodingGSM-7, UCS-2
  • steps[].charactersinteger
  • steps[].estimated_cost_usdnumber
  • steps[].names_brandboolean

    Nullable.

  • steps[].fromstring

    Nullable.

  • total_segmentsinteger
  • estimated_cost_usdnumber

Errors

Every error has the same JSON shape, and request_id matches the X-Request-Id response header. Errors lists every code and what to do about it.

  • 400

    Invalid properties or to

  • 401

    Missing, malformed, or revoked API key

  • 402

    Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged

  • 429

    Rate limit or quota exceeded