Run task thread

POST/v1/tasks/{taskId}/run-thread

Create a new thread and durable agent-session attempt for a task, link both to the task, and either execute synchronously or return the queued execution for deferred processing.

How to call this endpoint

Every ACP API request uses bearer authentication. The examples here show the actual request path, auth header, and body shape that the platform expects.

Path, query, and header parameters

These parameters control which ACP object the endpoint acts on and how the request is processed.

Path parameters
NameLocationTypeRequiredDescription
taskIdpathstringYesTask ID
Query parameters
None.
Header parameters
NameLocationTypeRequiredDescription
Idempotency-KeyheaderstringNoA client-generated key that makes retries return the original task-agent attempt without launching another execution.

Body schema

Content type: application/json · Optional

FieldTypeRequiredDescription
executionModeblocking | deferredNoExecute before returning (`blocking`) or return the queued thread for an external live execution pipeline (`deferred`).
idempotencyKeystringNoBody alternative to the Idempotency-Key header. If both are supplied, they must match.
titlestringNoOptional title override for the created thread.
environmentIdstringNoComputer ID.
agentIdstringNoAgent ID.
moveToInProgressbooleanNo
metadataobjectNoFree-form metadata object.
messagestringNoOptional execution message for blocking mode. Defaults to the task prompt.
contentstringNoBackwards-compatible alias for message.
taskstringNoBackwards-compatible alias for message.

What the API returns

Each response code below includes the documented payload shape for the ACP API.

200Existing task-agent attempt returned for an idempotent replayapplication/json
FieldTypeRequiredDescription
threadobjectNo
thread.idstringNoUnique identifier.
thread.userIdstringNoUser ID.
thread.organizationIdstringNo
thread.createdByUserIdstringNo
thread.projectIdstringNoProject ID.
thread.environmentIdstringNoComputer ID.
thread.agentIdstringNoAgent ID.
thread.titlestringNoDisplay title.
thread.taskstringNo
thread.appIdstringNo
thread.statusactive | running | completed | failed | cancelledNoCurrent lifecycle status.
thread.messageCountintegerNo
thread.lastMessageAtstringNo
thread.lastMessagePreviewstringNo
thread.inputTokensintegerNo
thread.outputTokensintegerNo
thread.totalCostnumberNo
thread.environmentMinutesnumberNo
thread.metadataobjectNoFree-form metadata object.
thread.teamExecutionobjectNo
thread.teamExecution.modeteamNo
thread.teamExecution.teamAgentIdstringNo
thread.teamExecution.teamAgentNamestringNo
thread.teamExecution.orchestratorobjectNo
thread.teamExecution.orchestrator.agentIdstringNoAgent ID.
thread.teamExecution.orchestrator.agentNamestringNo
thread.teamExecution.orchestrator.claudeAgentNamestringNo
thread.teamExecution.subagentsobject[]No
thread.teamExecution.subagents[].agentIdstringNoAgent ID.
thread.teamExecution.subagents[].agentNamestringNo
thread.teamExecution.subagents[].claudeAgentNamestringNo
thread.subagentActivityobject[]No
thread.subagentActivity[].agentIdstringNoAgent ID.
thread.subagentActivity[].agentNamestringNo
thread.subagentActivity[].claudeAgentNamestringNo
thread.subagentActivity[].eventCountintegerNo
thread.subagentActivity[].lastActiveAtstringNo
thread.subagentActivity[].teamAgentIdstringNo
thread.subagentActivity[].teamAgentNamestringNo
thread.environmentNamestringNo
thread.agentNamestringNo
thread.createdAtstringNoISO 8601 timestamp.
thread.updatedAtstringNoISO 8601 timestamp.
taskobjectNo
task.idstringNoUnique identifier.
task.userIdstringNoUser ID.
task.organizationIdstringNo
task.createdByUserIdstringNo
task.creatorobjectNo
task.creator.typeuser | agentYes
task.creator.userIdstringNoUser ID.
task.creator.agentIdstringNoAgent ID.
task.creator.namestringNoHuman-readable name.
task.creator.avatarUrlstringNo
task.projectIdstringNoProject ID.
task.releaseIdstringNo
task.titlestringNoDisplay title.
task.descriptionstringNoHuman-readable description.
task.statusbacklog | todo | in_progress | blocked | in_review | done | canceledNoCurrent lifecycle status.
task.prioritylow | medium | high | urgentNo
task.typetask | subtask | loopNo
task.parentTaskIdstringNo
task.loopobjectNo
task.loop.enabledbooleanNo
task.loop.goalstringNoEnd goal the loop should reach.
task.loop.endGoalstringNoAlias for goal.
task.loop.progressSignalstringNoObservable signal that shows each iteration is making progress.
task.loop.verificationCriteriastringNoHow the verifier should judge each iteration.
task.loop.successCriteriastringNoObjective condition that stops the loop successfully.
task.loop.maxIterationsintegerNo
task.loop.noProgressLimitintegerNo
task.loop.workerAgentIdstringNo
task.loop.verifierAgentIdstringNo
task.sprintIdstringNo
task.assigneeAgentIdstringNo
task.dependencyIdsstring[]No
task.linkedThreadIdsstring[]No
task.lastStartedThreadIdstringNo
task.scheduledStartAtstringNo
task.scheduledEndAtstringNo
task.dueAtstringNo
task.completedAtstringNoISO 8601 timestamp.
task.sortOrdernumberNo
task.metadataobjectNoFree-form metadata object.
task.createdAtstringNoISO 8601 timestamp.
task.updatedAtstringNoISO 8601 timestamp.
subtasksobject[]No
subtasks[].idstringNoUnique identifier.
subtasks[].titlestringNoDisplay title.
subtasks[].descriptionstringNoHuman-readable description.
subtasks[].statusbacklog | todo | in_progress | blocked | in_review | done | canceledNoCurrent lifecycle status.
subtasks[].prioritylow | medium | high | urgentNo
subtasks[].typetask | subtask | loopNo
subtasks[].parentTaskIdstringNo
subtasks[].loopobjectNo
subtasks[].loop.enabledbooleanNo
subtasks[].loop.goalstringNoEnd goal the loop should reach.
subtasks[].loop.endGoalstringNoAlias for goal.
subtasks[].loop.progressSignalstringNoObservable signal that shows each iteration is making progress.
subtasks[].loop.verificationCriteriastringNoHow the verifier should judge each iteration.
subtasks[].loop.successCriteriastringNoObjective condition that stops the loop successfully.
subtasks[].loop.maxIterationsintegerNo
subtasks[].loop.noProgressLimitintegerNo
subtasks[].loop.workerAgentIdstringNo
subtasks[].loop.verifierAgentIdstringNo
subtasks[].assigneeAgentIdstringNo
subtasks[].dependencyIdsstring[]No
subtasks[].linkedThreadIdsstring[]No
subtasks[].lastStartedThreadIdstringNo
subtasks[].scheduledStartAtstringNo
subtasks[].scheduledEndAtstringNo
subtasks[].dueAtstringNo
subtasks[].reviewRequiredbooleanNo
subtasks[].reviewerActorIdstringNo
subtasks[].reviewerActorKindstringNo
subtasks[].reviewerNamestringNo
agentSessionobjectNo
agentSession.idstringYesUnique identifier.
agentSession.userIdstringYesUser ID.
agentSession.organizationIdstringNo
agentSession.createdByUserIdstringNo
agentSession.projectIdstringNoProject ID.
agentSession.taskIdstringYes
agentSession.threadIdstringYesThread ID.
agentSession.agentIdstringNoAgent ID.
agentSession.environmentIdstringNoComputer ID.
agentSession.statequeued | active | awaiting_input | completed | failed | canceled | staleYes
agentSession.triggerKindmanual | automation | schedule | api | retryYes
agentSession.attemptNumberintegerYes
agentSession.idempotencyKeystringYes
agentSession.executionConfigobjectNo
agentSession.limitsobjectNo
agentSession.inputTokensintegerYes
agentSession.outputTokensintegerYes
agentSession.costUsdnumberNo
agentSession.errorCodestringNo
agentSession.errorMessagestringNo
agentSession.startedAtstringNoISO 8601 timestamp.
agentSession.completedAtstringNoISO 8601 timestamp.
agentSession.metadataobjectNoFree-form metadata object.
agentSession.createdAtstringYesISO 8601 timestamp.
agentSession.updatedAtstringYesISO 8601 timestamp.
executionStartedbooleanNoTrue when the request executed the thread; false when deferred execution was requested.
idempotentReplaybooleanNoTrue when the request returned a previously created attempt and did not launch execution again.
executionobjectNo
execution.successbooleanNoWhether the request succeeded.
execution.responsestringNo
execution.actionsstring[]No
execution.durationMsnumberNo
execution.usageobjectNo
execution.usage.inputTokensnumberNo
execution.usage.outputTokensnumberNo
execution.errorstringNo
201Task thread and durable agent-session attempt createdapplication/json
FieldTypeRequiredDescription
threadobjectNo
thread.idstringNoUnique identifier.
thread.userIdstringNoUser ID.
thread.organizationIdstringNo
thread.createdByUserIdstringNo
thread.projectIdstringNoProject ID.
thread.environmentIdstringNoComputer ID.
thread.agentIdstringNoAgent ID.
thread.titlestringNoDisplay title.
thread.taskstringNo
thread.appIdstringNo
thread.statusactive | running | completed | failed | cancelledNoCurrent lifecycle status.
thread.messageCountintegerNo
thread.lastMessageAtstringNo
thread.lastMessagePreviewstringNo
thread.inputTokensintegerNo
thread.outputTokensintegerNo
thread.totalCostnumberNo
thread.environmentMinutesnumberNo
thread.metadataobjectNoFree-form metadata object.
thread.teamExecutionobjectNo
thread.teamExecution.modeteamNo
thread.teamExecution.teamAgentIdstringNo
thread.teamExecution.teamAgentNamestringNo
thread.teamExecution.orchestratorobjectNo
thread.teamExecution.orchestrator.agentIdstringNoAgent ID.
thread.teamExecution.orchestrator.agentNamestringNo
thread.teamExecution.orchestrator.claudeAgentNamestringNo
thread.teamExecution.subagentsobject[]No
thread.teamExecution.subagents[].agentIdstringNoAgent ID.
thread.teamExecution.subagents[].agentNamestringNo
thread.teamExecution.subagents[].claudeAgentNamestringNo
thread.subagentActivityobject[]No
thread.subagentActivity[].agentIdstringNoAgent ID.
thread.subagentActivity[].agentNamestringNo
thread.subagentActivity[].claudeAgentNamestringNo
thread.subagentActivity[].eventCountintegerNo
thread.subagentActivity[].lastActiveAtstringNo
thread.subagentActivity[].teamAgentIdstringNo
thread.subagentActivity[].teamAgentNamestringNo
thread.environmentNamestringNo
thread.agentNamestringNo
thread.createdAtstringNoISO 8601 timestamp.
thread.updatedAtstringNoISO 8601 timestamp.
taskobjectNo
task.idstringNoUnique identifier.
task.userIdstringNoUser ID.
task.organizationIdstringNo
task.createdByUserIdstringNo
task.creatorobjectNo
task.creator.typeuser | agentYes
task.creator.userIdstringNoUser ID.
task.creator.agentIdstringNoAgent ID.
task.creator.namestringNoHuman-readable name.
task.creator.avatarUrlstringNo
task.projectIdstringNoProject ID.
task.releaseIdstringNo
task.titlestringNoDisplay title.
task.descriptionstringNoHuman-readable description.
task.statusbacklog | todo | in_progress | blocked | in_review | done | canceledNoCurrent lifecycle status.
task.prioritylow | medium | high | urgentNo
task.typetask | subtask | loopNo
task.parentTaskIdstringNo
task.loopobjectNo
task.loop.enabledbooleanNo
task.loop.goalstringNoEnd goal the loop should reach.
task.loop.endGoalstringNoAlias for goal.
task.loop.progressSignalstringNoObservable signal that shows each iteration is making progress.
task.loop.verificationCriteriastringNoHow the verifier should judge each iteration.
task.loop.successCriteriastringNoObjective condition that stops the loop successfully.
task.loop.maxIterationsintegerNo
task.loop.noProgressLimitintegerNo
task.loop.workerAgentIdstringNo
task.loop.verifierAgentIdstringNo
task.sprintIdstringNo
task.assigneeAgentIdstringNo
task.dependencyIdsstring[]No
task.linkedThreadIdsstring[]No
task.lastStartedThreadIdstringNo
task.scheduledStartAtstringNo
task.scheduledEndAtstringNo
task.dueAtstringNo
task.completedAtstringNoISO 8601 timestamp.
task.sortOrdernumberNo
task.metadataobjectNoFree-form metadata object.
task.createdAtstringNoISO 8601 timestamp.
task.updatedAtstringNoISO 8601 timestamp.
subtasksobject[]No
subtasks[].idstringNoUnique identifier.
subtasks[].titlestringNoDisplay title.
subtasks[].descriptionstringNoHuman-readable description.
subtasks[].statusbacklog | todo | in_progress | blocked | in_review | done | canceledNoCurrent lifecycle status.
subtasks[].prioritylow | medium | high | urgentNo
subtasks[].typetask | subtask | loopNo
subtasks[].parentTaskIdstringNo
subtasks[].loopobjectNo
subtasks[].loop.enabledbooleanNo
subtasks[].loop.goalstringNoEnd goal the loop should reach.
subtasks[].loop.endGoalstringNoAlias for goal.
subtasks[].loop.progressSignalstringNoObservable signal that shows each iteration is making progress.
subtasks[].loop.verificationCriteriastringNoHow the verifier should judge each iteration.
subtasks[].loop.successCriteriastringNoObjective condition that stops the loop successfully.
subtasks[].loop.maxIterationsintegerNo
subtasks[].loop.noProgressLimitintegerNo
subtasks[].loop.workerAgentIdstringNo
subtasks[].loop.verifierAgentIdstringNo
subtasks[].assigneeAgentIdstringNo
subtasks[].dependencyIdsstring[]No
subtasks[].linkedThreadIdsstring[]No
subtasks[].lastStartedThreadIdstringNo
subtasks[].scheduledStartAtstringNo
subtasks[].scheduledEndAtstringNo
subtasks[].dueAtstringNo
subtasks[].reviewRequiredbooleanNo
subtasks[].reviewerActorIdstringNo
subtasks[].reviewerActorKindstringNo
subtasks[].reviewerNamestringNo
agentSessionobjectNo
agentSession.idstringYesUnique identifier.
agentSession.userIdstringYesUser ID.
agentSession.organizationIdstringNo
agentSession.createdByUserIdstringNo
agentSession.projectIdstringNoProject ID.
agentSession.taskIdstringYes
agentSession.threadIdstringYesThread ID.
agentSession.agentIdstringNoAgent ID.
agentSession.environmentIdstringNoComputer ID.
agentSession.statequeued | active | awaiting_input | completed | failed | canceled | staleYes
agentSession.triggerKindmanual | automation | schedule | api | retryYes
agentSession.attemptNumberintegerYes
agentSession.idempotencyKeystringYes
agentSession.executionConfigobjectNo
agentSession.limitsobjectNo
agentSession.inputTokensintegerYes
agentSession.outputTokensintegerYes
agentSession.costUsdnumberNo
agentSession.errorCodestringNo
agentSession.errorMessagestringNo
agentSession.startedAtstringNoISO 8601 timestamp.
agentSession.completedAtstringNoISO 8601 timestamp.
agentSession.metadataobjectNoFree-form metadata object.
agentSession.createdAtstringYesISO 8601 timestamp.
agentSession.updatedAtstringYesISO 8601 timestamp.
executionStartedbooleanNoTrue when the request executed the thread; false when deferred execution was requested.
idempotentReplaybooleanNoTrue when the request returned a previously created attempt and did not launch execution again.
executionobjectNo
execution.successbooleanNoWhether the request succeeded.
execution.responsestringNo
execution.actionsstring[]No
execution.durationMsnumberNo
execution.usageobjectNo
execution.usage.inputTokensnumberNo
execution.usage.outputTokensnumberNo
execution.errorstringNo
402Insufficient budget
None.
409Task is blocked by incomplete dependencies
None.
Run task thread
Loading...
Response 200
Loading...
See the ACP quickstart and SDK flow