- Your system sends
POST /messaging/v1/eventswith a JSON body. - Apollo validates the body, resolves the agent bound to your agent API key, and durably queues the event.
- Apollo responds
202 Acceptedwith anevent_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.Request body
Providetext, 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.
thread_id are processed in the order they were accepted.
Payload
Onlytext, 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 onerror.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.