Cancel a batch run
POST/v1/invitation_batches/{batch}/cancel
Cancels a run: every recipient not yet attempted is stopped before any attempt.
Behavior
- Stops both the recipients still waiting to become invitations and the ones already sitting in the delivery queue; cancelling seconds into a large run does not let the hundreds already queued go out.
- Cannot stop a request already on Apple’s wire or anything Apple has
accepted. The
cancellationobject reports those asin_flightandalready_sentrather than counting them as cancelled. - Exact, not best-effort: a cancel and the run’s own fan-out serialize on the run, so there is no window where a recipient is both cancelled and sent.
- Safe to repeat, never refused. Cancelling a cancelled run returns
HTTP 200 with the same body. Cancelling a
completedrun also works;completedmeans every recipient became an invitation, not that all were delivered, and a large run is routinelycompletedwith thousands of sends still queued; this call still stops everything unattempted. If nothing was left,cancellationis all zeros. Read the numbers, not the status code. - Stopped recipients appear as
cancelledincountsand on the recipients page (?state=cancelled). No per-recipient webhook fires for them; the run’s oneinvitation_batch.completedevent fires withstatus: "cancelled"and the final counts. - Unknown runs, and another brand’s; return HTTP 404.
Cancel a batch run
curl https://messages.api.linqapp.com/v1/invitation_batches/$BATCH/cancel \
-X POST \
-H "Authorization: Bearer $LINQ_AMB_API_KEY"{
"id": "invb_0d5c19",
"status": "cancelled",
"template_id": "invt_a4f2c718d0",
"recipient_count": 2,
"accepted_count": 2,
"counts": {
"pending": 0,
"sent": 1,
"failed": 0,
"cancelled": 1,
"skipped": 0
},
"cancellation": {
"unreleased": 1,
"queued": 0,
"in_flight": 0,
"already_sent": 1
},
"created_at": "2026-08-06T14:00:00Z",
"updated_at": "2026-08-06T14:00:31Z"
}Returns Examples
{
"id": "invb_0d5c19",
"status": "cancelled",
"template_id": "invt_a4f2c718d0",
"recipient_count": 2,
"accepted_count": 2,
"counts": {
"pending": 0,
"sent": 1,
"failed": 0,
"cancelled": 1,
"skipped": 0
},
"cancellation": {
"unreleased": 1,
"queued": 0,
"in_flight": 0,
"already_sent": 1
},
"created_at": "2026-08-06T14:00:00Z",
"updated_at": "2026-08-06T14:00:31Z"
}