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);
Antwort200
{
  "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.

Parameter

webhook_idstring

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

Anfrage-Nutzlast

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.

Antwort-Payload

status
string
erforderlich

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
erforderlich

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
erforderlich

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.

Untergeordnete Attribute anzeigen

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

event_payload.type
string
erforderlich

Always amb.accepted for this event.

Possible values: amb.accepted

event_payload.timestamp
string
erforderlich

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

event_payload.data
object
erforderlich

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

Untergeordnete Attribute anzeigen
event_payload.data.workspace_id
string
erforderlich

Workspace that owns this message.

event_payload.data.message
object
erforderlich

Message state when the event occurred. Later state changes do not alter this snapshot. Customer metadata is included when present; reserved Bird metadata is excluded.

Untergeordnete Attribute anzeigen
event_payload.data.message.id
string
erforderlich

ID of the message, assigned when it is accepted or received. Pass it as message_id to the get-message and list-events endpoints.

event_payload.data.message.conversation_id
string
erforderlich

The conversation this message belongs to.

event_payload.data.message.business_account_id
string
erforderlich

The business the message was sent from or received by.

event_payload.data.message.from
string

Apple business identifier on outbound messages, or the customer's opaque Apple identifier on inbound messages. Omitted when that address is unavailable on a historical record.

event_payload.data.message.to
string

Customer's opaque Apple identifier on outbound messages, or the Apple business identifier on inbound messages. Omitted when that address is unavailable on a historical record.

event_payload.data.message.direction
string
erforderlich

Whether a message was sent by the business or received from the customer:

  • outbound: A reply the business sent into the conversation.
  • inbound: A message the customer sent.

Possible values: outbound, inbound

event_payload.data.message.status
string
erforderlich

Send status:

  • accepted: Accepted and queued for delivery to Apple.
  • sent: Handed to Apple. There is no delivery or read receipt on this channel, so sent is the furthest an outbound message's status advances.
  • send_failed: Sending stopped because of a business or conversation restriction, a recipient opt-out, an Apple refusal, or exhausted attempts. An earlier attempt may have reached Apple if its response or the local record of success was lost. See last_error for why sending stopped.
  • rejected: Refused by Bird before any send attempt and never charged: the destination has no price, the wallet could not fund the send, or the content cannot be sent yet. See last_error.
  • received: Received as an inbound message.

Possible values: accepted, sent, send_failed, rejected, received

event_payload.data.message.kind
string
erforderlich

Derived content classification for filtering and statistics.

Possible values: text, attachment, rich_link, quick_reply, list_picker, time_picker, form, apple_pay, authenticate, imessage_app, interactive

event_payload.data.message.source
string

Who sent this message. Absent on an inbound message, which has no source to report.

Possible values: operator, automation, api

event_payload.data.message.content
object
erforderlich

Native message content. Outgoing interactions contain requests; incoming interactions contain replies.

Untergeordnete Attribute anzeigen
event_payload.data.message.content.type
string
erforderlich

Always text.

Value: text

event_payload.data.message.content.body
string

Text displayed in the message. Use one U+FFFC object replacement character per attachment to control placement.

event_payload.data.message.content.subject
string

Subject displayed above the message body.

event_payload.data.message.content.attachments
array

Ordered attachments. Each object supplies a source URL or an encrypted Apple reference.

Untergeordnete Attribute anzeigen
event_payload.data.message.content.rich_link_data
object
Untergeordnete Attribute anzeigen
event_payload.data.message.content.rich_link_data_ref

Reusable Apple content reference. Supply the decryption key, or the signed bid and data_ref_sig returned by Apple.

Untergeordnete Attribute anzeigen
event_payload.data.message.content.rich_link_data_ref.title
string

Title supplied by Apple for the preview.

event_payload.data.message.content.rich_link_data_ref.url
string
erforderlich

Location of the encrypted preview.

event_payload.data.message.content.rich_link_data_ref.owner
string
erforderlich

Owner identifier supplied by Apple.

event_payload.data.message.content.rich_link_data_ref.signature_base64
string
erforderlich

Signature supplied by Apple.

event_payload.data.message.content.rich_link_data_ref.key
string
erforderlich

Decryption key supplied by Apple.

event_payload.data.message.content.rich_link_data_ref.size
integer
erforderlich

Size of the encrypted preview in bytes.

event_payload.data.message.content.rich_link_construct
object

Asks Apple to build the rich link preview when the message is sent, rather than through a prior POST /v1/amb/messages/construct-payload call. No caller holds a signed reference until the send itself resolves one.

Untergeordnete Attribute anzeigen
event_payload.data.message.content.interactive_data

A built-in interaction or custom iMessage app. Custom apps require the app metadata and both message bubbles.

Untergeordnete Attribute anzeigen
event_payload.data.message.content.interactive_data_ref

Reusable Apple content reference. Supply the decryption key, or the signed bid and data_ref_sig returned by Apple.

Untergeordnete Attribute anzeigen
event_payload.data.message.in_reply_to_message_id
string

Original message matched through Apple’s request identifier within the same workspace, business, and conversation. Omitted when no verified match exists, including when more than one sent message in the conversation uses the reply's request identifier.

event_payload.data.message.reply_message_id
string

Latest customer reply whose in_reply_to_message_id names this message. Omitted until a reply is matched, and in webhook payloads.

event_payload.data.message.replied_at
string

When Apple delivered the reply in reply_message_id to Bird. This can be slightly earlier than that reply's created_at, which records when Bird processed it. Omitted until a reply is matched, and in webhook payloads.

event_payload.data.message.locale
nullable string

Locale for this message, preserved in Apple’s format, for example en_US. Outbound messages use the request override, then the conversation locale, then the business default. Inbound messages preserve the locale in Apple’s callback. Null when unknown.

event_payload.data.message.category
string

The category this message was sent with, for reporting only. It does not affect sending or suppression policy, or select an Apple department or purpose. Defaults to an empty string when a send names no category. Absent on an inbound message, which has no category to report.

event_payload.data.message.metadata
object

Arbitrary JSON object for per-message context. Maximum 2 KB serialized. Top-level keys beginning with __bird are reserved. Returned in the send response, message reads and customer message webhooks.

event_payload.data.message.tags
array of object

Structured {name, value} filter labels applied to this message. Absent on an inbound message.

Untergeordnete Attribute anzeigen
event_payload.data.message.cost
nullable object
erforderlich

Recorded per-message charge before MAC pricing. Null in the initial send response, while unpriced, and for MAC-covered replies. MAC fees belong to monthly contact usage, not individual messages. Historical charges have no priced passthrough component.

Untergeordnete Attribute anzeigen
event_payload.data.message.last_error
nullable object

Failure detail on a message whose send failed or that Bird rejected before any send attempt. Omitted when there is no failure detail.

Untergeordnete Attribute anzeigen
event_payload.data.message.created_at
string
erforderlich

The moment this message was accepted (outbound), or recorded by Bird after Apple delivered it (inbound). This is the timestamp the outbound statistics families bucket and attribute on; there is no separate accepted_at field.

event_payload.data.message.sent_at
nullable string

When the selected sending outcome occurred. Null unless the current status is sent and the message is outbound. For older messages without a retained sending event, the stored record time is used.

event_payload.data.message.data_ref

Reusable encrypted content reference returned by Apple after a successful send. Absent until Apple returns one.

Untergeordnete Attribute anzeigen
event_payload.data.message.group
string

Apple department identifier carried by this message. Omitted when absent from the message or unavailable on a historical record.

event_payload.data.message.intent
string

Apple purpose identifier carried by this message. Omitted when absent from the message or unavailable on a historical record.

event_payload.data.message.requested_language
nullable string
erforderlich

The template language requested by the send, in canonical form. Null when the send named no language or used no template.

event_payload.data.message.resolved_language
nullable string
erforderlich

The template language whose text was rendered, in canonical form. Null when the send used no template. This can differ from requested_language when the template's fallback policy selects another language.

event_payload.data.message.template_id
nullable string
erforderlich

The template rendered for this message, or null for a message sent with native content.

event_payload.data.message.template_version_id
nullable string
erforderlich

The workspace published version or synthetic built-in version rendered at acceptance, or null for a message sent with native content. For a built-in template, template_content_hash identifies the exact catalogue source.

event_payload.data.message.template_content_hash
nullable string
erforderlich

The rendered language's source fingerprint, or null for a message sent with native content.

error
string

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