Help centre
العربية Back to sayvara.com

Webhook events

Every webhook event Sayvara sends, when it is sent, and the published event catalogue with a JSON Schema and an example body per event.

Updated

These are the events you can subscribe to with Webhooks. Each delivery is signed; see Check the signature.

When each event is sent

Event Sent when
response.completed A customer completes a survey response.
detractor.flagged A completed response has a detractor score by your organisation's thresholds. It comes in addition to response.completed.
ticket.opened A follow-up ticket is opened.
ticket.updated A ticket is assigned (change: "assigned") or its status changes (change: "status").
ticket.closed A ticket's status changes to closed. It comes in addition to ticket.updated.
survey.sent A survey invitation goes out to a contact (WhatsApp, SMS, email or another channel).
response.received A response is started: a customer opens a survey chat or form (often before the first answer), or a complaint or message is taken in as a response. Imported history is not sent.
outcome.accepted After a ticket, the customer answers the "Is it solved?" check with "solved".
outcome.rejected After a ticket, the customer answers the "Is it solved?" check with "not solved".
contact.opted_out A contact stops messages: a STOP reply, the email unsubscribe link, a staff opt-out or a phone opt-out. Opt-outs from a contacts import are not sent.

survey.sent, response.received, outcome.accepted, outcome.rejected and contact.opted_out are picked up about every 30 seconds, so they usually arrive within a minute.

Example bodies

survey.sent:

{
  "id": "survey.sent:00000000-0000-4000-8000-000000000004",
  "type": "survey.sent",
  "created_at": "2026-11-01T09:30:00.000Z",
  "tenant_id": "00000000-0000-4000-8000-000000000000",
  "test": false,
  "data": {
    "invitationId": "00000000-0000-4000-8000-000000000004",
    "surveyId": "00000000-0000-4000-8000-000000000003",
    "channel": "whatsapp",
    "lang": "ar",
    "source": "manual",
    "sentAt": "2026-11-01T09:30:00.000Z"
  }
}

data of the other new events:

  • response.received: responseId, surveyId, orgUnitId, invitationId, channel, lang and receivedAt.
  • outcome.accepted and outcome.rejected: ticketId, orgUnitId, resurveyId, cycle (0 for the first check), channel, answer (solved or not_solved) and answeredAt.
  • contact.opted_out: contactId, channel (all, email, voice and so on, or null when it stops every channel), sources (how it was stopped, for example ["shared"] for a WhatsApp STOP reply or ["email_unsubscribe"]) and optedOutAt.

The catalogue below has the full JSON Schema and an example for each.

Contact details (include_contact)

By default no delivery has a contact's phone number, email, name or comment. An owner or admin can turn on Include contact phone and email for one endpoint (Integrations, Webhooks, Delivery log, "Events and contact details"; or PUT /v1/tenants/{tenantId}/webhook-endpoints/{webhookId}/options with {"includeContact": true}). Then these events also carry data.contact:

survey.sent, response.received, response.completed, detractor.flagged, outcome.accepted, outcome.rejected and contact.opted_out.

"contact": { "id": "00000000-0000-4000-8000-000000000006", "phone": "+966500000000", "email": "customer@example.com" }
  • The contact is read when each try is sent, so a change or an erasure counts at once. An erased contact is sent with "phone": null and "email": null, and an opt-out that an erased contact makes after the erasure is not sent.
  • data.contact is never stored in the delivery log, and a response without a contact (a shared link, an anonymous answer) has no data.contact.
  • Ticket events never carry a contact. Names and comments are never sent.
  • Turning it off stops it from the next try.

The event catalogue

Sayvara publishes every event with its JSON Schema and an example body. Read it without an API key (one event: add /<event>, for example /v1/automation/events/ticket.updated):

curl "https://api.sayvara.com/v1/automation/events"

The answer has:

Field Meaning
version The date of the catalogue's last change, for example 2026-11-09.
signature How deliveries are signed: the header name, HMAC-SHA256, the signed text <t>.<raw body> and the replay window in seconds (300).
delivery The tries per delivery (10) and the waits between them in minutes, before jitter.
events One entry per event: event, status, subscribable, version, title and description (in English and Arabic), schema and example.

Only events with "status": "emitted" and "subscribable": true are sent, and only those can be subscribed. Other entries have no schema or example, and a subscription to them is refused (400 on POST /v1/automation/hooks, 404 on POST /v1/automation/hooks/{event}).

Each schema is a JSON Schema (version 2020-12) of the whole body. data may gain new optional fields under the same event version, so do not refuse a body because it has a field you do not know. A change that removes or retypes a field comes with a new event version. Each example is marked "test": true and uses fixed sample ids, never real data.