Skip to main content
A weya webhook sends the result of every finished call in a campaign to your endpoint as a JSON POST request. Each result carries the call status, recording, the values of your post-call metrics and the contact’s own data, so you can update your CRM, trigger a follow-up or feed a report without polling.

Set up a webhook

A webhook is a URL registered once for your organization and then attached to the campaigns that should use it. Each organization can have up to 5 webhooks.
1

Create the webhook

Register your endpoint URL in the dashboard, or with Create Webhook:
2

Attach it to a campaign

In the dashboard, add the webhook to the campaign under Track Call Outcomes. Through the API, set pushingCrms when you upload a campaign or update one:
3

Return 2xx from your endpoint

Respond with any 2xx status within 10 seconds. Do slow work, such as CRM writes, after you respond.
A webhook attached to a campaign receives only calls that end after it was attached. To send calls that already finished, select them in the dashboard and use the bulk CRM sync.

Securing your endpoint

  • If you set bearerToken, every delivery includes Authorization: Bearer <token>. Reject requests without it.
  • Deliveries come from a fixed weya IP address. If your firewall only accepts known addresses, ask weya for it.
  • Only the URL and bearer token are used. Custom headers and body templates are not sent.
  • Register the final URL of your endpoint. weya follows redirects, but a 301 or 302 turns the POST into a GET, so the body is lost.

Payload

Example payload
string
The contact’s ID in the campaign. It stays the same across all attempts to that contact.
string
The ID of this attempt. Use it as your idempotency key: each attempt has its own request_uuid.
string
The campaign’s ID.
string
The agent that handled the call.
string
The channel. voice for calls.
string
The contact’s phone number.
string
The weya phone number the call was made from or received on.
string
Whether the call was outbound or inbound.
string
How the attempt ended. See call statuses.
string
The call’s outcome from the post-call analysis. Empty when no outcome was determined.
string
When the call started (ISO 8601), in the campaign’s timezone.
number
Length of the call.
string
Link to the call recording, when there is one.
array[object]
One entry per post-call metric defined on the agent, each with metric_name and metric_value.
object
The contact’s variables, as uploaded: the columns of your CSV or the fields you sent in callData.
string
When the next attempt to this contact is scheduled, in the campaign’s timezone. Empty when no further attempt is scheduled.
boolean
true when weya will make no further attempts to this contact. expired_reason says why.
object
deprecated
No longer populated. Use lead_data.

When results are sent

weya sends one result per finished attempt with one of these statuses: completed, no-answer, busy, failed, voicemail, ivr, canceled, timeout or aborted. Attempts that were never dialled don’t produce a webhook. The first delivery happens about five minutes after the call ends, so the recording and the transcript analysis are included. If the analysis still isn’t ready, weya checks again every three minutes for up to 30 minutes.
A completed call whose analysis still isn’t ready after 30 minutes is not sent. Watch for completed calls that never reach your endpoint, and check that the agent has post-call metrics defined.

Retries

If your endpoint doesn’t return 2xx, weya decides whether to try again from the response: Retries wait 1 minute, 5 minutes, 15 minutes, 1 hour, 3 hours, 6 hours, then 12 hours, each with up to 10% random jitter. If you return a Retry-After header, weya waits that long instead, between 30 seconds and 6 hours. Pick a response below to see the schedule.

Handling duplicates

Your endpoint can receive the same attempt more than once, for example when the recording arrives after the first delivery and weya re-sends the result with it. Treat request_uuid as the key: store the latest payload for each request_uuid and overwrite older ones.
To build one record per contact, group results by call_id and keep the one with the latest call_started_at.

Stop sending results

Remove the webhook from the campaign’s Track Call Outcomes, or delete the webhook to stop it in every campaign at once. Retries that are already scheduled may still arrive.

Post-call metrics

Define what goes into call_analysis.

Webhooks API

Create, list, update and delete webhooks.