Create thread
POST
/v1/threadsCreate a new conversation thread. The thread can be project-scoped, scheduled, or immediately executed depending on the request body.
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
None.
Query parameters
None.
Header parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | No | A client-generated identity for the initial turn. Retrying with the same key returns the existing execution or Batch handoff instead of scheduling duplicate work. |
Body schema
Content type: application/json · Required
| Field | Type | Required | Description |
|---|---|---|---|
| projectId | string | No | Project ID. |
| environmentId | string | No | Environment to execute in |
| agentId | string | No | Agent to use (optional) |
| title | string | No | Thread title (optional) |
| appId | string | No | — |
| content | string | No | Optional first user message to execute immediately. |
| task | string | No | Legacy alias for `content`. |
| stream | boolean | No | — |
| metadata | object | No | Free-form metadata object. |
| knowledgeContext | object | No | — |
| knowledgeContext.enabled | boolean | No | Disable automatic Knowledge retrieval for this execution when false. |
| knowledgeContext.libraryIds | string[] | No | Restrict retrieval to these accessible libraries. Empty means all eligible libraries. |
| knowledgeContext.limit | integer | No | — |
| knowledgeContext.mode | read | propose | write | No | Maximum Knowledge capability requested for the thread. Explicit attachments default to propose; every read or mutation is still checked against the caller and resource permissions. |
| knowledgeContext.source | string | No | Stable client provenance such as composer or project. |
| knowledgeContext.bindings | object[] | No | Explicit library version snapshots to use for this execution. |
| knowledgeContext.bindings[].libraryId | string | Yes | — |
| knowledgeContext.bindings[].versionId | string | No | — |
| knowledgeContext.bindings[].versionNumber | integer | No | — |
| knowledgeContext.bindings[].fingerprint | string | No | — |
| queueWhenCapacityUnavailable | boolean | No | Persist the initial turn in Batches instead of failing when runtime capacity is unavailable. Defaults to true on local appliances and false on cloud deployments. |
What the API returns
Each response code below includes the documented payload shape for the ACP API.
201Thread createdapplication/json
| Field | Type | Required | Description |
|---|---|---|---|
| thread | object | No | — |
| thread.id | string | No | Unique identifier. |
| thread.userId | string | No | User ID. |
| thread.organizationId | string | No | — |
| thread.createdByUserId | string | No | — |
| thread.projectId | string | No | Project ID. |
| thread.environmentId | string | No | Computer ID. |
| thread.agentId | string | No | Agent ID. |
| thread.title | string | No | Display title. |
| thread.task | string | No | — |
| thread.appId | string | No | — |
| thread.status | active | running | completed | failed | cancelled | No | Current lifecycle status. |
| thread.messageCount | integer | No | — |
| thread.lastMessageAt | string | No | — |
| thread.lastMessagePreview | string | No | — |
| thread.inputTokens | integer | No | — |
| thread.outputTokens | integer | No | — |
| thread.totalCost | number | No | — |
| thread.environmentMinutes | number | No | — |
| thread.metadata | object | No | Free-form metadata object. |
| thread.teamExecution | object | No | — |
| thread.teamExecution.mode | team | No | — |
| thread.teamExecution.teamAgentId | string | No | — |
| thread.teamExecution.teamAgentName | string | No | — |
| thread.teamExecution.orchestrator | object | No | — |
| thread.teamExecution.orchestrator.agentId | string | No | Agent ID. |
| thread.teamExecution.orchestrator.agentName | string | No | — |
| thread.teamExecution.orchestrator.claudeAgentName | string | No | — |
| thread.teamExecution.subagents | object[] | No | — |
| thread.teamExecution.subagents[].agentId | string | No | Agent ID. |
| thread.teamExecution.subagents[].agentName | string | No | — |
| thread.teamExecution.subagents[].claudeAgentName | string | No | — |
| thread.subagentActivity | object[] | No | — |
| thread.subagentActivity[].agentId | string | No | Agent ID. |
| thread.subagentActivity[].agentName | string | No | — |
| thread.subagentActivity[].claudeAgentName | string | No | — |
| thread.subagentActivity[].eventCount | integer | No | — |
| thread.subagentActivity[].lastActiveAt | string | No | — |
| thread.subagentActivity[].teamAgentId | string | No | — |
| thread.subagentActivity[].teamAgentName | string | No | — |
| thread.environmentName | string | No | — |
| thread.agentName | string | No | — |
| thread.createdAt | string | No | ISO 8601 timestamp. |
| thread.updatedAt | string | No | ISO 8601 timestamp. |
202Thread created and its initial turn accepted by Batches because runtime capacity was unavailableapplication/json
| Field | Type | Required | Description |
|---|---|---|---|
| thread | object | Yes | — |
| thread.id | string | No | Unique identifier. |
| thread.userId | string | No | User ID. |
| thread.organizationId | string | No | — |
| thread.createdByUserId | string | No | — |
| thread.projectId | string | No | Project ID. |
| thread.environmentId | string | No | Computer ID. |
| thread.agentId | string | No | Agent ID. |
| thread.title | string | No | Display title. |
| thread.task | string | No | — |
| thread.appId | string | No | — |
| thread.status | active | running | completed | failed | cancelled | No | Current lifecycle status. |
| thread.messageCount | integer | No | — |
| thread.lastMessageAt | string | No | — |
| thread.lastMessagePreview | string | No | — |
| thread.inputTokens | integer | No | — |
| thread.outputTokens | integer | No | — |
| thread.totalCost | number | No | — |
| thread.environmentMinutes | number | No | — |
| thread.metadata | object | No | Free-form metadata object. |
| thread.teamExecution | object | No | — |
| thread.teamExecution.mode | team | No | — |
| thread.teamExecution.teamAgentId | string | No | — |
| thread.teamExecution.teamAgentName | string | No | — |
| thread.teamExecution.orchestrator | object | No | — |
| thread.teamExecution.orchestrator.agentId | string | No | Agent ID. |
| thread.teamExecution.orchestrator.agentName | string | No | — |
| thread.teamExecution.orchestrator.claudeAgentName | string | No | — |
| thread.teamExecution.subagents | object[] | No | — |
| thread.teamExecution.subagents[].agentId | string | No | Agent ID. |
| thread.teamExecution.subagents[].agentName | string | No | — |
| thread.teamExecution.subagents[].claudeAgentName | string | No | — |
| thread.subagentActivity | object[] | No | — |
| thread.subagentActivity[].agentId | string | No | Agent ID. |
| thread.subagentActivity[].agentName | string | No | — |
| thread.subagentActivity[].claudeAgentName | string | No | — |
| thread.subagentActivity[].eventCount | integer | No | — |
| thread.subagentActivity[].lastActiveAt | string | No | — |
| thread.subagentActivity[].teamAgentId | string | No | — |
| thread.subagentActivity[].teamAgentName | string | No | — |
| thread.environmentName | string | No | — |
| thread.agentName | string | No | — |
| thread.createdAt | string | No | ISO 8601 timestamp. |
| thread.updatedAt | string | No | ISO 8601 timestamp. |
| queuedInBatch | boolean | Yes | — |
| batchJobId | string | Yes | — |
| admissionReason | string | Yes | Stable machine-readable runtime admission reason. |
| execution | object | Yes | — |
| execution.success | boolean | Yes | Whether the request succeeded. |
| execution.queued | boolean | Yes | — |
402Insufficient budgetapplication/json
| Field | Type | Required | Description |
|---|---|---|---|
| error | string | No | — |
| message | string | No | Message text. |
| currentBudget | number | No | — |