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
AuthorizationBearerSend 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 nullOptionalThe custom-agent preset. Its current settings override the supplied model and reasoning.
contentstring or nullOptionalThe message text. Required when no attachments are supplied.
attachmentsarray of object or nullOptional20 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 nullOptionalThe identifier returned when uploading a temporary file. Do not also supply aworkFileId.
aworkFileIdstring or nullOptionalThe identifier of an existing awork file the caller can read. Do not also supply temporaryFileId.
modelProviderstring or nullOptionalThe provider for a model override. Supply it together with modelName.
modelNamestring or nullOptionalThe model to use for this message. It must be available in the workspace.
reasoningLevelstring or nullOptionalThe reasoning level for this message. Supported values depend on the selected model.
toolAccessobjectOptionalPer-message agent tool access options.
Show 4 properties
aworkbooleanOptionalWhether awork tools are enabled for this run.
webSearchbooleanOptionalWhether web search is enabled for this run.
googleGenAibooleanOptionalWhether Google GenAI tools are enabled for this run.
openAiImageGenerationbooleanOptionalWhether OpenAI image generation is enabled for this run.
connectorIdsarray of string or nullOptionalThe connector selection for this message.
connectorConnectionsarray of object or nullOptionalConnection choices for custom-agent connectors. These do not change agent settings.
Show 2 properties
connectorIdstringOptionalThe connector identifier.
connectionIdstringOptionalThe connection identifier.
skillIdsarray of string or nullOptionalThe skill selection for this message.
typestringRequiredAllowed: "personal-agent" "custom-agent"
1 Select personal-agent for the awork Agent, or custom-agent for a configured workspace agent.
agentIdstringOptionalThe configured agent to run. Required for custom-agent threads; omit for ordinary personal-agent threads.
titlestring or nullOptionalThe thread title.
projectIdstring or nullOptionalThe project context id.
taskIdstring or nullOptionalThe task context id.
clientIdstring or nullOptionalThe client context id.
documentIdstring or nullOptionalThe document context id.
Responses
200 OK
application/json
idstringOptionalThe thread id.
threadRunIdstring or nullOptionalThe current run id.
acceptedMessageIdstring or nullOptionalThe accepted first-message id, or null when the thread was created without a message.
typestring or nullOptionalThe thread type.
titlestring or nullOptionalThe thread title.
statusstringOptionalAllowed: "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 nullOptionalThe creation timestamp.
createdBystringOptionalThe id of the user who created the thread.
updatedOnstring or nullOptionalThe last update timestamp.
updatedBystringOptionalThe id of the user who last updated the thread.
agentIdstring or nullOptionalThe custom agent assigned to the thread.
projectIdstring or nullOptionalThe associated project id.
taskIdstring or nullOptionalThe associated task id.
clientIdstring or nullOptionalThe associated client id.
documentIdstring or nullOptionalThe associated document id.
400 Bad Request
application/json
codestringRequired1 The error code.
descriptionstringRequired1 The description of the error.
linkstringRequired1 The link to the API documentation page.
detailsarray of string or nullOptionalA list of details describing the error.
validationErrorsarray of object or nullOptionalIf a validation error occurred, this contains the validation errors for each property.
Show 2 properties
propertystring or nullOptionalThe name of the property that failed validation.
messagestring or nullOptionalThe reason why this property failed validation.
traceIdstring or nullOptionalThe request trace id for tracking the request.
401 Unauthorized
application/json
codestringRequired1 The error code.
descriptionstringRequired1 The description of the error.
linkstringRequired1 The link to the API documentation page.
detailsarray of string or nullOptionalA list of details describing the error.
validationErrorsarray of object or nullOptionalIf a validation error occurred, this contains the validation errors for each property.
Show 2 properties
propertystring or nullOptionalThe name of the property that failed validation.
messagestring or nullOptionalThe reason why this property failed validation.
traceIdstring or nullOptionalThe request trace id for tracking the request.
404 Not Found
application/json
codestringRequired1 The error code.
descriptionstringRequired1 The description of the error.
linkstringRequired1 The link to the API documentation page.
detailsarray of string or nullOptionalA list of details describing the error.
validationErrorsarray of object or nullOptionalIf a validation error occurred, this contains the validation errors for each property.
Show 2 properties
propertystring or nullOptionalThe name of the property that failed validation.
messagestring or nullOptionalThe reason why this property failed validation.
traceIdstring or nullOptionalThe request trace id for tracking the request.
503 Service Unavailable
application/json
codestringRequired1 The error code.
descriptionstringRequired1 The description of the error.
linkstringRequired1 The link to the API documentation page.
detailsarray of string or nullOptionalA list of details describing the error.
validationErrorsarray of object or nullOptionalIf a validation error occurred, this contains the validation errors for each property.
Show 2 properties
propertystring or nullOptionalThe name of the property that failed validation.
messagestring or nullOptionalThe reason why this property failed validation.
traceIdstring or nullOptionalThe request trace id for tracking the request.