Skip to main content
POST
/
api
/
jobs
/
{id}
/
revoke
POST /api/jobs/:id/revoke
curl --request POST \
  --url https://sluice.sh/api/api/jobs/{id}/revoke

Documentation Index

Fetch the complete documentation index at: https://docs.sluice.sh/llms.txt

Use this file to discover all available pages before exploring further.

Cancels a job that is currently active, queued, scheduled, retrying, or in the unknown state. The job’s state changes to cancelled.

Authentication

Session cookie (dashboard).

Path parameters

ParameterTypeDescription
idstringSluice job UUID.

Allowed states

A job can only be revoked if its current state is one of: active, queued, scheduled, retrying, unknown. Attempting to revoke a completed, failed, or cancelled job returns 400.

How it works

Sluice sends a revoke command to Celery via control.revoke(), which broadcasts the revocation to all workers. For queued or scheduled jobs, the worker discards the task before execution begins. For active tasks, the worker receives the revoke signal but the task may not terminate immediately unless terminate=True is used internally — the task runs to completion and is marked cancelled afterward.
If the task uses acks_late=True, the message remains on the broker until the worker acknowledges it. A revoked task with acks_late is acknowledged without execution, but if the worker crashes before acknowledging, the broker may redeliver the task to another worker that hasn’t seen the revoke command.

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "state": "cancelled",
  "message": "Job revoked."
}