Submits a message to an agent conversation.

POSThttps://api.awork.com/api/v1/agents/threads/{threadId}/messages
POST https://api.awork.com/api/v1/agents/threads/{threadId}/messages

Submits a new message to an existing agent conversation for processing. Provide text, attachments, or both. The message starts processing or enters the thread's queue. The response confirms acceptance; it does not contain the agent's reply. Read GET /agents/threads/{threadId}/messages to retrieve replies. Each request submits a new message. Retrying after a lost response can submit the message again. Processing is subject to the workspace's AI availability and usage limits.

Authentication

AuthorizationBearer

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

Path parameters

threadIdstringRequired
format: uuid

The id of the thread to send the message in.

Request body Required

The model with the content to send to the agent thread.

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.

answerToInterruptIdstring or nullOptional

The interrupt identifier returned with the question being answered.

Responses

200 OK

application/json

threadIdstringOptional
format: uuid

The thread id.

threadRunIdstring or nullOptional
format: uuid

The run id when the message started immediately.

acceptedMessageIdstring or nullOptional
format: uuid

The server-assigned message id. This identity is retained while queued and when execution starts.

queuedMessageIdstring or nullOptional
format: uuid

The persisted queue entry id when the message must wait.

queueOrderinteger or nullOptional
format: int32

The message's current queue position when it must wait.

threadUpdatedOnstring or nullOptional
format: date-time

The parent timestamp saved with queue acceptance, absent for immediate execution.

isQueuedbooleanOptional

Whether the backend stored the message in the queue.

statusstringOptional

Allowed: "accepted" "queued" "failed"

Whether the message was accepted for execution, queued behind another message, or failed to start.

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.

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