Skip to main content
POST
Send a message to an agent

Authorizations

Authorization
string
header
required

An org API key (gh_live_…) from Settings → API keys in the console.

Path Parameters

agent_id
string
required

The agent’s id, e.g. billing.

Body

application/json
input
string

What the person says, up to 8,000 characters. Can be empty when the message has attachments or answers a form (action), and is left out with a decision (approval, answer).

Maximum string length: 8000
conversation_id
string
opening
string

For a new conversation (no conversation_id), the agent's first message, shown as said before the person wrote and recorded as the agent's. Used only when the agent has no first message of its own.

Maximum string length: 500
variables
object

For a new conversation (no conversation_id): what it starts knowing, like { "customer_name": "Ana", "account_id": "A-77" }. Names are lowercase letters, numbers and _ (up to 40), values text up to 1,000 characters. The agent reads them with Eager's own (current_date, current_time, day_of_week, time_zone, language, channel, conversation_id, agent_name, and where known caller_number, agent_number, page_url, user_name, user_email) and doesn't ask for them; a procedure's input of the same name is taken as given. Eager's own names can't be passed, except time_zone (an IANA zone; the date and time are where the person is) and language. Sent with a conversation_id, it's a 400.

stream
boolean
version

draft, or a version number, for this turn only. Default: the published version.

metadata
object

Your own values for a new conversation (a JSON object, up to 4,000 characters). Only used when the conversation is created.

attachments
string[]

Files the person attached: upload ids (upl_…) from POST /v1/uploads, up to 10. Images and PDFs the model sees, text files it reads; any other file needs Run code (tools.code, Claude or GPT models). A file sent in one conversation can’t be sent in another.

Maximum array length: 10
action
object

Answers a form the agent showed (a ui item): { name: "submit", surfaceId, context: { <field id>: value } }, or the same wrapped as { version: "v0.9", action }. Needs conversation_id. The answers reach the agent as the person’s message; input, if sent too, is added after them. 404 for an unknown form, 409 if it was answered already. Or decides a request, as approval and answer do: on an approval item’s surface (surface_id), name is approve or deny; on a question item’s, its form’s submit (context: { answer: ["<option>"] }, or { answer: "<text>" } with no options).

approval
object

Decides an approval item of the conversation (its approval_id): needs conversation_id, and no input. The reply that paused for it carries on.

answer
object

Answers a question item of the conversation (its question_id): needs conversation_id, and no input.

Response

The turn (or, streamed, its events). A decision: the reply it carries on, or with no paused reply, the decision.

object
any
id
string
Example:

"resp_…"

conversation_id
string
status
enum<string>

requires_action: paused on a request in output (an approval or question item) until someone decides it. Send the decision to POST /v1/agents/{agent_id}/responses (approval, answer, or an A2UI action on its surface), and this same response carries on.

Available options:
in_progress,
requires_action,
completed,
failed,
cancelled
error
string | null
output
object[]

This turn’s items.

usage
object

What the reply used, set when it ends (empty until then). Its tokens are paid from the balance at the model’s price, rounded up to a whole cent per reply. The browser and desktop tasks it started are charged as tasks.

created_at
string<date-time>
ended_at
string<date-time> | null
queued_message
object

Only when your message was queued (202): its item.