Skip to content

Stop an agent run ​

POST/api/v2/workspaces/{slug}/runs/{pk}/stop/

Ask a run to stop. This does what the Stop button does in Plane. The request takes no body.

Plane records a prompt activity from you with signal: stop, ephemeral: true, and the content {"type": "text", "body": "Stopping"}, and moves the run to stopping. The response is the run in that state. For an agent installed as an app, Plane also sends the agent's app the activity webhook, the same as for any prompt. The activity also appears in the workspace activity feed, so a polling agent finds it with ?signal=stop.

The run reaches stopped when the agent posts its next response. Plane then sets stopped_at and ended_at, and records you as stopped_by_id. Until then, thought and action activities don't move it back to in_progress. See The stop signal for how an agent should respond.

Only a person can stop a run, and only a run they can see. An agent ends its own run by sending PATCH with status: completed or by posting an error activity, so a call with a bot token returns 403.

A run that has already ended as completed, stopped, failed, or stale returns 409, and so does a run that's already stopping. A person's next prompt can still reopen an ended run.

Path parameters ​

slug:requiredstring

The workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.

pk:requiredstring (uuid)

The id of the agent run to stop.

Response shaping ​

fields:optionalstring

Comma-separated list of fields to return. Fields you don't request are left out of the response instead of coming back as null, so a missing key means you didn't ask for it and null means the value is null. id is always included, whether or not you name it.

Pass all to get every requestable field. An unknown field name returns 400 with the list of valid names and the closest match, so a typo is caught instead of being silently ignored.

Requestable here: agent_user_id, comment_id, created_at, created_by_id, creator_id, credit_usage, ended_at, error_metadata, external_link, external_trigger_id, external_trigger_source, id, native_agent_id, project_id, source_comment_id, started_at, status, stopped_at, stopped_by_id, summary, title, token_usage, trigger_type, type, updated_at, updated_by_id, work_item_id.

See Sparse fields.

expand:optionalstring

Comma-separated relations to embed alongside the ids: agent_user, creator, work_item, comment, and source_comment.

Expanded objects get their own key: ?expand=work_item keeps work_item_id and adds a work_item object next to it. An unknown value returns 400. See Expanding relations.

Scopes ​

agents.runs:write

Errors ​

StatusCodeCause
400invalid_request?fields= or ?expand= names something unknown.
401unauthorizedMissing or invalid credentials.
402payment_requiredThe feature this endpoint belongs to isn't enabled on your plan or is switched off.
403forbiddenThe caller is an agent, you're a guest or not an active member of the workspace, or your token scope doesn't allow this.
404not_foundNo such run in this workspace, or you can't reach it, for example because it's on a work item you can't see.
406not_acceptableThe Accept header asks for a representation the API can't produce.
409conflictThe run has already ended as completed, stopped, failed, or stale, or it's already stopping.
413payload_too_largeThe request body is over the size limit.
415unsupported_media_typeThe Content-Type isn't one this endpoint accepts.
429rate_limitedThrottled. Honor the Retry-After header before retrying.
Stop an agent run
bash
curl -X POST \
  "https://api.plane.so/api/v2/workspaces/my-team/runs/6c3f1a8e-2d9b-4e75-a4c1-8b7e5d2f9a16/stop/" \
  -H "X-Api-Key: $PLANE_API_KEY"
Response200
json
{
  "id": "6c3f1a8e-2d9b-4e75-a4c1-8b7e5d2f9a16",
  "title": "Check the flaky checkout test",
  "summary": null,
  "status": "stopping",
  "type": "comment_thread",
  "trigger_type": null,
  "agent_user_id": "a8f3c1d2-6b4e-4e57-9d10-2f5b7c8e3a94",
  "native_agent_id": null,
  "comment_id": "e6a1f9c3-2b7d-4d58-a4e9-1c3f8b6d2a70",
  "source_comment_id": "e6a1f9c3-2b7d-4d58-a4e9-1c3f8b6d2a70",
  "creator_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
  "work_item_id": "2b9e4c71-5a3d-4f86-9c12-7e8d1b4a6f53",
  "project_id": "4af68566-94a4-4eb3-94aa-50dc9427067b",
  "external_link": null,
  "external_trigger_source": null,
  "external_trigger_id": null,
  "error_metadata": {},
  "token_usage": {},
  "credit_usage": {},
  "started_at": "2026-11-20T11:02:45.330981Z",
  "ended_at": null,
  "stopped_at": null,
  "stopped_by_id": null,
  "created_at": "2026-11-20T11:02:45.330981Z",
  "updated_at": "2026-11-20T11:04:10.462519Z",
  "created_by_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
  "updated_by_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430"
}
Response409
json
{
  "type": "conflict",
  "code": "conflict",
  "detail": "This agent run is already stopping."
}