Skip to main content
POST
/
api
/
v1
/
tasks
/
{task_id}
/
cancel
Cancel a task
curl --request POST \
  --url https://agents.nanonets.com/api/v1/tasks/{task_id}/cancel \
  --header 'Authorization: Bearer <token>'
{
  "task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "title": "<string>"
}

Authorizations

Authorization
string
header
required

Workspace API key issued from the web app. Pass as Authorization: Bearer YOUR_API_KEY.

Path Parameters

task_id
string<uuid>
required

UUID of the task.

Response

Cancellation accepted; returns the task's current state.

task_id
string<uuid>
required
agent_id
string<uuid>
required
status
enum<string>
required

Lifecycle status of a task.

  • pending — created, not yet picked up
  • queued — held back by admission control (agent at concurrent-task limit)
  • running — being processed by the worker
  • waiting_for_input — agent called ask_user; reply with POST /tasks/{id}/message
  • awaiting_review — agent is paused for human approval of a sensitive step
  • completed — terminal: finished successfully
  • failed — terminal: errored out
  • stopped — terminal: cancelled by a user or system
Available options:
pending,
queued,
running,
waiting_for_input,
awaiting_review,
completed,
failed,
stopped
created_at
string<date-time>
required
updated_at
string<date-time>
required
title
string | null

Title derived from the first user message. Omitted until set.