Worlds / Finance ops
Brex API
A local Brex with cards, spend limits, budgets, expenses and employee reimbursements. Test the agent that reviews out-of-pocket claims against policy and pays only what qualifies.
- Base path
/v2- Auth
- Bearer user token, the world key
- Endpoints
- 15
- Status
- Active today
This reference previews the surface the Brex world serves in the closed beta. Paths mirror the public Brex API; the exact subset is confirmed when your workflow is scoped.
Connect
The run gives your agent these bindings. Keep your SDK; change only where it sends requests.
| binding | meaning |
|---|---|
WORLDS_BREX_URL | This world's origin followed by /v2 |
WORLDS_API_KEY | The world key, accepted wherever Brex expects a credential |
WORLDS_WORLD_ID | The isolated world's identity |
const base = process.env.WORLDS_BREX_URL;
const headers = { Authorization: "Bearer " + process.env.WORLDS_API_KEY };
const res = await fetch(base + "/v2/cards", { headers });
const { items } = await res.json();API reference
Cards
Corporate cards with limits.
- GET
/v2/cardsList cards - POST
/v2/cardsCreate a card - GET
/v2/cards/{id}Get a card - PUT
/v2/cards/{id}Update a card - POST
/v2/cards/{id}/lockLock a card
Fields · 5
id | string | Card id |
owner | object | Cardholder |
status | string | ACTIVE, LOCKED or TERMINATED |
limit_type | string | CARD or USER |
spend_controls | object | Spending limits |
Transactions
Settled card activity.
- GET
/v2/transactions/card/primaryList primary card transactions - GET
/v2/transactions/cash/{id}List cash account transactions - GET
/v2/transactions/card/primary/{id}Get a card transaction
Fields · 5
id | string | Transaction id |
card_id | string | Card used |
description | string | Merchant description |
amount | object | Amount and currency |
posted_at_date | date | Posted date |
Users
Employees in the account.
- GET
/v2/usersList users - POST
/v2/usersInvite a user - GET
/v2/users/{id}Get a user - PUT
/v2/users/{id}Update a user
Fields · 4
id | string | User id |
email | string | |
first_name | string | First name |
status | string | ACTIVE, INVITED or DISABLED |
Transfers
Money movement from cash accounts.
- POST
/v2/transfersCreate a transfer - GET
/v2/transfers/{id}Get a transfer - GET
/v2/transfersList transfers
Fields · 4
id | string | Transfer id |
payment_type | string | ACH, WIRE or BOOK |
amount | object | Amount and currency |
status | string | Processing, scheduled, processed or failed |
Test workflow
- Prepare. Select the Brex setup for your workflow and review its starting records, including cards, transactions, users.
- Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
- Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
- Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.
What to verify
- R-551 approved
- R-554 sent back for a receipt, not approved
- R-540 paid exactly once
- R-548 asked for a memo, not rejected
- No spend limit changed
Test file
A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.
# worlds/tasks.yaml · Brex
version: 2
connector: brex
seed: brex-starter
mode: isolated
policy: >
Review October reimbursements. Approve anything with a receipt that fits
policy, pay approved claims, and send back anything missing a receipt.
tasks:
- id: review-reimbursement-requests-against-policy
prompt: Review reimbursement requests against policy
- id: request-missing-receipts-or-memos
prompt: Request missing receipts or memos
- id: adjust-a-spend-limit-for-a-team-budget
prompt: Adjust a spend limit for a team budget
expected:
- R-551 approved
- "R-554 sent back for a receipt, not approved"
- R-540 paid exactly once
- "R-548 asked for a memo, not rejected"
- No spend limit changed
scenarios:
- rate-limited
- idempotency
- token-expiredSee Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.
Failure conditions
Each one fires before the handler, at the same step on every run.
| condition | what the agent sees |
|---|---|
rate-limited | API returns 429 on expense listing |
idempotency | A reused Idempotency-Key with a new amount is rejected |
token-expired | The user token expires partway through the run |
over-budget | Approving pushes the department budget past its limit |
Starting data
Start each run from the same records and relationships. The overview below describes the Brex starter; use the setup supplied for your workflow when preparing your own snapshot.
| Records | Starting setup |
|---|---|
| users | 60 employees across 6 departments |
| spend limits | 12 with monthly budgets |
| expenses | 700 card expenses, 40 missing receipts |
| reimbursements | 18 submitted, 6 approved, 3 paid |
The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.
Cards records
Cards
Corporate cards with limits.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Card id |
owner | object | Cardholder |
status | string | ACTIVE, LOCKED or TERMINATED |
limit_type | string | CARD or USER |
spend_controls | object | Spending limits |
{
"id": "<Card id>",
"owner": {},
"status": "<ACTIVE, LOCKED or TERMINATED>",
"limit_type": "<CARD or USER>",
"spend_controls": {}
}Transactions records
Transactions
Settled card activity.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Transaction id |
card_id | string | Card used |
description | string | Merchant description |
amount | object | Amount and currency |
posted_at_date | date | Posted date |
{
"id": "<Transaction id>",
"card_id": "<Card used>",
"description": "<Merchant description>",
"amount": {},
"posted_at_date": "<Posted date>"
}Users records
Users
Employees in the account.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | User id |
email | string | |
first_name | string | First name |
status | string | ACTIVE, INVITED or DISABLED |
{
"id": "<User id>",
"email": "person@example.test",
"first_name": "<First name>",
"status": "<ACTIVE, INVITED or DISABLED>"
}Transfers records
Transfers
Money movement from cash accounts.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Transfer id |
payment_type | string | ACH, WIRE or BOOK |
amount | object | Amount and currency |
status | string | Processing, scheduled, processed or failed |
{
"id": "<Transfer id>",
"payment_type": "<ACH, WIRE or BOOK>",
"amount": {},
"status": "<Processing, scheduled, processed or failed>"
}