Webhooks (outbound URL)
Base: /v2/webhooks
Auth + Premium/Enterprise + active plan required. See HTTP API v2 Overview — Access rules. These routes do not require phoneNumberId.
Also read: HTTP API v2 Overview
Configure Webhook Programmatically
This endpoint lets you configure your own webhook URL where you can receive real-time updates from AvenPing — such as notifications for:
- New incoming messages
- Lead events (e.g., new WhatsApp lead)
By setting a webhook URL (and webhook code):
- AvenPing will send HTTP
POSTrequests containing event data directly to your server. - You can automate responses or trigger your own integrations based on these events.
Info:
This is primarily for your use: when you configure these details, AvenPing will send outbound JSON payloads to your provided URL whenever an important event (like a new message, or a new lead) happens in your account.
The format and types of events are the same as those in the dashboard’s Settings → Webhooks section.
How are webhook details managed?
Your webhook configuration is represented by two properties on your account:
webhookUrlwebhookCode
You can retrieve or update these settings via the API routes:
GET /v2/webhooks/configPOST /v2/webhooks/config
This matches the same operations available in the dashboard UI, so you can automate webhook setup directly from your own backend.
Note: This endpoint is only concerned with delivering updates from AvenPing to your server. It does not handle or modify any direct WhatsApp API or Meta webhook configuration—there’s no involvement with your WhatsApp Cloud API webhooks here.
GET /v2/webhooks/config
Returns the current outbound webhook URL and code (empty strings when unset).
Example:
bash
curl -sS "https://api.avenping.com/v2/webhooks/config" \
-H "Authorization: Bearer YOUR_TOKEN"Response 200:
json
{
"success": true,
"data": {
"webhookUrl": "https://example.com/webhooks/avenping",
"webhookCode": "hex_secret_from_generate_or_dashboard",
"isVerified": false,
"lastVerified": null
}
}isVerified and lastVerified are reserved for future use; they match the shape returned by the app settings API.
POST /v2/webhooks/config
Saves both webhook URL and webhook code. Both are required (same rule as the dashboard).
Body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
webhookUrl | string | Yes | Must be a valid http: or https: URL |
webhookCode | string | Yes | Shared secret string (generate via endpoint below or UI) |
Example:
bash
curl -sS -X POST "https://api.avenping.com/v2/webhooks/config" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"webhookUrl":"https://example.com/hooks/avenping","webhookCode":"YOUR_CODE"}'Response 200: same data shape as GET /v2/webhooks/config, with updated values.
Errors: 400 VALIDATION_ERROR for missing fields or invalid URL.
DELETE /v2/webhooks/config
Clears webhookUrl and code for the authenticated user (stops outbound POSTs to your URL from AvenPing processing).
Example:
bash
curl -sS -X DELETE "https://api.avenping.com/v2/webhooks/config" \
-H "Authorization: Bearer YOUR_TOKEN"Response 200:
json
{
"success": true,
"data": {
"cleared": true
}
}POST /v2/webhooks/generate-code
Generates a new random webhook code (64 hex characters, same algorithm as Settings → Webhooks → Generate code in the app) and saves it on your user. It does not change webhookUrl. After this, call POST /v2/webhooks/config with your URL and the new code if you are configuring from scratch.
Example:
bash
curl -sS -X POST "https://api.avenping.com/v2/webhooks/generate-code" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Response 200:
json
{
"success": true,
"data": {
"webhookCode": "new_hex_string"
}
}