Brex uses webhooks to send real-time notifications when events happen in the accounts that you manage. Use webhook subscriptions to subscribe to different webhook events.
Webhooks API (0.1)
A webhook group, which can be used by webhook subscriptions to target only the webhook group members. When an event occurs and it belongs to a member of the group, the webhooks will be sent only to the subscriptions that are associated with the group. If there is no group associated with the event, then the webhook will be sent to all subscriptions that are not associated with any group. Webhook groups are only available for partners.
{ "id": "wg_123", "name": "Some Webhook Group" }
A member of a webhook group.
The ID of the webhook group this member belongs to.
The type of a webhook group member.
| Value | Description |
|---|---|
| ACCOUNT | The webhook group member is a customer account. |
{ "group_id": "wg_123", "member_type": "ACCOUNT", "member_id": "cuacc_123" }
A webhook secret, which can be used to validate that incoming webhook messages were sent by Brex.
The payload of the secret to be used for webhook validation.
The status of a webhook secret.
| Enum Value | Description |
|---|---|
| ACTIVE | The webhook secret is active and can be used to validate webhooks from Brex. |
| PENDING_REVOKE | The webhook secret is still active, but it will soon be revoked. This may happen during key rotations. |
| REVOKED | The webhook secret is no longer active. It cannot be used to validate webhooks from Brex. |
{ "secret": "whsec_123", "status": "ACTIVE" }
A webhook subscription. When events of the specified event types occur, they will be sent to the given URL. If the subscription applies to a webhook group, then only events that apply to the members of that group will be sent. If it does not apply to any group, then only events that don't apply to any specific group will be sent. Webhook groups are only available for partners.
ID of the webhook group to which this subscription applies, if any.
The URL to which webhook events will be sent. Must be a valid HTTPS URL.
List of event types that this webhook subscription listens to.
{ "id": "wsub_123", "group_id": "wg_123", "url": "https://example.com/webhook", "event_types": "[\"EXPENSE_PAYMENT_UPDATED\"]", "status": "ACTIVE" }