Preview a publish
GET/api/v1/automations/{id}/publish
curl -X GET 'https://www.unitpost.com/api/v1/automations/atm_123/publish' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0'{
"object": "automation_publish_preview",
"automation_id": "automation_123",
"mid_journey": 0,
"held": 0,
"stale": 0,
"removed_blocks": [
{
"node_id": "node_123",
"title": "string",
"count": 1,
"next_node_id": "next_node_123",
"next_title": "string"
}
],
"backfill": {
"available": false,
"source": {
"type": "segment",
"id": "id_123",
"name": "Example"
},
"count": 1,
"count_partial": false,
"skipped": {
"unsubscribed": 0,
"no_consent": 0,
"already_through": 0,
"filter": 0
},
"max": 0,
"per_minute": 0,
"runs_left": 0,
"cost_cents": 0,
"room": 0,
"job": {
"id": "id_123",
"status": "queued",
"total": 1,
"processed": 0,
"started": 0,
"not_started": {},
"error": "string"
},
"refusal": {
"code": "string",
"message": "string"
}
}
}What publishing the current draft would do to the people mid-journey: how many there are (they move to the new version at the block they're on), how many a pause holds and how many of those waited more than 7 days, and, for each block the draft removes, how many people are on it and where move_to_next would take them. When removed_blocks lists anyone, pass removed_blocks to Publish (it answers 409 without it). backfill (a segment or topic trigger): the latest backfill job with what it did, and with ?backfill=true who a backfill would start now (count), who it skips and why, runs left, the cost past the included runs, and any refusal. Nothing changes. Requires the automations:read capability.
Parameters2 fields
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
backfill | boolean · query | Also count who a backfill would start (`backfill.count`, `skipped`, cost). |
Response · 200 fields7 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
automation_idrequired | string | — |
mid_journeyrequired | integer | Live runs (active and waiting); they move to the new version at their block. |
heldrequired | integer | Of those, frozen at a step by a pause. A run still on a wait timer isn't counted until its wait ends; `mid_journey` counts every run in progress, which is what unpublishing a paused automation ends by default. |
stalerequired | integer | Held more than 7 days: a publish over the pause doesn't send them unless `send_stale`. |
removed_blocksrequired | object[] | Blocks the draft removes that people are on. |
backfillrequired | object | null | What `backfill: true` on publish would start, or why it can't (W14). |