Creates a conversation with the awork Agent or a custom agent.

POSThttps://api.awork.com/api/v1/agents/threads
POST https://api.awork.com/api/v1/agents/threads

Creates a conversation with the awork Agent or a custom agent and optionally submits the first message. Supply content or attachments to submit the first message and start processing. awork Agent threads can be created without a message. Custom Agent threads require text or an attachment. The response contains the thread and accepted first-message identifiers, not the agent's reply. See GET /agents/threads/{threadId}/messages to retrieve replies. Each request creates a new thread. Retrying after a lost response can create another thread.

Authentication

AuthorizationBearer

Send your token in the Authorization: Bearer <token> header. See Authentication for API keys and OAuth.

Request body Required

The thread creation payload.

application/json

presetKeystring or nullOptional

The custom-agent preset. Its current settings override the supplied model and reasoning.

contentstring or nullOptional

The message text. Required when no attachments are supplied.

attachmentsarray of object or nullOptional
maxItems: 20

Up to 20 distinct files attached to this message. Each file can contain up to 20 MiB. Upload new files before submitting their identifiers.

Show 2 properties
temporaryFileIdstring or nullOptional
format: uuid

The identifier returned when uploading a temporary file. Do not also supply aworkFileId.

aworkFileIdstring or nullOptional
format: uuid

The identifier of an existing awork file the caller can read. Do not also supply temporaryFileId.

modelProviderstring or nullOptional

The provider for a model override. Supply it together with modelName.

modelNamestring or nullOptional

The model to use for this message. It must be available in the workspace.

reasoningLevelstring or nullOptional

The reasoning level for this message. Supported values depend on the selected model.

toolAccessobjectOptional

Per-message agent tool access options.

Show 4 properties
aworkbooleanOptional

Whether awork tools are enabled for this run.

webSearchbooleanOptional

Whether web search is enabled for this run.

googleGenAibooleanOptional

Whether Google GenAI tools are enabled for this run.

openAiImageGenerationbooleanOptional

Whether OpenAI image generation is enabled for this run.

connectorIdsarray of string or nullOptional

The connector selection for this message.

connectorConnectionsarray of object or nullOptional

Connection choices for custom-agent connectors. These do not change agent settings.

Show 2 properties
connectorIdstringOptional
format: uuid

The connector identifier.

connectionIdstringOptional
format: uuid

The connection identifier.

skillIdsarray of string or nullOptional

The skill selection for this message.

typestringRequired

Allowed: "personal-agent" "custom-agent"

minLength: 1

Select personal-agent for the awork Agent, or custom-agent for a configured workspace agent.

agentIdstringOptional
format: uuid

The configured agent to run. Required for custom-agent threads; omit for ordinary personal-agent threads.

titlestring or nullOptional

The thread title.

projectIdstring or nullOptional
format: uuid

The project context id.

taskIdstring or nullOptional
format: uuid

The task context id.

clientIdstring or nullOptional
format: uuid

The client context id.

documentIdstring or nullOptional
format: uuid

The document context id.

Responses

200 OK

application/json

idstringOptional
format: uuid

The thread id.

threadRunIdstring or nullOptional
format: uuid

The current run id.

acceptedMessageIdstring or nullOptional
format: uuid

The accepted first-message id, or null when the thread was created without a message.

typestring or nullOptional

The thread type.

titlestring or nullOptional

The thread title.

statusstringOptional

Allowed: "ready" "accepted" "queued" "failed"

The creation result: ready without a first message, accepted with a first message, queued when the first message waits for a run, or failed to start.

createdOnstring or nullOptional
format: date-time

The creation timestamp.

createdBystringOptional
format: uuid

The id of the user who created the thread.

updatedOnstring or nullOptional
format: date-time

The last update timestamp.

updatedBystringOptional
format: uuid

The id of the user who last updated the thread.

agentIdstring or nullOptional
format: uuid

The custom agent assigned to the thread.

projectIdstring or nullOptional
format: uuid

The associated project id.

taskIdstring or nullOptional
format: uuid

The associated task id.

clientIdstring or nullOptional
format: uuid

The associated client id.

documentIdstring or nullOptional
format: uuid

The associated document id.

400 Bad Request

application/json

codestringRequired
minLength: 1

The error code.

descriptionstringRequired
minLength: 1

The description of the error.

linkstringRequired
minLength: 1

The link to the API documentation page.

detailsarray of string or nullOptional

A list of details describing the error.

validationErrorsarray of object or nullOptional

If a validation error occurred, this contains the validation errors for each property.

Show 2 properties
propertystring or nullOptional

The name of the property that failed validation.

messagestring or nullOptional

The reason why this property failed validation.

traceIdstring or nullOptional

The request trace id for tracking the request.

401 Unauthorized

application/json

codestringRequired
minLength: 1

The error code.

descriptionstringRequired
minLength: 1

The description of the error.

linkstringRequired
minLength: 1

The link to the API documentation page.

detailsarray of string or nullOptional

A list of details describing the error.

validationErrorsarray of object or nullOptional

If a validation error occurred, this contains the validation errors for each property.

Show 2 properties
propertystring or nullOptional

The name of the property that failed validation.

messagestring or nullOptional

The reason why this property failed validation.

traceIdstring or nullOptional

The request trace id for tracking the request.

404 Not Found

application/json

codestringRequired
minLength: 1

The error code.

descriptionstringRequired
minLength: 1

The description of the error.

linkstringRequired
minLength: 1

The link to the API documentation page.

detailsarray of string or nullOptional

A list of details describing the error.

validationErrorsarray of object or nullOptional

If a validation error occurred, this contains the validation errors for each property.

Show 2 properties
propertystring or nullOptional

The name of the property that failed validation.

messagestring or nullOptional

The reason why this property failed validation.

traceIdstring or nullOptional

The request trace id for tracking the request.

503 Service Unavailable

application/json

codestringRequired
minLength: 1

The error code.

descriptionstringRequired
minLength: 1

The description of the error.

linkstringRequired
minLength: 1

The link to the API documentation page.

detailsarray of string or nullOptional

A list of details describing the error.

validationErrorsarray of object or nullOptional

If a validation error occurred, this contains the validation errors for each property.

Show 2 properties
propertystring or nullOptional

The name of the property that failed validation.

messagestring or nullOptional

The reason why this property failed validation.

traceIdstring or nullOptional

The request trace id for tracking the request.

Search documentation