Payload format

Each request to your webhook endpoint will be of content type application/json with the following content schema:

{
  "id": "Unique ID for this event.",
  "webhook_id": "Unique ID for the webhook endpoint that this event was sent to.",
  "data": "JSON-serialized data for the event."
}

json

The data key is a JSON-serialized string representation of the object associated with the event. For example, if the event is a subscription creation, data will contain a snapshot of the created subscription object as a JSON string.

Example payloadCopied!

This is an example payload for a customer update event:

{
  "id": "aaaabbbb-cccc-dddd-eeee-ffffgggghhhh",
  "webhook_id": "webhook_endpoint_abcdefg12345678",
  "data": "{\"id\": \"event_dev_abcdefg12345678\", \"object\": \"event\", ...}"
}

The value of data can be parsed into the following JSON object:

{
  "id": "event_dev_abcdefg12345678",
  "object": "event",
  "created_at": "2024-06-02T00:15:10.020202-07:00",
  "updated_at": "2024-06-02T00:15:10.020202-07:00",
  "is_deleted": false,
  "account_id": "account_dev_abcdefg12345678",
  "type": "customer.updated",
  "data": {
    "id": "cus_dev_abcdefg12345678",
    "email": "john.doe@example.ai",
    "object": "customer",
    "address": {
      "city": "Boise",
      "line1": "2512 Walnut Avenue",
      "line2": "",
      "line3": "",
      "state": "ID",
      "country": "US",
      "zip_code": "83716"
    },
    "discount": null,
    "last_name": "Doe",
    "account_id": "account_dev_abcdefg12345678",
    "created_at": "2024-06-02T00:14:57.575457-07:00",
    "first_name": "John",
    "is_deleted": false,
    "updated_at": "2024-06-02T00:14:57.575457-07:00",
    "balance_atom": null,
    "subscriptions": []
  },
  "data_previous": null,
  "request_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "request_idempotency_key": null,
  "pending_webhooks": 1
}

The exact schema of data depends on the type of event and matches that of the corresponding object in the API reference. For example, the customer event above contains data which follows the customer object schema.