Skip to main content
POST
Chat

Overview

Sends one message to an assistant in a conversation and returns the reply once it is complete. To receive the reply as it is written, use Chat (Streaming). The reply’s conversation_id can differ from the one you sent, for example when your message continues something the assistant is already arranging with you. Send follow-up messages to the returned conversation_id. Operation name: agent.chat. Member keys can call it.

Authorization

string
required
Your Composer API key

Headers

string
required
Must be set to application/json

Body

string
required
The assistant to talk to.
Example
string
required
The conversation, from Create Conversation.
Example
string
required
Your message.
Example
string
Your IANA time zone, for example America/New_York. Send it on every message so “today” and “tomorrow” mean your day.
Example
string
The surface the message comes from, such as sms. It shapes the reply (plain and short for a text, markdown on the web). Omit for a web chat.
array
Files attached to this message: [{ filename, excerpt }], where excerpt is the file’s text (for example from Ingest File with excerpt_chars).
boolean
Admin only. Set to true to speak as the person a conversation belongs to, when that person isn’t you. Default false.
Example Request

Response

string
The assistant’s reply.
string
The conversation the turn landed in. Use this for follow-ups.
string
The id of this turn.
array
Pictures or charts drawn in this reply.
array
Places found on the map in this reply.
object
Present when the message opened or continued something the assistant is arranging with you.
Example Success Response

Example cURL

cURL

Error Codes