Sign inGet Started

Test a webhook with a sample event

POST
/v1/webhooks/{webhook_id}/test
const result = await bird.webhooks.test("whk_01krdgeqcxet5s7t44vh8rt9mg", {
  event_type: "email.delivered",
});
console.log(result.status);
Réponse200
{
  "status": "delivered",
  "response_status_code": 200,
  "response_body": "OK",
  "response_duration_ms": 142,
  "event_payload": {
    "type": "amb.accepted",
    "timestamp": "2026-09-25T12:00:00Z",
    "data": {
      "workspace_id": "ws_01krdgeqcxet5s7t44vh8rt9mg",
      "message": {
        "id": "amb_01krdgeqcxet5s7t44vh8rt9mg",
        "conversation_id": "acv_01krdgeqcxet5s7t44vh8rt9mg",
        "business_account_id": "abz_01krdgeqcxet5s7t44vh8rt9mg",
        "direction": "outbound",
        "status": "accepted",
        "kind": "text",
        "source": "operator",
        "content": {
          "type": "text",
          "body": "Your order has shipped."
        },
        "locale": "en_US",
        "category": "order_update",
        "tags": [
          {
            "name": "category",
            "value": "welcome"
          }
        ],
        "cost": null,
        "created_at": "2026-09-25T11:59:59Z"
      }
    }
  },
  "error": "connection refused"
}

Sends a signed synthetic event and returns whether your endpoint accepted it, its HTTP status, and the round-trip latency. An unreachable endpoint returns status: failed in the response body. The endpoint has 10 seconds to respond.

The body is a minimal JSON object with the event type, signed like a real delivery. It does not mirror that event's payload. Tests work on paused endpoints and do not appear in List delivery attempts.

The operation returns 412 if the endpoint lacks a valid signing secret or, when event_type is omitted, has no subscribed event type to use.

Paramètres

webhook_idstring

ID of the webhook endpoint (whk_ prefix), as returned when it was created.

Corps de la requête

event_type
string

Event type to simulate. Any type from the event catalog is accepted, whether or not the endpoint subscribes to it; an unknown type returns a 422. When omitted, the endpoint's first subscribed event type is used.

Contenu de la réponse

status
string
obligatoire

Whether your endpoint accepted the test event. delivered means it returned a 2xx status; failed means it returned a non-2xx status or could not be reached (see error for the latter).

Possible values: delivered, failed

response_status_code
nullable integer
obligatoire

HTTP status returned by your endpoint. Null when no response was received (timeout, connection error, DNS failure).

response_body
string

Response body returned by your endpoint, truncated to the first 1024 bytes. Omitted when your endpoint returned no body or could not be reached.

response_duration_ms
integer
obligatoire

Round-trip delivery latency in milliseconds.

event_payload
object

The full event body delivered to your endpoint. Test sends use a minimal synthetic body rather than a full event payload, so this field is omitted.

Afficher les attributs enfants

An outbound message was accepted for processing after confirming billing coverage. This does not confirm receipt by Apple.

event_payload.type
string
obligatoire

Always amb.accepted for this event.

Possible values: amb.accepted

event_payload.timestamp
string
obligatoire

When this lifecycle event occurred, independent of webhook delivery time.

event_payload.data
object
obligatoire

The workspace and message snapshot at the time of the lifecycle event.

Afficher les attributs enfants
error
string

A short explanation of why the event could not be delivered. Present only when your endpoint could not be reached.