Webhooks
The BSP API lets you configure a notification URL per client. When events occur on templates, the platform sends a POST to that URL with the event payload.
Get the configuration
Endpoint: GET /v1/webhook/config
Query params: client_id (optional, requires BSP_CN if it differs from the token)
curl --request GET \
--url 'https://api.chattigo.com/v1/webhook/config?client_id=6' \
--header 'Authorization: Bearer <token>'Response (200):
{
"id": 6,
"url": "https://my-server.com/webhook/whatsapp",
"active": true
}Errors
| Code | Case |
|---|---|
400 | Invalid client_id |
403 | client_id different from the token without BSP_CN |
404 | No configuration exists for that client |
Create or update the configuration
Endpoint: PUT /v1/webhook/config
curl --request PUT \
--url 'https://api.chattigo.com/v1/webhook/config' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"client_id": 6,
"url": "https://my-server.com/webhook/whatsapp"
}'| Code | Case |
|---|---|
200 | Configuration saved |
400 | url required, or invalid client_id |
403 | Cross-client without BSP_CN |
If you do not send
client_id in the PUT, the token’s client_id is used.Event notification
When the configuration is active, the API notifies the URL with POST and Content-Type: application/json. The payload varies by event (saveCreatedEvent, saveUpdatedEvent, etc.).
Notifier behavior
- Events are sent asynchronously — they do not block the HTTP response.
- Notification errors are logged without failing the main request.
- The HTTP client uses configurable timeouts and connection limits.
HTTP client configuration
| Key | Default | Description |
|---|---|---|
webhook.max_conns_per_host | 50 | Max connections per host |
webhook.max_idle_conns_per_host | 50 | Max idle connections per host |
webhook.idle_conn_timeout_secs | 10 | Idle connection timeout |
webhook.max_idle_conns | 50 | Max total idle connections |
webhook.timeout_secs | 60 | Timeout per request |
Your endpoint must respond quickly and be idempotent: events can repeat and the notifier does not retry on error.