---
title: "Supersede an in-progress task (terminate + spawn resume follow-up)"
method: POST
path: "/api/tasks/{id}/supersede"
tags: ["Tasks"]
---

# Supersede an in-progress task (terminate + spawn resume follow-up)

`POST /api/tasks/{id}/supersede`

Marks the original task `superseded` (terminal) and creates a fresh `taskType="resume"` follow-up so a worker can pick up the work in a new provider session. Workflow-step tasks (those with `workflowRunStepId`) are carved out: the original is marked `failed` with reason `superseded_workflow_task` and no follow-up is created — the workflow engine's retry/failure policy applies.

## Path parameters

- `id` string, required

## Request body

- object
  - `reason` 'graceful_shutdown' | 'context_limits' | 'manual_supersede' | 'crash_recovery', required

## Response `200`

Task superseded (or workflow-failed)

## Other responses

- `400` — Task not in_progress
- `403` — Task belongs to another agent
- `404` — Task not found

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/revisions/4f62e32be8ec?raw)
