Webhooks
Event Publisher delivers real-time webhook notifications when events occur on your PBXware system. Instead of polling for changes, your server receives an HTTP POST the moment something happens.
Scope, event filtering and the event envelope apply to both delivery methods and are described in the Event Publisher overview.
How It Works
- Configure a webhook — provide your endpoint URL, the events to subscribe to, and optional authentication
- An event fires — when a subscribed event occurs, PBXware sends a
POSTrequest with a JSON payload to your URL - Acknowledge receipt — return any
2xxHTTP response; no body is required
Retries: If your server returns a non-
2xxresponse or does not respond, PBXware retries delivery using exponential backoff. Retry behavior is configurable. Use theevent_idfield in the envelope for idempotency — retried deliveries carry the sameevent_idas the original.
Because webhooks are standard HTTP POST requests, Event Publisher integrates naturally with workflow automation platforms such as Zapier, Make (Integromat), Microsoft Power Automate, and n8n — no custom server required for many use cases. If a target system expects a different payload structure, you will need to implement your own middleware to handle the transformation.
Key Concepts
Outbound authentication — PBXware can authenticate requests to your endpoint using a static bearer token, HTTP Basic Auth, or OAuth2 (Client Credentials or Resource Owner Password Credentials).
Endpoint testing — Before creating a webhook, you can test whether your endpoint is reachable and correctly authenticated.
See the Event Publisher API Reference for all webhook management endpoints.
Example: Receiving Events
Acknowledge each request immediately and process the event afterwards. Retried deliveries carry the same event_id, so skip events you have already handled; in production, keep the handled IDs in a store with an expiry rather than in memory. If you configured outbound authentication, check the Authorization header before accepting a request.
Save it as an ES module, for example server.mjs, and install Express: npm install express
import express from 'express';
const app = express();
app.use(express.json());
const seenEventIds = new Set();
function handleEvent(event) {
console.log(event.event, event.event_id);
}
app.post('/webhook', (req, res) => {
res.sendStatus(200);
const event = req.body;
if (seenEventIds.has(event.event_id)) return;
seenEventIds.add(event.event_id);
handleEvent(event);
});
app.listen(3000);
The Call Events and SMS Events pages show what handleEvent can do with each event.