Skip to content

Webhooks

Managing webhooks through the API

Create, list, update and delete a key's endpoints, change the secret, test, read the delivery log and replay a delivery.

/api/v1/webhooks manages a key's endpoints: up to 10 per key, each with its address, its events and its secret. A full_access key is required (401 restricted_api_key otherwise); a sending_access key sets its webhook in the console. Each key only sees its own endpoints: one belonging to another key responds 404.

The console (Administration › API keys › Webhook, or Developers › Webhooks for a personal key) shows the key's first endpoint, as before; the API manages all of them.

MethodPathRole
POST/api/v1/webhookscreate; the secret is in the response, only once
GET/api/v1/webhookslist (without the secrets)
GET/api/v1/webhooks/{id}read
PATCH/api/v1/webhooks/{id}change the address, the events, the description, the status
DELETE/api/v1/webhooks/{id}delete, with its delivery log
POST/api/v1/webhooks/{id}/rotate-secretchange the secret, with a grace period
POST/api/v1/webhooks/{id}/testsend a webhook.test event
GET/api/v1/webhooks/{id}/deliveriesdelivery log
GET/api/v1/webhooks/{id}/deliveries/{delivery}one delivery, with its content
POST/api/v1/webhooks/{id}/deliveries/{delivery}/replayreplay a delivery

Creating an endpoint

cURL

curl https://mail.example.com/api/v1/webhooks \
  -H "Authorization: Bearer $VOAARO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "endpoint": "https://app.example.com/webhooks/voaaro",
    "events": ["email.delivered", "email.bounced", "contact.unsubscribed"],
    "description": "Production"
  }'

Node / Bun

const { data: hook, error } = await voaaro.webhooks.create({
  endpoint: "https://app.example.com/webhooks/voaaro",
  events: ["email.delivered", "email.bounced", "contact.unsubscribed"],
  description: "Production",
})
// Keep it right away: it will not be shown again.
console.log(hook!.signing_secret)

Python

hook = voaaro.Webhooks.create({
    "endpoint": "https://app.example.com/webhooks/voaaro",
    "events": ["email.delivered", "email.bounced", "contact.unsubscribed"],
    "description": "Production",
})
print(hook["signing_secret"])  # keep it right away

PHP

$hook = $voaaro->webhooks->create([
    'endpoint' => 'https://app.example.com/webhooks/voaaro',
    'events' => ['email.delivered', 'email.bounced', 'contact.unsubscribed'],
    'description' => 'Production',
]);
echo $hook->signing_secret; // keep it right away

Go

hook, err := client.Webhooks.Create(&voaaro.CreateWebhookRequest{
	Endpoint:    "https://app.example.com/webhooks/voaaro",
	Events:      []string{"email.delivered", "email.bounced", "contact.unsubscribed"},
	Description: "Production",
})
fmt.Println(hook.SigningSecret) // keep it right away

Response 201:

JSON
{
  "object": "webhook",
  "id": "5d2e8a17-4c90-4b3f-a6e1-0f7b9c2d4e58",
  "endpoint": "https://app.example.com/webhooks/voaaro",
  "events": ["email.bounced", "contact.unsubscribed", "email.delivered"],
  "status": "enabled",
  "description": "Production",
  "created_at": "2026-11-12T09:00:00Z",
  "updated_at": "2026-11-12T09:00:00Z",
  "secret_rotation": null,
  "signing_secret": "whsec_…"
}
FieldRule
endpoint (or url)https://, without credentials, at most 2,000 characters; the address must be public (private addresses are refused at delivery)
events1 to 30 names from the event list; the console's short names (delivered, bounced…) mean email.delivered, email.bounced… An event outside the key's rights (for instance contact.created for a sending_access key): 422
descriptionat most 200 characters; null clears it
statusenabled (default) or disabled

A malformed address responds 400; beyond 10 endpoints, 422. The secret (whsec_…) is only given here and at rotation: it cannot be read back (a difference from Resend). To retry an interrupted creation without making two, send an Idempotency-Key: the retry returns the same response, secret included.

Reading, updating, deleting

GET /api/v1/webhooks (everything without limit, cursor with it) and GET /api/v1/webhooks/{id} return the same object, without signing_secret. secret_rotation is { "previous_secret_expires_at": "…" } as long as the old secret still signs, null otherwise.

PATCH /api/v1/webhooks/{id} takes the same fields, all optional; events replaces the whole list. Set "status": "disabled" to suspend an endpoint without losing it: it no longer receives anything, except webhook.test.

cURL
curl -X PATCH https://mail.example.com/api/v1/webhooks/$WEBHOOK_ID \
  -H "Authorization: Bearer $VOAARO_API_KEY" -H "Content-Type: application/json" \
  -d '{"events": ["email.bounced", "email.complained"], "status": "enabled"}'

DELETE /api/v1/webhooks/{id} responds { "object": "webhook", "id": "…", "deleted": true }; its delivery log goes with it.

Changing the secret

POST /api/v1/webhooks/{id}/rotate-secret draws a new secret, which signs right away. The old one also signs for grace_hours hours (24 by default, from 0 to 72): each request then carries two signatures, and your application keeps the old secret while it deploys the new one (details). "grace_hours": 0 stops the old one at once, for a compromised secret.

cURL

curl https://mail.example.com/api/v1/webhooks/$WEBHOOK_ID/rotate-secret \
  -H "Authorization: Bearer $VOAARO_API_KEY" -H "Content-Type: application/json" \
  -d '{"grace_hours": 24}'

Node / Bun

const { data } = await voaaro.webhooks.rotateSecret(webhookId, { graceHours: 24 })

Python

r = voaaro.Webhooks.rotate_secret(webhook_id, {"grace_hours": 24})

PHP

$r = $voaaro->webhooks->rotateSecret($webhookId, ['graceHours' => 24]);

Go

r, err := client.Webhooks.RotateSecret(webhookID, &voaaro.RotateWebhookSecretRequest{GraceHours: voaaro.Int(24)})
JSON
{
  "object": "webhook",
  "id": "5d2e8a17-4c90-4b3f-a6e1-0f7b9c2d4e58",
  "signing_secret": "whsec_…",
  "previous_secret_expires_at": "2026-11-13T09:00:00Z"
}

Testing

POST /api/v1/webhooks/{id}/test queues a webhook.test event (data: {}) and responds 202 { "object": "webhook_delivery", "id": "…" }: follow this delivery in the log.

Delivery log

Each send to an endpoint is a delivery, kept for 30 days. GET /api/v1/webhooks/{id}/deliveries lists them from newest to oldest, 20 per page without limit. Filters: status (pending, sending, delivered, failed) and event_type (email.bounced, contact.created…).

cURL
curl "https://mail.example.com/api/v1/webhooks/$WEBHOOK_ID/deliveries?status=failed&limit=50" \
  -H "Authorization: Bearer $VOAARO_API_KEY"
JSON
{
  "object": "webhook_delivery",
  "id": "9a4f1c27-3e8b-4d06-b5a2-7c1e0d9f6b43",
  "webhook_id": "5d2e8a17-4c90-4b3f-a6e1-0f7b9c2d4e58",
  "event_type": "email.bounced",
  "status": "failed",
  "attempts": 9,
  "last_status": 503,
  "last_error": null,
  "created_at": "2026-11-10T08:00:00Z",
  "delivered_at": null,
  "next_attempt_at": null,
  "replay_of": null
}
FieldMeaning
statuspending (waiting for an attempt), sending (in progress), delivered (2xx response received), failed (given up after the 9 attempts)
attemptsattempts made
last_status, last_errorHTTP code of the last response, or the network error
next_attempt_atnext attempt, for a pending delivery
replay_ofthe replayed delivery, for a replay

GET /api/v1/webhooks/{id}/deliveries/{delivery} adds payload: the exact body sent (type, created_at, data).

Replaying a delivery

POST /api/v1/webhooks/{id}/deliveries/{delivery}/replay creates a new delivery of the same content (same type, same created_at, same data), which goes out within seconds. Response 202 { "object": "webhook_delivery", "id": "<new>", "replay_of": "<original>" }. The original does not change.

  • The new delivery has its own Voaaro-Event-Id and a fresh signature: if your application ignores events already processed by their Voaaro-Event-Id, a replay gets through; if it must deduplicate the content, compare type, created_at and the identifier in data (id or email_id).
  • At most 20 replays per minute per key (429 rate_limit_exceeded beyond).
  • After an outage on your side: list the failed deliveries of the period, then replay them.
cURL
curl -X POST https://mail.example.com/api/v1/webhooks/$WEBHOOK_ID/deliveries/$DELIVERY_ID/replay \
  -H "Authorization: Bearer $VOAARO_API_KEY"

Each creation, update, deletion, rotation and replay is written to the audit log (webhook.save, webhook.delete, webhook.rotate, webhook.replay), on behalf of the key.

Esc