First-party app
Brex

Brex

Manage Brex users, locations, departments, titles, cards, legal entities and company over the Brex Team API v1.0.

stable Finance & AccountingCommerce & Payments

About

Brex ships in the w6w first-party pack. It declares 23 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.brex
Version
0.1.0
Author
w6w
Licence
MIT
Categories
Finance & Accounting · Commerce & Payments

Overview

Brex is a corporate card and spend-management platform, and its Team API is the directory and card surface every spend workflow starts from: who the employees are, which departments, locations and titles they report into, which legal entity employs them, and which cards they hold.

This app covers that surface end to end. Users can be listed with the API’s full filter set (status, department, location, title, cost centre, legal entity, custom fields), invited, read back, and updated — including suspending and unsuspending one by status. Departments, locations and titles are the three-level directory the users hang off, each listable, creatable and readable. Cards can be listed per user and read back, their spend controls updated (limit, refresh window, reason, lock-after date and the merchant allow/deny lists), and locked, unlocked or terminated as state transitions, with the reason Brex requires and the card owner’s notification left to Brex.

Authentication is a single Brex user token, minted in the dashboard under Settings > Developer > Create Token and sent as Authorization: Bearer <token>. The API also documents a partner OAuth2 flow for ISVs running a consent screen across many customer accounts; that flow needs a registered OAuth application and a live per-customer authorization step, so this app ships the static token only — the same narrowing this pack made for Base44 and Devin.

Health checks read Brex’s own status page, anchored on the Partner API component that answers api.brex.com rather than the page-wide roll-up (Brex’s dashboard, mobile and travel incidents are different products). Brex publishes no rate-limit response header of any kind, so quota headroom is declared absent rather than invented.

Build with Brex

Three routes to the same 23 actions. The Workflow tab is generated from Brex's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Get Card

card-get

Fetch one Brex card by id, including its status and spend controls.

List Cards

card-list

List Brex cards, optionally for one user. Only cards with limit_type = CARD carry spend_controls.

Lock Card

card-lock

Lock a Brex card. Reversible with Unlock Card. Brex notifies the card owner.

Terminate Card

card-terminate

Permanently terminate a Brex card. Not reversible — prefer Lock Card unless the card is being retired. Brex notifies the card owner.

Unlock Card

card-unlock

Unlock a locked Brex card. Sends no request body — Brex documents none.

Update Card

card-update

Update a vendor card's spend limit, refresh window, reason, lock-after date, merchant allow/deny list and metadata. Fields left empty are unchanged.

Get Company

company-get

Fetch the Brex company the connection's token belongs to, including whether the account is BREX_CLASSIC or BREX_EMPOWER.

Create Department

department-create

Create a Brex department, optionally with a description.

Get Department

department-get

Fetch one Brex department by id.

List Departments

department-list

List the account's Brex departments, optionally filtered by name.

Get Legal Entity

legal-entity-get

Fetch one Brex legal entity by id.

List Legal Entities

legal-entity-list

List the account's Brex legal entities.

Create Location

location-create

Create a Brex location, optionally with a description.

Get Location

location-get

Fetch one Brex location by id.

List Locations

location-list

List the account's Brex locations, optionally filtered by name.

Create Title

title-create

Create a Brex title. Brex's title resource carries a name and nothing else.

Get Title

title-get

Fetch one Brex title by id.

List Titles

title-list

List the account's Brex titles, optionally filtered by name.

Get User

user-get

Fetch one Brex user by id.

Get Current User

user-get-current

Fetch the Brex user the connection's token belongs to. Also the connection's liveness probe.

Invite User

user-invite

Invite a new user to Brex as an employee, optionally assigning a manager, department, location, title, cost centre and legal entity. Brex sends the invitation email.

List Users

user-list

List the account's Brex users, filtered by status, department, location, title, cost centre, legal entity, manager, email, custom field or a fuzzy name match.

Update User

user-update

Update a Brex user's status (suspend or unsuspend), manager, department, location, title, cost centre, legal entity or metadata. Fields left empty are unchanged.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Brex's real ids.

{
  "manifestVersion": "2",
  "name": "brex-example",
  "steps": [
    {
      "id": "card-get",
      "uses": {
        "app": "io.w6w.brex",
        "action": "card-get",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "id": "<id>"
      }
    }
  ]
}

Here are some of the things you can do

  • Get Card

    read
    card-get
  • List Cards

    search
    card-list
  • Lock Card

    perform
    card-lock
  • Terminate Card

    perform
    card-terminate
  • Unlock Card

    perform
    card-unlock

+18 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Brex, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Brex. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "card-get",
  payload: {
    id: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action card-get --payload '{"id":"<value>"}'

Give an AI agent Brex — without giving it Brex's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.brex#card-get",
    "input": {
      "id": "<id>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Brex connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Brex's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Brex itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Brex declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Brex Partner API status

The `Partner API` component of Brex's status page (status.brex.com), which is the developer API this app calls at api.brex.com. The page's other components (Dashboard, Mobile, Spend Management, Authentication, Partner Integrations, Brex Travel, Bill Pay, Home Page, Banking, Money movement: card authorization) are different products and are reported as detail only.

quota

API rate-limit headroom