POST /api/deep-work/projects/{project_id}/tasks/{task_id}/retry Bearer

Retry Deep Work Task

Manually retry a blocked task in a Deep Work project. Resets the task to assigned status, increments the retry count, and re-dispatches it for execution — bypassing the automatic max_retries limit.

Overview

Manually retries a blocked task. The task’s status is reset to ASSIGNED, the retry_count is incremented, any previous error message is cleared, and the task is re-dispatched to the executor.

This is a manual override — it works regardless of the task’s max_retries limit. Use it when auto-retries have been exhausted but you want to give the task another shot, maybe after fixing an underlying issue.

Only tasks with BLOCKED status can be retried. Tasks in any other state will return a 400 error.

Path Parameters

project_id string

The project ID that owns the task.

task_id string

The ID of the blocked task to retry. Must belong to the specified project and have BLOCKED status.

Response

success boolean

Whether the task was re-dispatched.

task object

The updated task object with status: "assigned" and incremented retry_count.

progress object

Updated project progress after the retry.

Terminal window
curl -X POST http://localhost:8000/api/deep-work/projects/PROJECT_ID/tasks/TASK_ID/retry \
-H "Authorization: Bearer YOUR_TOKEN"
const res = await fetch(
'http://localhost:8000/api/deep-work/projects/PROJECT_ID/tasks/TASK_ID/retry',
{
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
}
);
const data = await res.json();
import httpx
res = httpx.post(
f"http://localhost:8000/api/deep-work/projects/PROJECT_ID/tasks/TASK_ID/retry",
headers={"Authorization": "Bearer YOUR_TOKEN"},
)
data = res.json()
{
"success": true,
"task": {
"id": "task-3",
"title": "Implement user authentication",
"status": "assigned",
"retry_count": 2,
"max_retries": 1,
"error_message": null
},
"progress": {
"total": 8,
"completed": 4,
"in_progress": 1,
"percent": 50
}
}
{
"detail": "Can only retry tasks with status 'blocked', got 'done'"
}
Request
curl -X POST "http://localhost:8000/api/deep-work/projects/{project_id}/tasks/{task_id}/retry" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>"
const response = await fetch("http://localhost:8000/api/deep-work/projects/{project_id}/tasks/{task_id}/retry", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
},
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
    "http://localhost:8000/api/deep-work/projects/{project_id}/tasks/{task_id}/retry",
    headers={'Content-Type':'application/json','Authorization':'Bearer <token>'},
)

print(response.json())
package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {
    req, _ := http.NewRequest("POST", "http://localhost:8000/api/deep-work/projects/{project_id}/tasks/{task_id}/retry", nil)
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer <token>")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
Response
Send a request to see the response