Tasks API
List tasks
Section titled “List tasks”GET /api/v1/tasks?project_id=...&state=failed&cursor=...&limit=50Filters:
project_id(required)state-pending/started/succeeded/failed/cancelled/retried/lostengine-celery/rq/ …queue- namename- task name (exact orlike=%foo%)from/to- timestamps (RFC 3339)has_error- boolean
Response:
{ "items": [ { "id": "01H...", "engine": "celery", "name": "email.send", "state": "failed", "args": ["<redacted>"], "kwargs": {"to": "<email>"}, "enqueued_at": "...", "started_at": "...", "finished_at": "...", "error": { "exc_type": "ValueError", "exc_msg": "..." }, "retried_as": null } ], "next_cursor": "...", "has_more": true}Get task
Section titled “Get task”GET /api/v1/tasks/{id}Returns the task plus its full event stream.
POST /api/v1/tasks/{id}/retryRole: operator. Returns:
{"ok": true, "new_task_id": "01H..."}Cancel
Section titled “Cancel”POST /api/v1/tasks/{id}/cancelRole: operator. Body:
{"terminate": false}terminate=true sends SIGTERM to the worker (Celery only; requires admin).
Bulk retry
Section titled “Bulk retry”POST /api/v1/tasks/bulk-retryBody mirrors list filters:
{ "project_id": "...", "state": "failed", "name": "email.send", "from": "2026-04-16T00:00:00Z", "to": "2026-04-16T23:59:59Z"}Max 10,000 tasks per call. Response includes a job_id to poll:
GET /api/v1/tasks/bulk-retry/{job_id}Purge queue
Section titled “Purge queue”POST /api/v1/queues/{name}/purgeRole: operator. Removes all pending messages from the named queue.
This is destructive. Confirm in UI; external clients must set ?confirm=yes.
Events
Section titled “Events”GET /api/v1/tasks/{id}/eventsAll lifecycle events for one task, oldest first.