Send a message
Starts a turn with your message. If the session already has an active turn, the new turn waits in a queue behind it. The queue holds up to five turns, and they run in the order that you sent them.
The response returns when the turn starts or joins the queue, not when it finishes. To follow the turn, stream the session’s events or get the turn.
Authorizations
Headers
A key that identifies this request for retries, up to 200 printable characters. A retry with the same key and input returns the first request's result instead of repeating the work. If you omit the key, the API generates one and returns it in the Idempotency-Key response header.
1 - 200Path Parameters
Body
Response
The new turn, running or queued.
The turn's state:
queued: waiting behind the session's active turn.running: the agent is working.waiting: the agent needs input from a person, whichinput_requestdescribes.completed,failed, orcancelled: the turn has ended, and its status doesn't change again.
queued, running, waiting, completed, failed, cancelled Why the turn failed, or null if it didn't fail. The code is one of the following:
agent_error: the agent stopped unexpectedly.app_deleted: the App was deleted.input_expired: no one answered the input request in time.interrupted: the turn was interrupted repeatedly without progress.turn_budget_exceeded: the turn ran out of time.user_deleted: the user the turn acts for deleted their account.