AI agents with Brex webhooks
Receive Brex webhooks on Trigger.dev and use them to start, resume or message your AI agents.
What you can do with Brex webhooks
Start an agent
Brex events can start a new agent run. For example, an agent that looks into every failed Brex transfer.
Resume an agent
An agent can pause until the Brex event it needs arrives, for up to 90 days, and costs nothing while it waits.
Message an agent
Brex events can land in a running agent's conversation, so it acts on them with full context.
Events you can receive from Brex
Some of the events Brex sends. Your agent can filter on any of them.
Transfer processed
Transfer failed
Card expense payment updated
Referral activated
User updated
Example
An agent that looks into every failed Brex transfer
Handled for you
Verified for you
webhooks.brex() checks the Brex signature on every request. Bad requests are rejected before anything runs.
Retries don't run twice
Retries are matched on the svix-id header, so a retried webhook doesn't start a second run.
Filter before anything runs
Only the Brex events you care about start a run. Filtered webhooks use no compute.
See every delivery
Every webhook is recorded with its payload, headers and the agents it reached, so you can debug it and replay it.
Get started
- 1
Set up the agent
Copy the starter prompt into your coding agent, like Claude Code, Cursor or Codex. It creates a Trigger.dev project and adds the webhook endpoint. Prefer to write it yourself? Start from the example above.
- 2
Add the webhook in Brex
Deploy your project, or run
trigger dev, and the endpoint appears on the Webhooks page of the Trigger.dev dashboard with its URL. Add that URL in Brex's webhook settings and pick the events you need. The endpoint's Copy setup prompt button gives your coding agent the exact steps. - 3
Add Brex's signing secret
Copy the signing secret from Brex. Then on the endpoint's page in the Trigger.dev dashboard, choose Set signing secret and paste it in, so Trigger.dev can check every request really came from Brex.
- 4
Try it
Send a test event from Brex, or use the endpoint's Test tab. It appears on the endpoint's Deliveries tab, with the agents it reached.
Related integrations
Ready to build with Brex webhooks?
Declare an endpoint, deploy, and paste the URL into your provider.


