A webhook lets MyOperator send event data to your server in real time. When a call or SMS event happens, we POST a JSON payload to a URL you provide. Your system can then record, route, or trigger workflows instantly.
Quick answer: A webhook is an automated HTTP POST from MyOperator to your endpoint whenever a subscribed event occurs.
Use webhooks when you need near real‑time updates from MyOperator without polling the API. Example use cases:
flowchart LR A[MyOperator Event] --> B[Deliver POST to your URL] B --> C{Your server returns 2xx?} C -- Yes --> D[Delivery logged: Success] C -- No/Timeout --> E[Retry per policy]Delivery basics
call.answered).Optional security
X-MyOperator-Signature (HMAC‑SHA256 of the raw body).Tip: Use a temporary endpoint like a Postman Mock Server or webhook.site during setup.
Result: Your webhook shows as Active. You can view deliveries under Webhook Logs.
Figure 1: Add Webhook in MyOperator Dashboard.
From Dashboard
From your machine (cURL)
curl -X POST "https://your-server.example.com/webhooks/myoperator" \ -H "Content-Type: application/json" \ -d '{ "id": "evt_01JABCXYZ123", "type": "call.answered", "created_at": "2025-08-26T10:03:59Z", "data": { "call_id": "call_78e3c7", "from": "+12025550123", "to": "+12025550987", "agent": "+919876543210", "direction": "inbound", "answered_by": "agent", "duration_sec": 143 } }'Validate delivery
If you enabled Signing secret, verify X-MyOperator-Signature using HMAC‑SHA256 over the raw request body and your secret.
Node.js (Express)
import crypto from "crypto";function verify(req, secret) { const signature = req.header("X-MyOperator-Signature"); const payload = req.rawBody; // ensure raw body middleware const digest = crypto.createHmac("sha256", secret).update(payload).digest("hex"); return crypto.timingSafeEqual(Buffer.from(signature, "hex"), Buffer.from(digest, "hex"));}Python (Flask)
import hmac, hashlibdef verify(request, secret: str) -> bool: signature = request.headers.get("X-MyOperator-Signature", "") digest = hmac.new(secret.encode(), request.get_data(), hashlib.sha256).hexdigest() return hmac.compare_digest(signature, digest)Security notes
Event: call.started
{ "id": "evt_01JAAAFM8Z8M9V33M2N8D3P3S4", "type": "call.started", "created_at": "2025-08-26T10:00:00Z", "data": { "call_id": "call_78e3c7", "from": "+12025550123", "to": "+12025550987", "direction": "inbound", "queue": "Sales" }}Minimal receivers
Node.js (Express)
import express from "express";const app = express();app.use(express.json({ verify: (req, res, buf) => { req.rawBody = buf; } }));app.post("/webhooks/myoperator", async (req, res) => { // TODO: verify signature if enabled const evt = req.body; if (evt.type === "call.answered") { // handle } res.status(200).send("ok");});app.listen(3000, () => console.log("listening on 3000"));Python (Flask)
from flask import Flask, requestapp = Flask(__name__)@app.post("/webhooks/myoperator")def receive(): evt = request.get_json(force=True) # TODO: verify signature if enabled if evt.get("type") == "call.ended": pass return ("ok", 200)if __name__ == "__main__": app.run(port=3000)Common errors
Content-Type.