Skip to main content
POST
Send a chat message

Authorizations

API-Token
string
header
required

16-character API token associated with your OSVI account. Find it in your dashboard under Settings → API.

Body

application/json
agent_uuid
string
required

Unique identifier of the agent handling the conversation.

Example:

"agent_IsZ3Q6Sf_60Eh26XQMGbz-R_og"

customer_id
string
required

Your identifier for the customer sending the message. Used to resolve the active session when session_id is omitted.

Example:

"+15551112222"

content
string

The customer's message text. Required unless type is interaction_response.

Example:

"Hi, I need help."

session_id
string

Optional session UUID to route the message to. If omitted, the engine resolves the active/new session for the customer + agent.

Example:

"4718a326-417b-4dda-90d0-21fd65a11cb8"

idempotency_key
string

Your identifier for this exact turn. A retry with the same key returns the original result instead of running the turn twice. Can also be sent as an Idempotency-Key header instead of a body field.

Example:

"wh-2f8a1c-attempt-1"

input_fields
object

Arbitrary key-value object made available to the agent at runtime (e.g. name, account tier). Only applied when this request creates a new session.

Example:
state_fields
object

Initial values for the agent's configured state fields — structured values the agent's prompt and tools can read and update as the conversation continues. Only applied when this request creates a new session.

Example:
context
string[]

Free-text context entries for a newly created session. Only the most recent 5 non-empty strings are retained. Only applied when this request creates a new session — use Inject Context to add context to an existing one.

Example:
type
enum<string>
default:message

message for a normal text message (default). interaction_response to answer an interactive message the agent sent — see Interactive messages.

Available options:
message,
interaction_response
Example:

"message"

interaction_id
string<uuid>

Required when type is interaction_response. The interaction_id of the interactive message being answered.

Example:

"b6a3e6c2-2d61-4a4b-9c9a-5a2d9f6a2b10"

option_id
string

Shorthand answer for a simple option tap — the id of the selected option. Send this or response, not both. See Interactive messages.

Example:

"opt_confirm"

response
object

Structured answer to a pending interactive message. Send this or option_id, never both. See Interactive messages.

supported_interactions
object[]

Declares which interactive message types your client can render, so the agent only offers ones you can display. See Interactive messages.

Example:

Response

Message processed and agent reply returned. data.state can also be merged when your message was folded into another turn already in flight for the session — in that case reply is null and no separate reply is produced for this request.

success
boolean
Example:

true

data
object