How it works
Your app sends POST /v1/events with an event's type and data. HeyServo stores it, answers straight away, and the assistant handles it in the background, following the event types and instructions set up on its Events page. Your code never waits for the assistant.
- The base address is your dashboard's address. For most accounts the endpoint is
https://app.heyservo.ai/v1/events; the exact address is on ConfigureEventsConnect your app. - One events key belongs to one assistant. The key decides which assistant receives the event.
- To hear back what the assistant did, use webhooks, or read the event with
GET.
Authentication
Send an events key as a Bearer token: Authorization: Bearer <events key>. An events key is an API key whose purpose is Send events. Create one on the assistant's Connect your app tab, or in DevelopersAPI keys with that purpose. Owners and admins create keys.
- Keep the key on your server. It is shown only once.
- No request signature is needed: the key is the credential.
- A key with any other purpose is refused with
401 wrong_key.
Send an event
curl -X POST https://app.heyservo.ai/v1/events \
-H "Authorization: Bearer $HEYSERVO_EVENTS_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "order.shipped",
"id": "ord-1042-shipped",
"data": {
"order": "ORD-1042",
"tracking_url": "https://track.example/1042",
"items": ["Chocolate cake", "6 croissants"]
},
"contact": {
"name": "Layla Hassan",
"phone": "+971501234567",
"email": "layla@example.com"
},
"occurred_at": "2026-11-23T09:30:00Z"
}'{
"id": "6f1c2a9e-…",
"external_id": "ord-1042-shipped",
"type": "order.shipped",
"status": "queued",
"reason": null,
"reason_text": null,
"test": false,
"summary": null,
"received_at": "2026-11-23T09:30:02Z",
"run_after": null,
"started_at": null,
"finished_at": null,
"duplicate": false
}The request body
A JSON object. Only type is required.
- typeText
- Required. What happened, in your own words:
user.signed_up,order.shipped. Letters, digits and. _ - : /, starting with a letter or digit. It is matched against the assistant's event types.Limit 1 to 100 characters - idText
- Optional. Your own id for the event. Sending the same id again returns the first event instead of running twice. You can send it as the
Idempotency-Keyheader instead; when both are present,idis used.Limit 200 printable characters - dataText
- Optional. Any JSON object about the event. The assistant reads it as information, never as instructions.Limit 8 levels deep, 2,000 values, strings up to 20,000 characters, 64 KB by default
- contactText
- Optional. The person the event is about:
{name, phone, email}.whatsappis accepted in place ofphone. The phone must be international, like+971501234567. - occurred_atText
- Optional. When it happened, as an ISO 8601 date and time.
- testSwitch
- Optional.
truemakes it a dry run: the assistant decides what to do and every tool only says what it would do.Defaultfalse
Phone numbers and emails found in the event are noted, because by default the assistant may only contact people named in the event or already in your contacts. Put the person in contact or in data.
Sending an event twice
Give every event an id that is unique for that happening, such as your order number plus what happened (ord-1042-shipped). If your app retries after a timeout, the repeat is answered with HTTP 200, the first event and "duplicate": true, and nothing runs again. A new event needs a new id. Without an id, every request is a new event.
Responses
| Status | Code | Meaning |
|---|---|---|
202 | Stored. The assistant handles it in the background. | |
200 | A repeat of an id already sent: the first event, with duplicate: true. | |
400 | invalid_json, invalid_body | The body is not JSON, or not a JSON object. |
400 | type_required, invalid_type | No type, or one that breaks the rules. |
400 | invalid_id | The id is too long or not printable. |
400 | invalid_data, data_too_deep, data_too_complex, data_too_large | data is not an object, is nested too deep, has too many values, or a value is too long. |
400 | invalid_contact | contact is not an object, the phone is not international, or the email is not valid. |
400 | invalid_time | occurred_at is not ISO 8601. |
401 | unauthorized | No key, or the key is invalid or revoked. |
401 | wrong_key | The key's purpose is not Send events. |
413 | payload_too_large | The body is over the data limit plus 16 KB for the rest of the event. |
429 | rate_limited | Too many events from this key. Wait the Retry-After seconds (30). |
503 | events_unavailable | HeyServo has paused events for now. Wait the Retry-After seconds (300); events already stored run once they are back. |
{
"error": {
"code": "invalid_contact",
"message": "`contact.phone` must be in international form, e.g. +971501234567."
}
}- idText
- HeyServo's id for the event.
- external_idText
- Your
id, if you sent one. - typeText
- The event's type.
- statusChoice
- Where it stands.Options
queuedrunningdoneignoredskippedfailedcancelled - reason, reason_textText
- Why it was ignored, skipped, failed or cancelled, as a code and a sentence (see below).
- testSwitch
- Whether it is a dry run.
- summaryText
- When done: the assistant's note on what it did.
- received_at, started_at, finished_atTime
- When it arrived, started and finished.
- run_afterTime
- For a queued event with a delay: when it will run.
- duplicateSwitch
- On a POST: whether this id was already sent.
- actionsList
- On
GET /v1/events/{id}only: what the assistant did or scheduled, each withaction_id,tool,status,recipient,channel,run_at,conversation_idanderror.
| reason | reason_text |
|---|---|
events_off | Events are switched off for this assistant. |
platform_off | Events are paused on HeyServo. |
daily_limit | The assistant reached its daily limit of events. |
credits_exhausted | The account was out of credits. |
suspended | The account is suspended. |
unknown_type | No event type matches, and unknown events are ignored. |
type_ignored | This event type is set to be ignored. |
type_disabled | This event type is switched off. |
cancelled | Cancelled before it ran. |
failed | The assistant could not handle the event. |
interrupted | The event was interrupted and could not be finished. |
agent_missing | The assistant no longer exists. |
Action statuses are scheduled, running, done, failed, skipped, cancelled and simulated (a test that sent nothing).
Read events back
Use the same events key. You only see events sent to that key's assistant.
| Request | Returns |
|---|---|
GET /v1/events/{id} | One event by HeyServo's id, with its actions. |
GET /v1/events/ext:{your id} | One event by your own id, with its actions. |
GET /v1/events?type=user.signed_up&status=done&limit=20 | {"events": [...]}. type and status are optional; limit is 1 to 100, 20 by default. |
curl https://app.heyservo.ai/v1/events/ext:ord-1042-shipped \
-H "Authorization: Bearer $HEYSERVO_EVENTS_KEY"An unknown id answers 404 not_found; a status that is not one of the statuses above answers 400 invalid_status.
Hear back with webhooks
Instead of polling, add a webhook endpoint and subscribe to the event webhooks. They are never sent for test events.
| Webhook | Sent when |
|---|---|
event.processed | An event reaches its final status, with its actions when done. |
event.action.completed | One of the assistant's actions for an event is done. |
event.action.failed | One of its actions failed. |
assistant.signal | The assistant used its Tell your app tool. |
Limits and retention
Testing
- Send
"test": truefor a dry run: the event shows in Activity with a Test badge, and its actions show as Test only. Events must be on for the assistant. - From the dashboard, Send test event runs a dry run even while events are off, so you can try your instructions first.
- Use real-looking phone numbers and emails in tests to see who the assistant would contact.