Cancel a running batch
POST/api/sessions/:sessionId/messages/batch/:batchId/cancel
Cancel a running batch
Request
Responses
- 200
- 400
- 401
- 403
- 404
Batch cancelled
Batch already completed, cancelled, or failed (terminal statuses are exclusive)
The API key is missing, unknown, revoked, or expired
The calling key is restricted with allowedChats. A batch row has no key owner, so the cancel cannot be checked against the key's allowlist and a chat-restricted key is refused. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
Batch not found