Send a message to the agent
POST/chat/turns
Sends one message to the same agent the Mocart app talks to, as the account that owns the key. Answers 202 at once with the turn; poll GET /chat/turns/{turnId} until status is done or failed. The first message of a conversation has no sessionId; send the sessionId the reply carries on the next one. A turn never runs twice: if it fails, send the message again with a NEW Idempotency-Key, in the SAME conversation (its sessionId) when the problem names one. Idempotency-Key is required.
Request
Responses
- 202
- 400
- 401
- 403
- 409
- 422
- 429
- 503
Accepted - or the replay of an earlier send with this key.
Response Headers
The turn: /api/public/v1/chat/turns/{turnId}.
While the turn is not finished: seconds to wait before polling again (2).
Bad Request. The Idempotency-Key header is missing (IDEMPOTENCY_KEY_REQUIRED) or malformed (INVALID_IDEMPOTENCY_KEY).
Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (ENTITLEMENT_LOST). A uniform problem body is returned with a distinct code; no owner/condition detail (no-leak).
Forbidden. The key lacks the chat scope (API_TOKEN_SCOPE_DENIED), or the account does not have the agent turned on (BETA_ACCESS_REQUIRED).
Conflict. A send with this key is still in progress (IDEMPOTENCY_IN_PROGRESS, retry after Retry-After); or the key was used for a different message (IDEMPOTENCY_KEY_REUSED).
Response Headers
Seconds to wait before retrying.
Unprocessable Content. The body is malformed (VALIDATION_ERROR, every field in errors[]).
Too Many Requests. More requests per minute on this key than the chat plane allows; or the account already has 10 turns queued or running (AGENT_CHAT_TOO_MANY_TURNS_IN_FLIGHT, retry after Retry-After). Nothing was queued and the Idempotency-Key is still usable.
Response Headers
Seconds to wait before retrying.
Service Unavailable (WRITES_PAUSED). Writes are paused; nothing was started and the Idempotency-Key is still usable: retry the SAME request after Retry-After.
Response Headers
Seconds to wait before retrying.