Skip to main content
POST
Create message

Authorizations

Authorization
string
header
required

API token from cargo-ai login. Send as Authorization: Bearer <token>.

Scopes

openid

OpenID Connect identity.

profile

Name and profile claims.

email

Email address.

offline_access

Refresh token.

Headers

Idempotency-Key
string

Client-generated key that makes this write safe to retry. Reusing the same key with the same request returns the original response instead of creating a second record. Reusing it with a different request returns 422. A concurrent retry while the first request is still running returns 409. Keys expire after 24 hours. Not accepted on multipart file uploads. Optional: a request without one is processed as it always was.

Maximum string length: 255
Example:

"8e03978e-40d5-43e8-bc93-6894a57f9324"

Body

application/json

Request body schema.

parts
any[]
required

Message parts.

chatUuid
string<uuid>

Chat identifier. When omitted, a new draft chat is created automatically and the message is added to it.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
agentUuid
string<uuid>

Agent identifier for the chat. Only used when chatUuid is omitted and a chat is created automatically.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
releaseUuid
string<uuid>

Release identifier for the chat. Only used when chatUuid is omitted and a chat is created automatically.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
actions
Actions · object[]

Actions available for the message.

resources
Resources · object[]

Resources available for the message.

capabilities
Capabilities · object[]

Capabilities available for the message.

mcpClients
MCP clients · object[]

MCP clients to use for the message.

systemPrompt
string

System prompt for the message.

withReasoning
boolean

Whether to include reasoning.

effort
enum<string>

How hard the model thinks: a coding harness's effort, or the provider's reasoning effort when reasoning is on. Unset keeps the default.

Available options:
low,
medium,
high,
xhigh,
max
temperature
number

Sampling temperature.

maxSteps
number

Maximum number of steps.

integrationSlug
string

Integration identifier.

connectorUuid
string<uuid>

Connector identifier.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
languageModelSlug
string

Language model identifier.

output
Output · object

Output format for the assistant message. Defaults to text when omitted.

harnessSlug
enum<string>

Coding-agent runtime. When set, the auto-created chat is driven by the harness instead of streamText. Rejected with a chatUuid.

Available options:
claudeCode,
codex,
openCode,
deepAgents
stateUuid
string<uuid>

Project (state) a coding harness works on, used when creating a new chat; rejected with a chatUuid. Unbound when unset.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
envVars
Harness env vars · object[]

Environment variables for the harness's shell commands, used when creating a new chat; rejected with a chatUuid.

runAsUserUuid
string<uuid>

Service user the harness turn runs as, used when creating a new chat; rejected with a chatUuid.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Response

Create message

userMessage
User message · object
required

The queued user message, when the chat was busy. It is answered once the turn ahead of it finishes.