---
title: "Preview an enrollment"
description: "Would enrolling this contact (contact_id or email, as the enroll takes) start a run now, and if not, which check stops it: the automation isn't live, its trigger isn't manual enrollment, no such contact, a run already in progress, re-entry, every message would be skipped for them by consent (no_consent), the hourly run rate, or the automation's or the workspace's live-run ceiling. `POST /api/v1/automations/{id}/runs/preview`"
url: https://www.unitpost.com/docs/automations/post-automations-id-runs-preview
section: "Automations API reference"
updated: 2026-12-01
---
# Preview an enrollment

`POST /api/v1/automations/{id}/runs/preview`

Would enrolling this contact (`contact_id` or `email`, as the enroll takes) start a run now, and if not, which check stops it: the automation isn't live, its trigger isn't manual enrollment, no such contact, a run already in progress, re-entry, every message would be skipped for them by consent (`no_consent`), the hourly run rate, or the automation's or the workspace's live-run ceiling. Nothing is written. Read it before enrolling: the enroll is accepted asynchronously and may still be declined. Also needs `contacts:read`. Requires the `automations:read` capability.

## Parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contact_id` | string | no | The contact (`con_…`). |
| `email` | string | no | Or the contact's email address. |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `automation_id` | string | yes | — |
| `would_enroll` | boolean | yes | Enrolling this contact now would start a run. Advisory: the engine checks again when it enrolls. |
| `blocked_by` | enum \| null | yes | The first check that stops it, or null. |
| `contact` | object \| null | yes | — |
| `checks` | object[] | yes | In enrollment's order: `automation_live`, `manual_trigger`, `contact_found`, then (once those pass) the policy gates `run_in_progress`, `re_entry`, `no_consent` (every message it could send would be skipped for them by consent: no run, nothing billed), `run_rate`, `max_active_runs`, `workspace_live_runs`. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The preview. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope (`automations:read` and `contacts:read`). |
| 404 | Automation not found. |
| 422 | Not exactly one of `contact_id` or `email`, or an unknown key. |

## Example request

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

## Example response (200)

```json
{
  "object": "automation_enrollment_preview",
  "automation_id": "automation_123",
  "would_enroll": false,
  "blocked_by": "automation_live",
  "contact": {
    "id": "id_123",
    "email": "customer@example.com"
  },
  "checks": [
    {
      "code": "automation_live",
      "passed": false,
      "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/post-automations-id-runs-preview
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
