---
title: "Mark task as completed or failed (runner endpoint)"
method: POST
path: "/api/tasks/{id}/finish"
tags: ["Tasks"]
---

# Mark task as completed or failed (runner endpoint)

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

## Path parameters

- `id` string, required

## Request body

- object
  - `status` 'completed' | 'failed', required
  - `output` string
  - `failureReason` string
  - `force` boolean

## Response `200`

Task finished

## Other responses

- `400` — Invalid status
- `403` — Not assigned to this agent
- `404` — Task not found
- `409` — Differing terminal result text was discarded

## Changes

- **2026-08-03** `92a1dcbd2fc7` — 2 info
  - added the new optional request property `force`
  - added the non-success response with the status `409`

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/tasks/:id/finish/post.md)

---

[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)
