Webhooks allow the Sinch servers to communicate with your server backend. The webhooks
endpoint lets you create, update, and delete webhooks programmatically.
Returns a paginated list of webhooks for the specified project. If no page token is supplied then all registered webhooks (of maximum `15`) are returned in alphabetical order.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
List of webhooks
BadRequest
Unauthorized
InternalServerError
Returns a paginated list of webhooks for the specified project. If no page token is supplied then all registered webhooks (of maximum `15`) are returned in alphabetical order.
{- "previousPageToken": "{{TOKEN}}",
- "nextPageToken": "{{TOKEN}}",
- "pageSize": 1,
- "totalSize": 5,
- "webhooks": [
- {
- "id": "{{WEBHOOK_ID_1}}",
- "projectId": "{{PROJECT_ID}}",
- "triggers": [
- "WHATSAPP_TEMPLATE_APPROVED",
- "WHATSAPP_TEMPLATE_REJECTED"
]
}, - {
- "id": "{{WEBHOOK_ID_2}}",
- "projectId": "{{PROJECT_ID}}",
- "triggers": [
- "WHATSAPP_TEMPLATE_APPROVED",
- "WHATSAPP_TEMPLATE_REJECTED"
]
}
]
}
Register a new webhook for a project. The webhook will be used to communicate updates to resources. Maximum of `15` webhooks allowed per project.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
Webhook to register
Webhook created
BadRequest
Unauthorized
Conflict
FailedDependency
InternalServerError
{- "secret": "{{WEBHOOK_SECRET}}",
- "triggers": [
- "ALL"
]
}
Example of a response when registering for all triggers.
{- "id": "{{WEBHOOK_ID}}",
- "projectId": "{{PROJECT_ID}}",
- "triggers": [
- "ALL"
]
}
Return an already created webhook.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
webhookId required | string The unique ID of the webhook. |
Webhook response
BadRequest
Unauthorized
NotFound
InternalServerError
Example of a response for a webhook with specific triggers.
{- "id": "{{WEBHOOK_ID}}",
- "projectId": "{{PROJECT_ID}}",
- "triggers": [
- "WHATSAPP_TEMPLATE_APPROVED",
- "WHATSAPP_TEMPLATE_REJECTED"
]
}
Deletes an already created webhook.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
webhookId required | string The unique ID of the webhook. |
Webhook deleted
BadRequest
Unauthorized
NotFound
InternalServerError
{- "errorCode": "webhook_invalid_id",
- "message": "Webhook ID is invalid.",
- "resolution": "Verify that the format of the string ID is the same as originally returned when created."
}
Replace an already existing webhook.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
webhookId required | string The unique ID of the webhook. |
Webhook to replace
Webhook response
BadRequest
Unauthorized
NotFound
Conflict
InternalServerError
{- "secret": "{{WEBHOOK_SECRET}}",
- "triggers": [
- "WHATSAPP_TEMPLATE_APPROVED",
- "WHATSAPP_TEMPLATE_REJECTED"
]
}
Example of a response for an update to specific triggers.
{- "id": "{{WEBHOOK_ID}}",
- "projectId": "{{PROJECT_ID}}",
- "triggers": [
- "WHATSAPP_TEMPLATE_APPROVED",
- "WHATSAPP_TEMPLATE_REJECTED"
]
}
Update an already existing webhook.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
webhookId required | string The unique ID of the webhook. |
Webhook to update
Webhook response
BadRequest
Unauthorized
NotFound
Conflict
InternalServerError
{- "secret": "{{WEBHOOK_SECRET}}",
- "triggers": [
- "WHATSAPP_TEMPLATE_APPROVED",
- "WHATSAPP_TEMPLATE_REJECTED"
]
}
Example of a response for an update to specific triggers.
{- "id": "{{WEBHOOK_ID}}",
- "projectId": "{{PROJECT_ID}}",
- "triggers": [
- "WHATSAPP_TEMPLATE_APPROVED",
- "WHATSAPP_TEMPLATE_REJECTED"
]
}