Skip to content
Select themeSelect language

post_api_agent_messages

POST
/api/agent-messages
curl --request POST \
--url https://example.com/api/agent-messages \
--header 'Content-Type: application/json' \
--cookie supacloud_session=<supacloud_session> \
--data '{ "body": "example", "conversation_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "correlation_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "in_reply_to": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "intent": "example", "kind": "example", "message_id": "example", "to": "example" }'
Media typeapplication/json

POST /api/agent-messages body.

object
body
required
string
conversation_id
string | null format: uuid
correlation_id
string | null format: uuid
in_reply_to
string | null format: uuid
intent
string | null
kind
string | null
message_id
string | null
to
required
string
Examplegenerated
{
"body": "example",
"conversation_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"correlation_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"in_reply_to": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"intent": "example",
"kind": "example",
"message_id": "example",
"to": "example"
}

Message persisted; inserted is false on an idempotent replay.

Media typeapplication/json

POST /api/agent-messages body — the stored row plus whether this call inserted it (a replayed message_id returns inserted: false).

object
inserted
required
boolean
message
required

One mailbox message as the wire sees it. sender_kind / kind / origin / status are the canonical tokens of the row’s typed lens, so the wire vocabulary has a single source.

object
body
required
string
correlation_id
string | null format: uuid
created_at
required
string format: date-time
delivered_at
string | null format: date-time
handled_at
string | null format: date-time
id
required
string format: uuid
in_reply_to
string | null format: uuid
kind
required
string
mailbox_key
required
string
message_id
required
string
origin
required
string
sender_kind
required
string
sender_label
string | null
sequence_num
required
integer format: int32
status
required
string
Examplegenerated
{
"inserted": true,
"message": {
"body": "example",
"correlation_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"created_at": "2026-04-15T12:00:00Z",
"delivered_at": "2026-04-15T12:00:00Z",
"handled_at": "2026-04-15T12:00:00Z",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"in_reply_to": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"kind": "example",
"mailbox_key": "example",
"message_id": "example",
"origin": "example",
"sender_kind": "example",
"sender_label": "example",
"sequence_num": 1,
"status": "example"
}
}

Structured client error

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited too_many_requests quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}

Authentication required

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited too_many_requests quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}

Permission denied

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited too_many_requests quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}

Structured server error

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited too_many_requests quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}