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

Request

Lists webhook groups.

Security
OAuth2
Query
cursorstring or null

Cursor for pagination.

limitinteger(int32)[ 0 .. 1000 ]

Limit for pagination. If not provided, defaults to 100. Cannot be greater than 1000.

Default 100
curl -i -X GET \
  https://api.brex.com/v1/webhooks/groups \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Success

Bodyapplication/json
next_cursorstring or null
itemsArray of objects(Webhook Group)required
items[].​idstringnon-emptyrequired

The ID of the webhook group.

Example: "wg_123"
items[].​namestringnon-emptyrequired

The name for the webhook group.

Example: "Some Webhook Group"
Response
application/json
{ "next_cursor": "string", "items": [ {} ] }

Request

Creates a webhook group.

Security
OAuth2
Headers
Idempotency-Keystringrequired
Bodyapplication/jsonrequired
namestringrequired

The name for the webhook group.

Example: "Some Webhook Group"
curl -i -X POST \
  https://api.brex.com/v1/webhooks/groups \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: string' \
  -d '{
    "name": "Some Webhook Group"
  }'

Responses

Success

Bodyapplication/json
idstringnon-emptyrequired

The ID of the webhook group.

Example: "wg_123"
namestringnon-emptyrequired

The name for the webhook group.

Example: "Some Webhook Group"
Response
application/json
{ "id": "wg_123", "name": "Some Webhook Group" }

Request

Gets a webhook group.

Security
OAuth2
Path
idstringrequired

The ID of the webhook group to retrieve.

curl -i -X GET \
  'https://api.brex.com/v1/webhooks/groups/{id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Success

Bodyapplication/json
idstringnon-emptyrequired

The ID of the webhook group.

Example: "wg_123"
namestringnon-emptyrequired

The name for the webhook group.

Example: "Some Webhook Group"
Response
application/json
{ "id": "wg_123", "name": "Some Webhook Group" }

Request

Deletes a webhook group and all its members.

Security
OAuth2
Path
idstringrequired

The ID of the webhook group to delete.

curl -i -X DELETE \
  'https://api.brex.com/v1/webhooks/groups/{id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Success

Request

Adds members to webhook groups.

Security
OAuth2
Path
idstringrequired

The ID of the webhook group to add members to.

Bodyapplication/jsonrequired
membersArray of objects(WebhookGroupMemberInput)non-emptyrequired

The list of webhook group members to add to the group.

members[].​member_typestringrequired

The type of a webhook group member.

ValueDescription
ACCOUNT

The webhook group member is a customer account.

members[].​member_idstringnon-emptyrequired

The ID of the webhook group member.

curl -i -X POST \
  'https://api.brex.com/v1/webhooks/groups/{id}/add_members' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "members": [
      {
        "member_type": "ACCOUNT",
        "member_id": "string"
      }
    ]
  }'

Responses

Success

Request

Lists the members currently in the specified webhook group.

Security
OAuth2
Path
idstringrequired

The ID of the webhook group to retrieve members for.

Query
cursorstring or null

Cursor for pagination.

limitinteger(int32)[ 0 .. 1000 ]

Limit for pagination. If not provided, defaults to 100. Cannot be greater than 1000.

Default 100
curl -i -X GET \
  'https://api.brex.com/v1/webhooks/groups/{id}/members' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Success

Bodyapplication/json
next_cursorstring or null
itemsArray of objects(Webhook Group Member)required
items[].​group_idstringnon-emptyrequired

The ID of the webhook group this member belongs to.

Example: "wg_123"
items[].​member_typestringrequired

The type of a webhook group member.

ValueDescription
ACCOUNT

The webhook group member is a customer account.

Example: "ACCOUNT"
items[].​member_idstringnon-emptyrequired

The ID of the webhook group member.

Example: "cuacc_123"
Response
application/json
{ "next_cursor": "string", "items": [ {} ] }

Request

Removes members from webhook groups.

Security
OAuth2
Path
idstringrequired

The ID of the webhook group to remove members from.

Bodyapplication/jsonrequired
membersArray of objects(WebhookGroupMemberInput)non-emptyrequired

The list of webhook group members to remove from the group.

members[].​member_typestringrequired

The type of a webhook group member.

ValueDescription
ACCOUNT

The webhook group member is a customer account.

members[].​member_idstringnon-emptyrequired

The ID of the webhook group member.

curl -i -X POST \
  'https://api.brex.com/v1/webhooks/groups/{id}/remove_members' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "members": [
      {
        "member_type": "ACCOUNT",
        "member_id": "string"
      }
    ]
  }'

Responses

Success

Schemas
Webhooks