Webhook Subscriptions

Register Webhook

Register an endpoint to start receiving selected webhook events

post/v1/webhooks

Request

  • Base URL
    https://api.brex.com
  • Auth
    OAuth 2
    Authorization codehttps://accounts-api.brex.com/oauth2/default/v1/authorize
    Client credentials
    Token URLhttps://accounts-api.brex.com/oauth2/default/v1/token
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Headers

Idempotency-Keystring required

Request body

urlstring required

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

group_idstring nullable

ID of the webhook group to which this subscription applies, if any. This is only available for partners.

event_typesWebhookEventType[] required

A list of the webhook event types this subscription will listen to.

Example request

{
  "url": "https://example.com/webhook",
  "group_id": "wg_123"
}

Response

Success

idstring required

ID of the webhook subscription.

group_idstring nullable

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

urlstring required

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

event_typesWebhookEventType[] required

List of event types that this webhook subscription listens to.

status'ACTIVE' | 'INACTIVE' required

The status of this webhook subscription.

Example response

{
  "id": "wsub_123",
  "group_id": "wg_123",
  "url": "https://example.com/webhook",
  "status": "ACTIVE"
}

Changes

No recorded changes to this operation across all 1 revision of this API.