Project API

Webhooks

Add, change and remove webhook endpoints from the API, CLI or dashboard, receive project events at your URL, and verify their signatures.

View as Markdown ↗

Project key. Acts in the project the key belongs to. An all-access key works too — name the project with an X-Project-Id header. How keys and scopes work.

How webhooks work

Webhooks push events for the selected project to your server — no polling. Email Bump sends a signed POST with a JSON body and stops when your endpoint returns a 2xx. Failed deliveries get up to five attempts total, with delays of 5, 10, 20, and 40 seconds between attempts. Delivery records show the attempt count and latest outcome. Destinations refused by the public-address safety check are not retried.

A webhook URL has to resolve to a public address. Anything pointing at localhost, a private range, or a cloud metadata address is refused when you save it and again when a delivery is attempted — a name that resolves somewhere private later doesn't get a second chance. Redirects aren't followed, so the URL you give us is the only place we send.

Endpoints

GET/v1/webhooks
POST/v1/webhooks
GET/v1/webhooks/event-types
GET/v1/webhooks/{id}
PATCH/v1/webhooks/{id}
DELETE/v1/webhooks/{id}
POST/v1/webhooks/{id}/test
GET/v1/webhooks/{id}/deliveries

These are the same endpoints as Developers → Webhooks in the dashboard, so one added in either place shows in both. The CLI has a command for each (emailbump webhooks:create, webhooks:list, webhooks:get, webhooks:update, webhooks:delete, webhooks:test, webhooks:deliveries, webhooks:events), and so does its MCP server.

Create an endpoint

POST /v1/webhooks adds an endpoint. Send the URL, and the events you want in event_types; leave it out or empty to receive every event. GET /v1/webhooks/event-types lists them.

cURL
curl -X POST https://emailbump.com/api/v1/webhooks \
  -H "Authorization: Bearer ebk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/hooks/emailbump",
    "description": "Bounces and complaints to our CRM",
    "event_types": ["email.bounced", "email.complained"]
  }'
200 response
{
  "webhook": {
    "id": "8d0c7a52-3f1e-4b9a-a6d2-5e7f1c2b9a40",
    "url": "https://example.com/hooks/emailbump",
    "description": "Bounces and complaints to our CRM",
    "enabled": true,
    "event_types": ["email.bounced", "email.complained"],
    "created_at": "2026-11-06T15:04:05Z",
    "updated_at": "2026-11-06T15:04:05Z",
    "secret": "whsec_3J9kQ2…"
  }
}
Store the secret now

secret is in this response and nowhere else: listing or fetching the endpoint never returns it. You need it to verify signatures. If it's lost, delete the endpoint and create a new one.

Body parameters

urlstringrequired

Where events are posted. https:// (or http://). It must resolve to a public address: localhost, private ranges and cloud metadata addresses are refused.

event_typesstring[]optional

Events to send. Empty or left out means all of them. An unknown name is a 400.

descriptionstringoptional

A note for you, shown in the dashboard.

A project can have 20 endpoints, one per URL: a second endpoint at a URL the project already uses is a 409. Every event goes to each endpoint that subscribes to it, so subscribe one endpoint to more events rather than adding another for each.

Send an Idempotency-Key header to make a retry safe. Repeating the request with the same key and body within 24 hours returns the first response — the same endpoint, secret included — with Idempotent-Replayed: true, instead of creating another. The key rules are the ones for sending email: a refused request does not keep its key, and the same key with a different body is a 409 with code: idempotency_key_reused. A repeat needs a valid API key for the project and a plan that includes webhooks, and returns the response as it was first sent, even if the endpoint has since been changed or deleted.

List, change and delete

GET /v1/webhooks lists the project's endpoints, newest first, as { "data": [...] }. GET /v1/webhooks/{id} returns one as { "webhook": {...} }. Neither includes the secret.

PATCH /v1/webhooks/{id} changes url, description, event_types or enabled. Only the fields you send change. Turning an endpoint off keeps it and its deliveries but sends it nothing, tests included, until it's turned back on, and deliveries already queued or retrying are dropped. Changing the URL drops anything queued for the old one rather than redirecting it. An empty description clears it.

cURL
curl -X PATCH https://emailbump.com/api/v1/webhooks/8d0c7a52-3f1e-4b9a-a6d2-5e7f1c2b9a40 \
  -H "Authorization: Bearer ebk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": false }'

DELETE /v1/webhooks/{id} removes the endpoint and returns 204. Events stop being sent to it straight away, including deliveries still queued or retrying.

Test and deliveries

POST /v1/webhooks/{id}/test sends the endpoint awebhook.test event, signed like a real one. A project can send 10 tests a minute across its endpoints; more is a 429. A turned-off endpoint is refused with a 400.

GET /v1/webhooks/{id}/deliveries shows what was sent and how it went, newest first: event_type, status, your server's status_code, attempts, last_error and the payload. Page with limit (up to 100, default 25) and offset; total counts them all.

status is pending (queued, not tried yet), retrying (an attempt failed and another is scheduled), succeeded (your server answered 2xx) or failed (we gave up: five attempts failed, the endpoint was turned off, deleted or repointed first, or the URL was refused). succeeded and failed are final; for failed, last_error says why.

cURL
curl "https://emailbump.com/api/v1/webhooks/8d0c7a52-3f1e-4b9a-a6d2-5e7f1c2b9a40/deliveries?limit=10" \
  -H "Authorization: Bearer ebk_your_key"

In the dashboard

  1. 01
    Add an endpoint

    Go to Developers → Webhooks and add your HTTPS URL.

  2. 02
    Pick events

    Subscribe to specific events, or leave them all unchecked to receive everything.

  3. 03
    Save the signing secret

    It's shown once on creation — store it to verify incoming requests.

  4. 04
    Send a test

    Use Send test event and watch it appear under the endpoint's deliveries.

Payload shape

Every delivery is a JSON envelope with the event type and its data:

POST body
{
  "id": "dfe336e3-9730-4eb4-8841-7b0bbd766dda",
  "type": "contact.created",
  "created": "2026-07-21T19:56:38Z",
  "data": {
    "contact": {
      "id": "5fef0867-b292-46ca-8371-e24d8575576c",
      "email": "jamie@example.com",
      "subscribed": true
    }
  }
}

Three headers accompany every request:

Headers
Email-Bump-Event: contact.created
Email-Bump-Event-Id: dfe336e3-9730-4eb4-8841-7b0bbd766dda
Email-Bump-Signature: t=1784663798,v1=acf8fe8e05a9fde3347ad708ac3640c9…

Deduplicating deliveries

A delivery can arrive more than once — say your server processed an event but its 2xx never reached us, so we retried. Every event has an id, in the body and in the Email-Bump-Event-Id header, and every retry of a delivery carries the same id and the same body. Each endpoint that receives an event gets the same id.

Record the ids you have processed (a column with a unique constraint works) and skip any you have already seen. Return 2xx for a duplicate too, so it isn't retried again.

Flow webhook steps send Email-Bump-Event-Id too: one id per contact per visit to the step, the same on every retry of that request, and a new one if the contact reaches the step again. Their body has no id, and they are not signed.

Event types

  • contact.created, contact.updated, contact.deleted
  • contact.subscribed, contact.unsubscribed
  • email.delivered, email.opened, email.clicked
  • email.bounced, email.complained
  • email.received — inbound mail arriving
  • campaign.sent

Subscribing to none means you receive all of these project events. A test (the dashboard button, POST /v1/webhooks/{id}/test or emailbump webhooks:test) sends webhook.test separately.

Verify signatures

The Email-Bump-Signature header is t=<timestamp>,v1=<hmac>, where the HMAC is a SHA-256 of {timestamp}.{raw_body} keyed with your endpoint secret. Recompute it and compare before trusting a request:

Node.js
import crypto from "node:crypto";

function verify(rawBody, header, secret, now = Date.now(), maxAgeSeconds = 300) {
  if (!Buffer.isBuffer(rawBody) || typeof header !== "string" ||
      typeof secret !== "string" || secret.length === 0 ||
      !Number.isFinite(now) || !Number.isFinite(maxAgeSeconds) ||
      maxAgeSeconds < 0) return false;
  const match = /^t=([0-9]+),v1=([0-9a-f]{64})$/.exec(header);
  if (!match) return false;
  const timestamp = Number(match[1]);
  if (!Number.isSafeInteger(timestamp) ||
      Math.abs(now / 1000 - timestamp) > maxAgeSeconds) return false;
  const expected = crypto.createHmac("sha256", secret)
    .update(match[1] + ".")
    .update(rawBody)
    .digest();
  const supplied = Buffer.from(match[2], "hex");
  return crypto.timingSafeEqual(expected, supplied);
}
Use the raw request body

Verify against the exact bytes you received, before any JSON re-serialization — re-encoding can change the body and break the signature.

Pass a raw Node.js Buffer to the verifier and return a non-2xx for invalid signatures. It rejects malformed headers and timestamps more than five minutes from your clock. The timestamp is set when the event is queued and reused on retries, not refreshed per attempt: allow for clock skew and your recovery window, and investigate delayed valid events instead of disabling verification. See Node's constant-time comparison requirements.

After verification, durably record the envelope id with a unique constraint and process it idempotently. A valid signature does not prevent replay or duplicate delivery. Return 2xx only once safely accepted; do not assume arrival order or guaranteed delivery after retries are exhausted. Flow webhook steps are separate: they are not signed, but carry Email-Bump-Event-Id (see Deduplicating deliveries).