Webhooks
Subscribe an HTTPS endpoint to events and LimePhone will POST each occurrence to you as it happens — no polling.
Events
call.created
A call starts
call.completed
A call ends
call.failed
A call fails
message.sent
An outbound message is sent
message.received
An inbound message arrives
message.failed
A message fails to deliver
Delivery
Deliveries are JSON POSTs with a 10-second timeout. A non-2xx response is retried with backoff up to your subscription's maxRetries (default 3). Each delivery carries:
X-Webhook-Event
The event name, e.g. call.completed
X-Webhook-Delivery-Id
Unique id for this delivery (stable across retries)
X-Webhook-Signature
HMAC-SHA256 signature — verify it before trusting the payload
Verifying signatures
Every subscription has a secret, returned when you create it. The signature is HMAC-SHA256(secret) over the string {timestamp}.{deliveryId}.{rawBody}, where timestamp is the timestamp field inside the payload and rawBody is the exact JSON body as received. Compare with a constant-time comparison and reject anything that doesn't match.
// Node.js — capture the raw request body for signing
const crypto = require('crypto');
function verify(req, secret) {
const payload = JSON.parse(req.rawBody);
const canonical = payload.timestamp + '.' +
req.headers['x-webhook-delivery-id'] + '.' + req.rawBody;
const expected = crypto.createHmac('sha256', secret)
.update(canonical).digest('hex');
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(req.headers['x-webhook-signature']));
}A complete receiver
Example event payload
List webhooks
GET /v1/webhooks — scope webhooks:read
Lists your webhook subscriptions. Also available: GET /v1/webhooks/{id} for one.
Create a webhook
POST /v1/webhooks — scope webhooks:write
Creates a subscription. The response includes the signing secret — store it now; treat it like a password.
url
string
yes
HTTPS endpoint to receive deliveries
events
string[]
yes
One or more event names from the list above
description
string
no
maxRetries
integer 0–10
no
Retry attempts on failure. Default 3
Update a webhook
PATCH /v1/webhooks/{id} — scope webhooks:write
Change the URL or events, pause with isActive: false, or adjust maxRetries.
Delete a webhook
DELETE /v1/webhooks/{id} — scope webhooks:write
Deletes a subscription. Returns 204. Deliveries stop immediately.