Preview a publish

Preview a publish

GET/api/v1/automations/{id}/publish

GET /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'
Response · 200
{
  "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
FieldTypeDescription
idrequiredstring · path—
backfillboolean · queryAlso count who a backfill would start (`backfill.count`, `skipped`, cost).
Response · 200 fields7 fields
FieldTypeDescription
objectrequiredstring—
automation_idrequiredstring—
mid_journeyrequiredintegerLive runs (active and waiting); they move to the new version at their block.
heldrequiredintegerOf 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.
stalerequiredintegerHeld more than 7 days: a publish over the pause doesn't send them unless `send_stale`.
removed_blocksrequiredobject[]Blocks the draft removes that people are on.
backfillrequiredobject | nullWhat `backfill: true` on publish would start, or why it can't (W14).
200401403404

Search docs and guides

Search the docs and product guides.