After creating a session, send launch to begin and text for a customer message. Use HTTP Streaming for incremental Chat output. For Voice, use action.send.

Send an action

Use the session key returned when you create a session in the Authorization header. The response is an SSE stream of trace events followed by an end event. Use a client that supports POST, the authorization header, and incremental event parsing.

Endpoint
POST
/v4/interact/stream

Authentication

authorization
string
header
required

Session key returned from the start session endpoint.

Request body

action
object
required

The user's action for this conversation turn. Most commonly, the text action is used to send a message to the agent as a user.

variables
object

Key-value pairs to set or update on the session before this turn is processed. Useful for injecting context like a user's name, account tier, or current page. Learn more.

state
any
config
object

Optional settings for this turn.

Response

200 - text/event-stream

Launch or continue

Send launch once to begin the conversation. Send text for the next user message, using the same session key.

See Handling responses to turn the output into your interface.

Non-streaming HTTP alternative

Receive the completed turn as JSON when incremental output is unnecessary.

Use the session key returned when you create a session in the Authorization header. The response contains the completed turn’s traces array.

Endpoint
POST
/v4/interact

Authentication

authorization
string
header
required

Session key returned from the start session endpoint.

Request body

action
object
required

The user's action for this conversation turn. Most commonly, the text action is used to send a message to the agent as a user.

variables
object

Key-value pairs to set or update on the session before this turn is processed. Useful for injecting context like a user's name, account tier, or current page. Learn more.

state
any
config
object

Optional settings for this turn.

Response

200 - application/json
traces
object[]
required

An array of traces that occurred during this turn.

Use the up and down arrow keys to select a result, Enter to open it, and Escape to close the search.