Phone systems
Send a survey after a call on your phone system or cloud contact centre, from the system's own end-of-call event.
What it does
When a call ends, your phone system sends its end-of-call event to Sayvara. Sayvara reads the caller's number, checks that the call was answered, and queues one survey invitation for that customer. Your survey rules, consent, opt-outs, contact frequency and send hours still decide whether and when the survey goes out.
Each phone system has its own page with the setup steps:
| Phone system | Status |
|---|---|
| Amazon Connect | Works with Amazon Connect |
| 3CX | Add-on, available on request |
| Yeastar | Add-on, available on request |
| Asterisk and FreePBX | Add-on, available on request |
| Avaya | Add-on, available on request |
| Webex Contact Center | Add-on, available on request |
"Add-on, available on request" means the recipe on the page is built into Sayvara and tested with sample data, and our team sets it up with you and checks it against your own system. Ask at support@sayvara.com.
What you need first
- In Sayvara: the owner or admin role, a plan that includes the API, and one live survey.
- An API key with the scope
events.write. See API keys.
The address
Your phone system (or a small relay next to it) sends a POST with a JSON body to:
https://api.sayvara.com/v1/triggers/pbx/<system><system> is one of amazon-connect, 3cx, yeastar, asterisk, avaya or webex-cc. Send your key as
Authorization: Bearer <your API key>.
You can add these options to the address, for example ?surveyId=...&direction=inbound:
| Option | What it does |
|---|---|
surveyId |
The survey to send. Leave it out when your organisation has exactly one live survey. |
orgUnitId |
The branch or team the calls belong to. |
lang |
ar or en: the survey language for a new contact. |
country |
The country for numbers written without a country code, such as 0501234567. One of SA (default), AE, KW, BH, QA, OM. |
utcOffset |
The phone system's time zone, such as +03:00, for systems that send local time. Default: the country's. |
minTalkSeconds |
Calls with less talk time get no survey. Default 0. |
direction |
inbound, outbound or both (default). |
Which calls get a survey
A call gets a survey only when it is a call with a customer (not between two extensions), it was answered, it lasted
at least minTalkSeconds, and the customer's number is a valid phone number. Each call gets at most one survey:
if your phone system sends the same event again, Sayvara answers with the first result and queues nothing new.
The answer
| Answer | Meaning |
|---|---|
202 with "status": "queued" |
The survey invitation is queued. replayed: true means the same call was sent before. |
202 with "status": "ignored" |
No survey for this call. reason says why (below). Your phone system should not retry. |
400 VALIDATION_FAILED |
The body is not this system's end-of-call event, or an option is wrong. details names the field. |
401 |
The API key is wrong, or the signature is missing or wrong (next section). |
409 SIGNED_REQUEST_REPLAYED |
This signed request was already used with other options. Sign it again (next section). |
404 UNKNOWN_PBX_RECIPE |
The <system> part of the address is not one of the six. |
reason |
Why |
|---|---|
not_call_end |
Not an end-of-call event, or a call offered to an agent who did not answer while the customer still waits. |
not_voice |
A chat, email or task, not a call. |
internal |
A call between two extensions, or no customer conversation. |
not_answered |
Missed, busy or not answered. |
too_short |
Less talk time than minTalkSeconds. |
direction_filtered |
The call's direction is not the direction you chose. |
no_customer_number |
The event has no customer number. |
invalid_number |
The number is not a phone number Sayvara can place. Check country. |
already_surveyed |
Another leg of a call that already has its survey, such as a transfer to a second agent. |
Signed triggers
If an admin has turned on signed triggers for your organisation, every call to this address must also carry a
Sayvara-Signature header, made over the exact body you send:
Sayvara-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>" with your signing secret>The signature must be less than 5 minutes old. Phone systems cannot make this signature themselves, so a small relay sends the event on: the pages show one for each system. Without signed triggers, the API key alone is enough.
The options in the address (surveyId, direction and the others) are not part of the signature. So Sayvara accepts
each signed request with the options it was first sent with: the same signed request sent again with other options
queues nothing new (the answer is ignored, or 409 SIGNED_REQUEST_REPLAYED when the first answer was
ignored). To change the options, change them in the relay; its next requests are signed again.
Data shared
Per call, Sayvara reads the call id, the direction, whether it was answered, the talk time, the end time and the customer's number. It keeps the number on the contact, and the call id as the invitation's reference. Recordings and transcripts are never read.
Was this page helpful?
Thanks. Need more help? Email support@sayvara.com