Skip to content

Webhooks API (0.1)

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.

Download OpenAPI description
Languages
Servers
Production
https://api.brex.com
Staging (Note: This is not a sandbox. It will not work with customer tokens.)
https://api-staging.brex.com

Manage webhook subscriptions.

Operations

Manage webhook groups.

Operations
Schemas

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.

idstringnon-emptyrequired

The ID of the webhook group.

Example: "wg_123"
namestringnon-emptyrequired

The name for the webhook group.

Example: "Some Webhook Group"
{ "id": "wg_123", "name": "Some Webhook Group" }

A member of a webhook group.

group_idstringnon-emptyrequired

The ID of the webhook group this member belongs to.

Example: "wg_123"
member_typestringrequired

The type of a webhook group member.

ValueDescription
ACCOUNT

The webhook group member is a customer account.

Example: "ACCOUNT"
member_idstringnon-emptyrequired

The ID of the webhook group member.

Example: "cuacc_123"
{ "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.

secretstringnon-emptyrequired

The payload of the secret to be used for webhook validation.

Example: "whsec_123"
statusstringrequired

The status of a webhook secret.

Enum ValueDescription
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.

idstringnon-emptyrequired

ID of the webhook subscription.

Example: "wsub_123"
group_idstring or null

ID of the webhook group to which this subscription applies, if any.

Example: "wg_123"
urlstringrequired

The URL to which webhook events will be sent. Must be a valid HTTPS URL.

Example: "https://example.com/webhook"
event_typesArray of strings(WebhookEventType)required

List of event types that this webhook subscription listens to.

Items Enum"REFERRAL_CREATED""REFERRAL_ACTIVATED""REFERRAL_APPLICATION_STATUS_CHANGED""TRANSFER_PROCESSED""TRANSFER_FAILED""EXPENSE_PAYMENT_UPDATED""USER_UPDATED""EMBEDDED_CARD_TRANSACTION_UPDATED""EMBEDDED_CARD_UPDATED""EMBEDDED_ACCOUNT_UPDATED"
Example: "[\"EXPENSE_PAYMENT_UPDATED\"]"
statusstringrequired

The status of a webhook subscription.

Enum ValueDescription
ACTIVE

The webhook subscription is active and the associated URL will receive the subscribed event types.

INACTIVE

The webhook subscription is no longer active.

Example: "ACTIVE"
{ "id": "wsub_123", "group_id": "wg_123", "url": "https://example.com/webhook", "event_types": "[\"EXPENSE_PAYMENT_UPDATED\"]", "status": "ACTIVE" }
Webhooks