Download OpenAPI specification:Download
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.
List the webhooks you have registered
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "next_cursor": "string",
- "items": [
- {
- "id": "wsub_123",
- "group_id": "wg_123",
- "event_types": "[\"EXPENSE_PAYMENT_UPDATED\"]",
- "status": "ACTIVE"
}
]
}Register an endpoint to start receiving selected webhook events
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "group_id": "wg_123",
- "event_types": [
- "REFERRAL_CREATED"
]
}{- "id": "wsub_123",
- "group_id": "wg_123",
- "event_types": "[\"EXPENSE_PAYMENT_UPDATED\"]",
- "status": "ACTIVE"
}This endpoint returns a set of webhook signing secrets used to validate the webhook. Usually only one key will be returned in the response. After key rotation, this endpoint will return two keys: the new key, and the key that will be revoked soon. There will also be two signatures in the 'Webhook-Signature' request header. Your application should use all keys available to validate the webhook request. If validation passes for any of the keys returned, the webhook payload is valid.
Success
Bad request
Unauthorized
Forbidden
Internal server error
[- {
- "secret": "whsec_123",
- "status": "ACTIVE"
}
]Get details of a webhook
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "id": "wsub_123",
- "group_id": "wg_123",
- "event_types": "[\"EXPENSE_PAYMENT_UPDATED\"]",
- "status": "ACTIVE"
}Update a webhook. You can update the endpoint url, event types that the endpoint receives, or temporarily deactivate the webhook.
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "group_id": "wg_123",
- "event_types": [
- "REFERRAL_CREATED"
], - "status": "ACTIVE"
}{- "id": "wsub_123",
- "group_id": "wg_123",
- "event_types": "[\"EXPENSE_PAYMENT_UPDATED\"]",
- "status": "ACTIVE"
}Lists webhook groups.
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "next_cursor": "string",
- "items": [
- {
- "id": "wg_123",
- "name": "Some Webhook Group"
}
]
}Creates a webhook group.
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "name": "Some Webhook Group"
}{- "id": "wg_123",
- "name": "Some Webhook Group"
}Adds members to webhook groups.
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "members": [
- {
- "member_type": "ACCOUNT",
- "member_id": "string"
}
]
}Lists the members currently in the specified webhook group.
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "next_cursor": "string",
- "items": [
- {
- "group_id": "wg_123",
- "member_type": "ACCOUNT",
- "member_id": "cuacc_123"
}
]
}Removes members from webhook groups.
Success
Bad request
Unauthorized
Forbidden
Internal server error
{- "members": [
- {
- "member_type": "ACCOUNT",
- "member_id": "string"
}
]
}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 required | string non-empty The ID of the webhook group. |
| name required | string non-empty The name for the webhook group. |
{- "id": "wg_123",
- "name": "Some Webhook Group"
}A member of a webhook group.
| group_id required | string non-empty The ID of the webhook group this member belongs to. | ||||
| member_type required | string The type of a webhook group member.
| ||||
| member_id required | string non-empty The ID of the webhook group member. |
{- "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.
| secret required | string non-empty The payload of the secret to be used for webhook validation. | ||||||||
| status required | string The status of a webhook secret.
|
{- "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 required | string non-empty ID of the webhook subscription. | ||||||
| group_id | string or null ID of the webhook group to which this subscription applies, if any. | ||||||
| url required | string The URL to which webhook events will be sent. Must be a valid HTTPS URL. | ||||||
| event_types required | Array of strings (WebhookEventType) List of event types that this webhook subscription listens to. | ||||||
| status required | string The status of a webhook subscription.
|
{- "id": "wsub_123",
- "group_id": "wg_123",
- "event_types": "[\"EXPENSE_PAYMENT_UPDATED\"]",
- "status": "ACTIVE"
}Expense activity on Brex Cards.
| event_type required | string (WebhookEventType) 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" "EMBEDDED_CARD_SHIPPING_UPDATED" "EMBEDDED_DISPUTE_UPDATED" "PARTNERSHIP_INTEGRATION_CONNECTION_UPDATED" "EMBEDDED_CARD_AUTHORIZATION" "EMBEDDED_FRAUD_ALERT" "EMBEDDED_BILLING_GROUP_UPDATED" "EMBEDDED_LEGAL_ENTITY_UPDATED" "EMBEDDED_BILLING_STATEMENT_UPDATED" |
| expense_id required | string Unique ID associated with the expense. |
| version required | integer <int32> >= 0 Version of this expense. This value starts at 1 and is incremented by 1 with every update. |
| payment_status required | string (ExpensePaymentStatus)
|
| payment_type required | string (ExpensePaymentType)
|
| company_id required | string This is the |
| purchased_at | string or null <date-time> The time the purchase was made. |
object or null Deprecated Money fields can be signed or unsigned. Fields are signed (an unsigned value will be interpreted as positive). The amount of money will be represented in the smallest denomination of the currency indicated. For example, USD 7.00 will be represented in cents with an amount of 700. | |
object or null Money fields can be signed or unsigned. Fields are signed (an unsigned value will be interpreted as positive). The amount of money will be represented in the smallest denomination of the currency indicated. For example, USD 7.00 will be represented in cents with an amount of 700. | |
object or null Money fields can be signed or unsigned. Fields are signed (an unsigned value will be interpreted as positive). The amount of money will be represented in the smallest denomination of the currency indicated. For example, USD 7.00 will be represented in cents with an amount of 700. | |
| payment_description required | string Deprecated Succeeded by the merchant::raw_descriptor field. |
| card_id required | string The ID of the card that is associated with the expense. |
required | object The merchant associated with the expense. |
| payment_status_reason required | string (PaymentStatusReason) The reason for the payment's status. |
| payment_authorization_code | string or null The authorization code of the associated card expense. |
Return this code if the callback was received and processed successfully
{- "event_type": "REFERRAL_CREATED",
- "expense_id": "string",
- "version": 1,
- "payment_status": "PENDING",
- "payment_type": "PURCHASE",
- "company_id": "string",
- "purchased_at": "2019-08-24T14:15:22Z",
- "amount": {
- "amount": 700,
- "currency": "USD"
}, - "original_amount": {
- "amount": 700,
- "currency": "USD"
}, - "billing_amount": {
- "amount": 700,
- "currency": "USD"
}, - "payment_description": "string",
- "card_id": "string",
- "merchant": {
- "raw_descriptor": "string",
- "mcc": "string",
- "country": "string"
}, - "payment_status_reason": "OTHER",
- "payment_authorization_code": "string"
}A referral was activated.
| event_type required | string (WebhookEventType) 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" "EMBEDDED_CARD_SHIPPING_UPDATED" "EMBEDDED_DISPUTE_UPDATED" "PARTNERSHIP_INTEGRATION_CONNECTION_UPDATED" "EMBEDDED_CARD_AUTHORIZATION" "EMBEDDED_FRAUD_ALERT" "EMBEDDED_BILLING_GROUP_UPDATED" "EMBEDDED_LEGAL_ENTITY_UPDATED" "EMBEDDED_BILLING_STATEMENT_UPDATED" |
| referral_id required | string The referral ID |
Return this code if the callback was received and processed successfully
{- "event_type": "REFERRAL_CREATED",
- "referral_id": "string"
}A referral's application status changed.
| event_type required | string (WebhookEventType) 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" "EMBEDDED_CARD_SHIPPING_UPDATED" "EMBEDDED_DISPUTE_UPDATED" "PARTNERSHIP_INTEGRATION_CONNECTION_UPDATED" "EMBEDDED_CARD_AUTHORIZATION" "EMBEDDED_FRAUD_ALERT" "EMBEDDED_BILLING_GROUP_UPDATED" "EMBEDDED_LEGAL_ENTITY_UPDATED" "EMBEDDED_BILLING_STATEMENT_UPDATED" |
| referral_id required | string The referral ID |
required | object (ProductApplication) The product application details for the referral. |
Return this code if the callback was received and processed successfully
{- "event_type": "REFERRAL_CREATED",
- "referral_id": "string",
- "application": {
- "cash": "NO_ACCOUNT"
}
}A referral was created.
| event_type required | string (WebhookEventType) 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" "EMBEDDED_CARD_SHIPPING_UPDATED" "EMBEDDED_DISPUTE_UPDATED" "PARTNERSHIP_INTEGRATION_CONNECTION_UPDATED" "EMBEDDED_CARD_AUTHORIZATION" "EMBEDDED_FRAUD_ALERT" "EMBEDDED_BILLING_GROUP_UPDATED" "EMBEDDED_LEGAL_ENTITY_UPDATED" "EMBEDDED_BILLING_STATEMENT_UPDATED" |
| referral_id required | string The referral ID |
Return this code if the callback was received and processed successfully
{- "event_type": "REFERRAL_CREATED",
- "referral_id": "string"
}Transfer failed events for both incoming and outgoing Brex Cash transactions.
| event_type required | string (WebhookEventType) 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" "EMBEDDED_CARD_SHIPPING_UPDATED" "EMBEDDED_DISPUTE_UPDATED" "PARTNERSHIP_INTEGRATION_CONNECTION_UPDATED" "EMBEDDED_CARD_AUTHORIZATION" "EMBEDDED_FRAUD_ALERT" "EMBEDDED_BILLING_GROUP_UPDATED" "EMBEDDED_LEGAL_ENTITY_UPDATED" "EMBEDDED_BILLING_STATEMENT_UPDATED" |
| transfer_id required | string The transfer ID |
| payment_type required | string (PaymentType) Only ACH, DOMESTIC_WIRE, CHEQUE, INTERNATIONAL_WIRE and BOOK_TRANSFER details can be retrieved from the Payments API. |
| return_for_id | string or null The original transaction ID that is returned when the payment type is ACH_RETURN, WIRE_RETURN and CHEQUE_RETURN. |
| company_id required | string This is the |
Return this code if the callback was received and processed successfully
{- "event_type": "REFERRAL_CREATED",
- "transfer_id": "string",
- "payment_type": "ACH",
- "return_for_id": "string",
- "company_id": "string"
}Transfer processed events for both incoming and outgoing Brex Cash transactions.
| event_type required | string (WebhookEventType) 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" "EMBEDDED_CARD_SHIPPING_UPDATED" "EMBEDDED_DISPUTE_UPDATED" "PARTNERSHIP_INTEGRATION_CONNECTION_UPDATED" "EMBEDDED_CARD_AUTHORIZATION" "EMBEDDED_FRAUD_ALERT" "EMBEDDED_BILLING_GROUP_UPDATED" "EMBEDDED_LEGAL_ENTITY_UPDATED" "EMBEDDED_BILLING_STATEMENT_UPDATED" |
| transfer_id required | string The transfer ID |
| payment_type required | string (PaymentType) Only ACH, DOMESTIC_WIRE, CHEQUE, INTERNATIONAL_WIRE and BOOK_TRANSFER details can be retrieved from the Payments API. |
| return_for_id | string or null The original transaction ID that is returned when the payment type is ACH_RETURN, WIRE_RETURN and CHEQUE_RETURN. |
| company_id required | string This is the |
Return this code if the callback was received and processed successfully
{- "event_type": "REFERRAL_CREATED",
- "transfer_id": "string",
- "payment_type": "ACH",
- "return_for_id": "string",
- "company_id": "string"
}Updates on Brex users.
| event_type required | string (WebhookEventType) 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" "EMBEDDED_CARD_SHIPPING_UPDATED" "EMBEDDED_DISPUTE_UPDATED" "PARTNERSHIP_INTEGRATION_CONNECTION_UPDATED" "EMBEDDED_CARD_AUTHORIZATION" "EMBEDDED_FRAUD_ALERT" "EMBEDDED_BILLING_GROUP_UPDATED" "EMBEDDED_LEGAL_ENTITY_UPDATED" "EMBEDDED_BILLING_STATEMENT_UPDATED" |
| user_id required | string |
| company_id required | string |
| updated_attributes required | Array of strings (UserAttributes) Items Enum: "STATUS" "MANAGER_ID" "DEPARTMENT_ID" "LOCATION_ID" |
Return this code if the callback was received and processed successfully
{- "event_type": "REFERRAL_CREATED",
- "user_id": "string",
- "company_id": "string",
- "updated_attributes": [
- "STATUS"
]
}