Skip to main content
The events webhook lets your own systems — ticketing platforms, CRMs, internal services — trigger your agent. You POST an event, Apollo queues it, and the agent runs on it in the background.
  1. Your system sends POST /messaging/v1/events with a JSON body.
  2. Apollo validates the body, resolves the agent bound to your agent API key, and durably queues the event.
  3. Apollo responds 202 Accepted with an event_id.
The agent runs asynchronously. A 202 confirms the event was queued — not that the agent has finished, or even started, processing it.

Send an event

cURL

POST /messaging/v1/events

Authentication

string
required
Your agent API key (sk-...). The key is bound to a single agent — events are always delivered to that agent, so the body never carries an agent id.
Keep the agent API key secret. Use it only from your servers, never in browsers or mobile apps, and rotate it if it is exposed.

Request body

Provide text, agent_variables, or both as the agent’s input.
string
The message to run the agent on. When omitted, the agent runs on agent_variables alone.
object
default:"{}"
Free-form key/value data passed to the agent as variables for this event. Values may be any JSON type.
string
Your own id for the conversation this event belongs to — any string from 1 to 255 characters. Reuse the same value to continue a conversation; omit it (or send a blank value) to start a new one. Unique per agent. Leading and trailing whitespace is trimmed.

Response

string
required
Unique id assigned to this event. Include it when contacting support.

Conversations

thread_id groups events into a conversation. It is your own identifier — a ticket id, chat id, or order id — not one Apollo issues.
Events that share a thread_id are processed in the order they were accepted.

Payload

Only text, agent_variables, and thread_id reach the agent. Any other top-level fields are accepted but ignored. That means you can point an existing third-party webhook at this URL without it being rejected — just put everything the agent needs inside agent_variables. The request body is limited to 1 MiB.

Errors

Failures use the standard error envelope. Branch on error.code and keep a default branch — the set may grow.
422

Retries

502 and 503 responses mean the event was not queued. They are safe to retry with backoff. 4xx responses won’t succeed unchanged. Fix the request or the agent configuration before sending again.