Replace a template's steps

Save the whole sequence at once: reorder, insert, move steps between tracts. Every step the template should have afterwards is sent; steps left out are removed. A chain that would not run is refused with the reason.

PUThttps://app.trygtm.com/api/v1/templates/{template}/steps
Scope
write

Path parameters

templatestringrequired
The template, by id or exact name (case-insensitive).

Headers

Idempotency-Keystringoptional
A key unique to this write, up to 255 characters. A retry carrying the same key returns the first response instead of running again. Kept for 24 hours.

Body

stepsobject[]required
Every step the template should have afterwards, 1 to 60.
positionintegerrequired
The step's position within its tract, counting from 1. Two steps in one tract cannot share a position.
tractstring | nulloptional
The parallel tract the step runs in, e.g. campaign-email. Steps sharing a tract run in order; different tracts run side by side. Omit or null for the template's single unnamed tract.
actionstringoptional
What the step does: an action id such as email.send, or the label the builder shows. add_template_step's description lists every action and its settings. Omitted, a step with a channel is that channel's message: email.send, linkedin.message or sms.send.
channelstringoptional
The step's channel. Derived from the action when there is one; read only to pick the message action for a step sent without one.
labelstringoptional
The step's display name. Defaults to the action's own name.
wait_amountintegerrequired
How long to wait before this step, from the previous step landing. 0 to 365.
wait_unitstringrequired
The unit waitAmount is in.hoursdaysbusiness_days
branch_conditionstring | nulloptional
The event this step waits behind, or null for none. engaged may gate only the first LinkedIn step of a tract; request_accepted may gate one later step of a tract.
bodystring | nulloptional
A message step's body: writing guidance by default, or the message itself when settings.writing is "template" (variables filled per lead, only {{ai.*}} parts written): send a template back exactly as list_template_steps gave it. May cite blocks as [[Block name]]; each cited block must exist (see list_blocks).
settingsobjectoptional
Per-action settings, validated against the action's own schema: for a message step, writing and, on an email template, subject. Left out, a step keeps the settings stored for the step at the same position and tract with the same action.
blocksstring[]optional
Ignored: cited blocks are read from the body. Accepted so a step read back can be sent as it came.

Request

curl -X PUT https://app.trygtm.com/api/v1/templates/Logistics%20opener/steps \
  -H "Authorization: Bearer $TRYGTM_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "steps": []
  }'

Response

{
  "data": {
    "detail": "Sequence saved.",
    "template": {
      "id": "c1d2e3f4-0a1b-4c2d-8e3f-4a5b6c7d8e9f",
      "name": "Logistics opener"
    },
    "steps": [
      {
        "position": 1,
        "tract": null,
        "action": "email.send",
        "channel": "email",
        "label": "Opener",
        "wait_amount": 0,
        "wait_unit": "days",
        "branch_condition": null,
        "body": "Open on their Q4 hiring push. Cite [[Milestone opener]].",
        "settings": {},
        "blocks": [
          "Milestone opener"
        ]
      }
    ]
  }
}

Was this page helpful?