POST /api/jobs/:id/retry
curl --request POST \
--url https://sluice.sh/api/api/jobs/{id}/retryimport requests
url = "https://sluice.sh/api/api/jobs/{id}/retry"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://sluice.sh/api/api/jobs/{id}/retry', 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}/retry",
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}/retry"
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}/retry")
.asString();require 'uri'
require 'net/http'
url = URI("https://sluice.sh/api/api/jobs/{id}/retry")
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/retry
Retry a single failed or cancelled job.
POST
/
api
/
jobs
/
{id}
/
retry
POST /api/jobs/:id/retry
curl --request POST \
--url https://sluice.sh/api/api/jobs/{id}/retryimport requests
url = "https://sluice.sh/api/api/jobs/{id}/retry"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://sluice.sh/api/api/jobs/{id}/retry', 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}/retry",
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}/retry"
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}/retry")
.asString();require 'uri'
require 'net/http'
url = URI("https://sluice.sh/api/api/jobs/{id}/retry")
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_bodyRe-queues a job that has failed or been cancelled. The job’s state changes to
retrying and it will be picked up by a worker.
Authentication
Session cookie (dashboard).Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Sluice job UUID. |
Allowed states
A job can only be retried if its current state isfailed or cancelled. Attempting to retry a job in any other state returns 400.
How it works
Sluice re-dispatches the task to Celery viasend_task() using the original task name, arguments, and queue. The attempt counter is incremented so you can track how many times a job has been retried. The job transitions to retrying immediately and moves to queued once the broker accepts the message.
The retry uses the original arguments stored at ingestion time. If your task arguments included references to external state that has since changed, the retried execution will use the original values.
Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"state": "retrying",
"message": "Job queued for retry."
}
{
"error": {
"code": "INVALID_STATE",
"message": "Job cannot be retried from state 'active'. Retryable states: failed, cancelled.",
"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"
}
}