Create an agent run
Start a run for an agent on an existing top-level comment. The comment becomes both the root of the run's thread, comment_id, and the comment that started it, source_comment_id. The run takes the comment's work item and project, and you become its creator_id. It starts as created, with trigger_type null.
Plane then sends the agent's app the agent run create webhook, the same one a mention sends. No prompt activity is created, so the agent reads the comment itself. You don't need this endpoint for mentions and assignments, because Plane starts those runs on its own.
Who can start a run:
- A person must be able to see the comment's work item and to comment on it.
- An agent, calling with its bot token, can start runs for itself only.
agent_slugmust name the calling agent.
Path parameters
slug:requiredstringThe workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.
Body parameters
agent_slug:requiredstringThe slug of the agent's app. The app must be installed in this workspace and have app mentions turned on. Otherwise the request returns 400.
comment_id:requiredstring (uuid)The top-level comment to run the agent on. It must be in this workspace, on a work item you can see. A reply, or a comment that's already part of a run, returns 400.
title:optionalstringA short title for the run. The agent can change it later.
Nullable.
summary:optionalstringA summary of the run. The agent usually sets it when it settles the run.
Nullable.
external_link:optionalstring (uri)A link to the run in the agent's own system, such as a log or dashboard. Up to 200 characters. This is the only time you can set it, because Update an agent run doesn't accept it.
Nullable.
Response shaping
fields:optionalstringComma-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:optionalstringComma-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
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | agent_slug doesn't match an installed agent with app mentions on, or comment_id is missing, a reply, already part of a run, outside this workspace, or on a work item you can't see. |
401 | unauthorized | Missing or invalid credentials. |
402 | payment_required | The feature this endpoint belongs to isn't enabled on your plan or is switched off. |
403 | forbidden | You're a guest, you can't comment on the work item, an agent tried to start another agent's run, or your token scope doesn't allow this. |
404 | not_found | No such workspace. |
406 | not_acceptable | The Accept header asks for a representation the API can't produce. |
413 | payload_too_large | The request body is over the size limit. |
415 | unsupported_media_type | The Content-Type isn't one this endpoint accepts. |
429 | rate_limited | Throttled. Honor the Retry-After header before retrying. |
curl -X POST \
"https://api.plane.so/api/v2/workspaces/my-team/runs/" \
-H "X-Api-Key: $PLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_slug": "triage-agent",
"comment_id": "e6a1f9c3-2b7d-4d58-a4e9-1c3f8b6d2a70",
"title": "Check the flaky checkout test"
}'import requests
response = requests.post(
"https://api.plane.so/api/v2/workspaces/my-team/runs/",
headers={"X-Api-Key": "your-api-key"},
json={
"agent_slug": "triage-agent",
"comment_id": "e6a1f9c3-2b7d-4d58-a4e9-1c3f8b6d2a70",
"title": "Check the flaky checkout test",
},
)
print(response.json())const response = await fetch("https://api.plane.so/api/v2/workspaces/my-team/runs/", {
method: "POST",
headers: {
"X-Api-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
agent_slug: "triage-agent",
comment_id: "e6a1f9c3-2b7d-4d58-a4e9-1c3f8b6d2a70",
title: "Check the flaky checkout test",
}),
});
const data = await response.json();{
"id": "6c3f1a8e-2d9b-4e75-a4c1-8b7e5d2f9a16",
"title": "Check the flaky checkout test",
"summary": null,
"status": "created",
"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:02:45.330981Z",
"created_by_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
"updated_by_id": null
}
