Sign inGet Started

Create a webhook endpoint

POST
/v1/webhooks
const created = await bird.webhooks.create({
  url: "https://acme.com/hooks/bird",
  events: ["email.delivered", "email.bounced"],
  description: "Delivery pipeline",
});
console.log(created.id, created.secret);
Antwort201
{
  "id": "whk_01krdgeqcxet5s7t44vh8rt9mg",
  "url": "https://example.com/webhook",
  "description": "Production webhook endpoint",
  "filter": null,
  "events": [
    "email.delivered",
    "email.bounced"
  ],
  "status": "active",
  "destination": {
    "type": "webhook"
  },
  "created_at": "2026-05-20T09:14:52Z",
  "updated_at": "2026-05-25T16:42:01Z",
  "secret": "whsec_base64encodedvalue",
  "next": [
    {
      "kind": "operation"
    }
  ]
}

Registers an active webhook endpoint that receives the event types in events as signed HTTPS POST requests. See the webhooks guide for delivery, signing, and retry behavior.

The 201 response is the only response that includes the signing secret (whsec_ prefix). Store it immediately; if it is lost, rotate the signing secret.

A non-HTTPS or non-public url, an unknown event type, or exceeding the organization's endpoint limit returns 422.

Anfrage-Nutzlast

url
string

HTTPS URL to deliver events to, at most 2048 characters. The host must be publicly reachable: URLs on private, loopback, or link-local addresses are rejected with a 422. Required unless destination is a connector, whose URL comes from the connector and its config; a URL given with one must equal it.

filter
object

Limit delivery to one mailbox and only email_mailbox events. Omit to include all resources.

Untergeordnete Parameter anzeigen
events
array of string
erforderlich

Event types to subscribe to; the endpoint receives only matching events. Types outside the event catalog return a 422, and an endpoint holds at most 100 entries.

description
string

Human-readable label for this endpoint, up to 256 characters.

destination
object

How each delivery is built. Omit to post the signed event to url unchanged, the same as {"type": "webhook"}.

Untergeordnete Parameter anzeigen

Antwort-Payload

id
string
erforderlich

Unique identifier for the endpoint (whk_ prefix). Accepted as webhook_id by every /v1/webhooks/{webhook_id} operation.

url
string
erforderlich

HTTPS URL where the API delivers events for this endpoint.

description
string

Human-readable label for the endpoint.

filter
nullable object
erforderlich

Mailbox scope configured through filter, or null.

Untergeordnete Attribute anzeigen
events
array of string
erforderlich

Event types this endpoint is subscribed to; only matching events are delivered. Change the set with Update a webhook endpoint.

status
string
erforderlich

Delivery state of the endpoint.

  • active: The initial state; events are being delivered normally.
  • degraded: Recent deliveries are failing. We keep delivering and retrying, and the endpoint returns to active automatically once deliveries succeed again.
  • paused: All delivery is stopped, either because an update set status to paused or automatically after sustained delivery failures. A paused endpoint never resumes on its own: re-enable it with Update a webhook endpoint, then Replay failed deliveries to recover the deliveries that failed before the pause. Events that arrived while it was paused were never attempted, so a replay does not reach them.

Possible values: active, degraded, paused

destination
object

How each delivery to the endpoint is built.

Untergeordnete Attribute anzeigen
created_at
string
erforderlich
updated_at
string
erforderlich
secret
string
erforderlich

Signing secret for this endpoint (whsec_ prefix), used to verify every delivery signature. Present in this response only: store it immediately, it cannot be retrieved again. If you lose it, mint a new one with Rotate webhook signing secret.

next
array of object

What to do next with this endpoint. Empty: deliveries start as the events happen, with nothing left to set up.

Untergeordnete Attribute anzeigen
next.kind
string
erforderlich

What you do about this step.

  • operation: call the operation named in operation, then read again.
  • external: act somewhere this API does not reach, then read again.
  • wait: nothing is asked of you, so read again later.
  • terminal: nothing you do resolves this, so stop retrying.

Tolerate a value you do not recognize: show the description and offer no action.

Possible values (may grow over time): operation, external, wait, terminal

next.description
string
erforderlich

A short, human-readable label for the step, suitable for display.

next.operation
string

The operationId to call. Present only when kind is operation. The operation's own schema says how to call it; this says only which one, and what to address it with.

next.params
object

The parameters that address the operation, by name: {"sender_id": "…"} for an operation on /v1/sms/senders/{sender_id}/requirements. A parameter the operation takes in its query string is given the same way, so an operation addressed as ?subject_id= carries {"subject_id": "…"}. Every parameter the call needs is here, whether its value came from the thing you were acting on or is fixed for this step, so you can make the call from this object alone. Present only when kind is operation and the operation names a subject. A request body, when the operation takes one, is described by the operation's own schema and never appears here.

next.url
string

A URL to open. Present only when kind is external, and only when the step has one. An external step whose description says to go and do something with no URL to open is normal.