Cancel a batch
POST/api/v1/email/batches/{id}/cancel
POST /email/batches/{id}/cancel
curl -X POST 'https://www.unitpost.com/api/v1/email/batches/batch_123/cancel' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0'Response · 200
{
"object": "batch",
"id": "id_123",
"count": 1,
"scheduled_at": "2026-01-01T00:00:00.000Z",
"created_at": "2026-01-01T00:00:00.000Z",
"status_counts": {},
"cancelable": 0
}Cancel every still-cancelable message in a batch in one call. Messages that have already been sent are left untouched — only queued or scheduled ones are stopped. Check what remains cancelable first with Retrieve a batch. Requires the emails:send capability.
Parameters1 field
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
Response · 200 fields7 fields
| Field | Type | Description |
|---|---|---|
objectrequired | enumbatch | — |
idrequired | string | — |
countrequired | integer | — |
scheduled_atrequired | string | — |
created_atrequired | string | — |
status_countsrequired | object | Live child counts keyed by status (e.g. { delivered: 98, failed: 2 }). |
cancelablerequired | integer | — |
200401403404409