---
title: "Dry-run an automation"
description: "Walk the draft (or version: live) for one contact and say which messages they'd get, when, and which branches they'd take, as the builder's test does. `POST /api/v1/automations/{id}/simulate`"
url: https://www.unitpost.com/docs/automations/post-automations-id-simulate
section: "Automations API reference"
updated: 2026-12-01
---
# Dry-run an automation

`POST /api/v1/automations/{id}/simulate`

Walk the draft (or `version: live`) for one contact and say which messages they'd get, when, and which branches they'd take, as the builder's test does. Pass a real contact (`email` or `contact_id`, which also needs `contacts:read`) or a made-up one (`contact` fields), and `event_data` for a custom event's payload. Nothing is sent and nothing changes. Requires the `automations:read` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string | no | A real contact by email (also needs `contacts:read`). |
| `contact_id` | string | no | A real contact by id (also needs `contacts:read`). |
| `contact` | object | no | Or a made-up contact: its fields (`first_name`, `plan`, …). |
| `phone` | string | no | A made-up contact's phone number. |
| `sms_consent` | boolean | no | A made-up contact's SMS marketing consent. |
| `event_data` | object | no | The trigger event's payload, read as event.data.*. |
| `version` | enum | no | `draft` (default) or the `live` version. One of: `draft`, `live`. |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `automation_id` | string | yes | — |
| `version` | enum | yes | One of: `draft`, `live`. |
| `subject` | string | yes | Who was walked: the contact, or "a test contact". |
| `sent` | boolean | yes | A dry run never sends. |
| `enters` | boolean | yes | — |
| `reason` | string \| null | yes | Why it wouldn't enter, when `enters` is false. |
| `paths` | object[] | yes | One path per wait-for-event outcome (the event arrives / times out). |
| `summary` | string | yes | — |
| `not_simulated` | string | yes | — |

## Responses

| Status | Description |
| --- | --- |
| 200 | The dry run. |
| 400 | The body isn't JSON. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope. |
| 404 | Automation or contact not found. |
| 409 | No graph to walk yet (or no live version, with `version: live`). |
| 422 | A bad field, both `email` and `contact_id`, or an unknown key. |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/simulate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sam@acme.com",
    "event_data": {
      "cart_url": "https://shop.acme.com/cart/123"
    }
  }'
```

## Example response (200)

```json
{
  "object": "automation_simulation",
  "automation_id": "automation_123",
  "version": "draft",
  "subject": "Welcome to Acme",
  "sent": false,
  "enters": false,
  "reason": "string",
  "paths": [
    {
      "assumptions": [
        "string"
      ],
      "steps": [
        {
          "node_id": "node_123",
          "title": "string",
          "at": "string",
          "outcome": "would_send",
          "detail": "string"
        }
      ],
      "sends": 0,
      "skips": 0
    }
  ],
  "summary": "string",
  "not_simulated": "string"
}
```

## Links

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