---
title: "Preview a publish"
description: "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. `GET /api/v1/automations/{id}/publish`"
url: https://www.unitpost.com/docs/automations/get-automations-id-publish
section: "Automations API reference"
updated: 2026-12-01
---
# Preview a publish

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

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.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |
| `backfill` | query | boolean | no | Also count who a backfill would start (`backfill.count`, `skipped`, cost). |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `automation_id` | string | yes | — |
| `mid_journey` | integer | yes | Live runs (active and waiting); they move to the new version at their block. |
| `held` | integer | yes | 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. |
| `stale` | integer | yes | Held more than 7 days: a publish over the pause doesn't send them unless `send_stale`. |
| `removed_blocks` | object[] | yes | Blocks the draft removes that people are on. |
| `backfill` | object \| null | yes | What `backfill: true` on publish would start, or why it can't (W14). |

## Responses

| Status | Description |
| --- | --- |
| 200 | The preview. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope. |
| 404 | Automation not found. |

## Example request

```bash
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'
```

## Example response (200)

```json
{
  "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"
    }
  }
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/automations/get-automations-id-publish
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
