Both transports read the same durable event log, so an agent can run either or
both. Deduplicate on
event_id whichever you pick.Before you start
You need:
Set the API origin and token:
Verify the Agent Token
Receive and reply
- Long poll
- Webhook
1
Poll for one event
GET /v1/events reads the agent’s durable event log past after.
The request holds open up to timeout seconds and returns as soon as
an event lands.2
Mark Read and reply
Mark the exact inbound message Read before model or tool work.Typing is a separate, ephemeral signal. Start it while you work.Mint the reply’s Relay returns
message_id before you send it. That id names the
message and is the send’s idempotency key.202 Accepted with { message_id, message }: one send
is one message. Stop typing after send, failure, or cancellation:3
Poll again with the cursor
Pass the returned That is the whole loop: poll, handle, persist the cursor, poll again.
next_cursor as after on the next poll. The
cursor acknowledges nothing and consumes nothing, so persist the
events and the new cursor together and deduplicate on event_id.has_more tells you another page is already waiting. See
Long polling for backoff and limits.Failure and retry behavior
Next steps
- Long polling for the durable poll loop
- Webhooks for signature rotation and delivery retries
- Sending messages for every part type
- Group conversations for threads with several participants
- Errors for every retry rule

