POST /api/jobs/:id/revoke
curl --request POST \
--url https://sluice.sh/api/api/jobs/{id}/revokeimport requests
url = "https://sluice.sh/api/api/jobs/{id}/revoke"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://sluice.sh/api/api/jobs/{id}/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sluice.sh/api/api/jobs/{id}/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sluice.sh/api/api/jobs/{id}/revoke"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sluice.sh/api/api/jobs/{id}/revoke")
.asString();require 'uri'
require 'net/http'
url = URI("https://sluice.sh/api/api/jobs/{id}/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyJobs
POST /api/jobs/:id/revoke
Revoke (cancel) a single active, queued, or scheduled job.
POST
/
api
/
jobs
/
{id}
/
revoke
POST /api/jobs/:id/revoke
curl --request POST \
--url https://sluice.sh/api/api/jobs/{id}/revokeimport requests
url = "https://sluice.sh/api/api/jobs/{id}/revoke"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://sluice.sh/api/api/jobs/{id}/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sluice.sh/api/api/jobs/{id}/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sluice.sh/api/api/jobs/{id}/revoke"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sluice.sh/api/api/jobs/{id}/revoke")
.asString();require 'uri'
require 'net/http'
url = URI("https://sluice.sh/api/api/jobs/{id}/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCancels 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
| Parameter | Type | Description |
|---|---|---|
id | string | Sluice 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 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.Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"state": "cancelled",
"message": "Job revoked."
}
{
"error": {
"code": "INVALID_STATE",
"message": "Job cannot be revoked from state 'completed'. Revokable states: active, queued, scheduled, retrying, unknown.",
"docs_url": "https://docs.sluice.sh/troubleshooting/api-errors"
}
}
{
"error": {
"code": "NOT_FOUND",
"message": "Job not found.",
"docs_url": "https://docs.sluice.sh/troubleshooting/api-errors"
}
}