Preview an enrollment
POST/api/v1/automations/{id}/runs/preview
POST /automations/{id}/runs/preview
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"
}'Response · 200
{
"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"
}
]
}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.
Parameters1 field
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
Request body2 fields
| Field | Type | Description |
|---|---|---|
contact_id | string | The contact (`con_…`). |
email | string | Or the contact's email address. |
Response · 200 fields6 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
automation_idrequired | string | — |
would_enrollrequired | boolean | Enrolling this contact now would start a run. Advisory: the engine checks again when it enrolls. |
blocked_byrequired | enum | null | The first check that stops it, or null. |
contactrequired | object | null | — |
checksrequired | object[] | 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`. |
200401403404422