curl --location 'https://api.weya.live/backend/api/webhooks' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "Salesforce CRM Sync",
"url": "https://your-domain.com/webhook",
"bearerToken": "YOUR_ENDPOINT_TOKEN"
}'
{
"status": true,
"code": 201,
"message": "Webhook created successfully",
"errorMessage": null,
"data": {
"_id": "6890abc123456789abcdef01",
"name": "Salesforce CRM Sync",
"url": "https://your-domain.com/webhook",
"bearerToken": "YOUR_ENDPOINT_TOKEN",
"userId": "64e5f12345abcdef12345678",
"organizationId": "64e5f12345abcdef00000001",
"isActive": true,
"createdAt": "2026-07-20T12:45:00.000Z",
"updatedAt": "2026-07-20T12:45:00.000Z"
}
}
Webhooks
Create Webhook
Add a URL that call outcomes are sent to.
POST
/
api
/
webhooks
curl --location 'https://api.weya.live/backend/api/webhooks' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "Salesforce CRM Sync",
"url": "https://your-domain.com/webhook",
"bearerToken": "YOUR_ENDPOINT_TOKEN"
}'
{
"status": true,
"code": 201,
"message": "Webhook created successfully",
"errorMessage": null,
"data": {
"_id": "6890abc123456789abcdef01",
"name": "Salesforce CRM Sync",
"url": "https://your-domain.com/webhook",
"bearerToken": "YOUR_ENDPOINT_TOKEN",
"userId": "64e5f12345abcdef12345678",
"organizationId": "64e5f12345abcdef00000001",
"isActive": true,
"createdAt": "2026-07-20T12:45:00.000Z",
"updatedAt": "2026-07-20T12:45:00.000Z"
}
}
Overview
Create a webhook in your organization. Once it’s added to a campaign under Track Call Outcomes (pushingCrms with type: "webhook"), the result of each finished call in that campaign is sent to its URL as a JSON POST request.
Prerequisites
- An API key for your workspace
- A public
https(orhttp) URL that acceptsPOSTrequests
Request
curl --location 'https://api.weya.live/backend/api/webhooks' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "Salesforce CRM Sync",
"url": "https://your-domain.com/webhook",
"bearerToken": "YOUR_ENDPOINT_TOKEN"
}'
Request Parameters
If your endpoint requires authentication, its token. It is sent as
Authorization: Bearer <token> with each request (the Bearer prefix is added if missing).Response
{
"status": true,
"code": 201,
"message": "Webhook created successfully",
"errorMessage": null,
"data": {
"_id": "6890abc123456789abcdef01",
"name": "Salesforce CRM Sync",
"url": "https://your-domain.com/webhook",
"bearerToken": "YOUR_ENDPOINT_TOKEN",
"userId": "64e5f12345abcdef12345678",
"organizationId": "64e5f12345abcdef00000001",
"isActive": true,
"createdAt": "2026-07-20T12:45:00.000Z",
"updatedAt": "2026-07-20T12:45:00.000Z"
}
}
The new webhook.
data._id is the ID to use as crmId and schemaId in a campaign’s pushingCrms.Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request –
Webhook URL is required,Invalid Webhook URL format, orInvalid protocol. Only http and https are allowed. - 401 Unauthorized – Missing or invalid API key.
- 500 Internal Server Error – Unexpected server error.
Delivery
- The first request is sent about 5 minutes after the call ends, so the recording and call analysis can be included.
- Your endpoint has 10 seconds to respond. Redirects are followed.
- Network errors,
408,429and5xxresponses are retried, up to 8 attempts in about 22 hours. ARetry-Afterheader is respected. Other4xxresponses are not retried. - A completed call is sent only once its call analysis is ready. If the analysis isn’t ready within 30 minutes, the call is not sent.
- Each finished call attempt is sent separately, so a contact that is called again can be sent more than once.
- Attempts that never reached the telephony provider, attempts the provider dropped because it was at capacity, and expired contacts are not sent.
- If a recording arrives after the first request, the call is sent again.
After creating a webhook, add it to a campaign with
pushingCrms: [{ "type": "webhook", "crmId": "<webhook _id>", "schemaId": "<webhook _id>" }] when creating or updating the campaign. Calls that ended before the webhook was added are not sent.Was this page helpful?

