> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twinbay.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Brex

> Cards, budgets and spend limits, transactions, vendor payments, expenses and their receipts

Seven of Brex's APIs: Team, Transactions, Payments, Expenses, Budgets, Fields and
Accounting. An agent pointed at Brex writes to it — issuing and locking cards,
setting spend limits, paying vendors, attaching receipts and coding expenses — and
three things are easy to get wrong: card creation, transfers and every budget
write *require* an `Idempotency-Key`; every operation needs its own scope, and
`cards` does not grant `cards.pan`; and the Accounting API refuses in an envelope
of its own. Brex publishes no client library, so the conformance suite pins the
seven OpenAPI documents Brex serves and validates every response the twin gives
against them.

**Slug:** `brex`

## What it models

| Area | Modelled |
| - | - |
| Starting account | One company with its account admin, its root budget, its card account and a primary Brex Cash account |
| Authentication | A `bxt_…` user token in `Authorization: Bearer`, carrying scopes; every operation's scope enforced; invalid, revoked, expired and orphaned tokens; 1,000 requests a minute and 5,000 cards a day |
| Company and team | The company, the current user, users invited or loaded, departments and locations |
| Cards | Virtual and physical cards with spend controls, locked, unlocked and terminated; test-range card numbers through `/pan` |
| Budgets and spend limits | The budget hierarchy, spend limits with `HARD` and `SOFT` authorization and balances projected from card spend, period rollover, read-only budget programs, and the legacy `/v1/budgets` |
| Accounts and transactions | Card and cash accounts with balances projected from their transactions, card and cash transactions, statements |
| Payments | Vendors and their payment accounts, transfers through approval, scheduling and processing, failures restoring the balance |
| Expenses and receipts | Card expenses with filters and expansions, memos, receipts uploaded to pre-signed URIs the container serves and read back through download URIs |
| Custom fields | Fields and their values, addressed by `brex_id`, `remote_id` or `value_id`, in bulk |
| Accounting | One active integration, accounting records and their export results, in the Accounting API's own error envelope |
| Errors and paging | Brex's `{"type", "message", "code"}` envelope, cursor pagination with `limit` up to 1000, `Money` in integer minor units |

Advancing moves transfers towards `PROCESSED`, activates shipped cards and locks
cards past their lock date, rolls budgets and spend limits into their next
period, expires receipt URIs and resolves receipt matches.

## Not modelled

Titles, cost centers and legal entities, incoming transfers and linked accounts,
partner OAuth, and the whole of the Onboarding, Travel and Webhooks APIs. An
endpoint Brex has and the twin has not built answers an explicit `501`
`NOT_MODELED` in Brex's envelope; a path Brex does not have is a `404`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.