Skip to main content
POST
Send Chat Message

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

chat_id
string
required

Body

application/json
message
string | null

The message to send, in plain text. While Chat waits on its questions (a turn with stop_reason needs_input), a message answers them in words.

answers
ChatAnswerV1 · object[] | null

Answers to Chat's open questions, one per question you answer. Send answers, a message, or both (the message then adds to the answers).

Response

Successful Response

Response from POST /v1/chat/{chat_id}/messages.

chat_id
string
required

The chat's id

url
string
required

The chat in the Happenstance app

turn_id
string
required

The turn to poll: the one this message started, or the running turn it joined

status
enum<string>
required

The turn's status

Available options:
queued,
running,
completed,
failed,
cancelled
joined
boolean
default:false

True when the message joined the turn that was still running: Chat takes it into that turn's work, and the turn's reply and charge cover both messages

answered
boolean
default:false

True when the message or answers answered Chat's open questions

warning
string | null

Warning message when credit balance is low