POST /api/jobs/:id/revoke
Jobs
POST /api/jobs/:id/revoke
Revoke (cancel) a single active, queued, or scheduled job.
POST
POST /api/jobs/:id/revoke
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
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 viacontrol.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.