# Brex — Pipedream Connect

> Payments, Deposits, Cards

- API slug: `brex` (use in MCP headers and tool keys)
- Auth: OAuth (Pipedream-managed)
- Categories: Business Management
- Website: https://brex.com
- Managed OAuth scopes: `openid` · `offline_access` · `users` · `cards` · `locations` · `departments` · `vendors` · `transactions.card.readonly` · `transactions.cash.readonly` · `accounts.cash.readonly` · `transfers` · `https://onboarding.brexapis.com/referrals` · `budgets`
- This page (HTML): https://pipedream.com/apps/brex
- Tools: 21 actions · 1 trigger

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: brex`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "brex",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Cancel Card:
const result = await mcp.callTool({
  name: "brex-cancel-card",
  arguments: {
    cardId: "Card ID",
    reason: "Reason",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Brex endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://platform.brexapis.com/v2/cards

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9wbGF0Zm9ybS5icmV4YXBpcy5jb20vdjIvY2FyZHM?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "brex-cancel-card",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    brex: { authProvisionId: "apn_xxxxxxx" },
    cardId: "Card ID",
    reason: "Reason",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (21)

### `brex-cancel-card` — Cancel Card (Write)

Cancels (terminates) a card permanently. This cannot be undone — use Freeze Card to block a card temporarily instead. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/cancel-card.md

### `brex-create-card` — Create Card (Write)

Issues a new virtual card to a Brex user. Physical cards are not supported — Brex requires a mailing address to ship one and this action does not collect it. A vendor card (Limit Type = CARD) carries its own spend limit set here; a corporate card (Limit Type = USER) draws on the cardholder's…

Full schema: https://pipedream.com/apps/brex/actions/create-card.md

### `brex-freeze-card` — Freeze Card (Write)

Freezes (locks) a card so it declines new purchases. Reversible with Unfreeze Card. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/freeze-card.md

### `brex-get-card` — Get Card (Read-only)

Retrieves one card by ID, including its status, last four digits, and — for vendor cards — its spend limit and remaining available balance. Corporate cards return spend_controls: null because they draw on the cardholder's limit, which Get User Limit reports. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/get-card.md

### `brex-get-expense` — Get Expense (Read-only)

Retrieves one expense and its receipts. Receipt download links expire 15 minutes after the response, so download rather than store them. Use Search Expenses to find an expense ID. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/get-expense.md

### `brex-get-user` — Get User (Read-only)

Retrieves one person in the Brex account, including their status, manager, department, location, and title. Use List Users to find a user ID by email address. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/get-user.md

### `brex-get-user-limit` — Get User Limit (Read-only)

Retrieves a person's monthly spend limit and how much of it is still available. Change it with Set Limit for User. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/get-user-limit.md

### `brex-invite-user` — Invite User (Write)

Invites a person to the Brex account as an employee, emailing them to finish onboarding. Returns the new Brex user ID, which Create Card, Set Limit for User, and Get User take. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/invite-user.md

### `brex-list-card-accounts` — List Card Accounts (Read-only)

Lists the Brex card accounts, each with its current balance, available balance, account limit, and current statement period. These are account-level limits, not a single card's — use Get Card for that. Results are capped at maxResults (default 100) — check $summary for a truncation notice and raise…

Full schema: https://pipedream.com/apps/brex/actions/list-card-accounts.md

### `brex-list-cards` — List Cards (Read-only)

Lists the cards in the Brex account, each with its status, last four digits, cardholder, and spend limit. Filter by cardholder (userId) or status (ACTIVE, SHIPPED, LOCKED, TERMINATED) — status has no server-side filter, so it's applied after fetching, which can leave results truncated before every…

Full schema: https://pipedream.com/apps/brex/actions/list-cards.md

### `brex-list-cash-accounts` — List Cash Accounts (Read-only)

Lists the Brex cash accounts with their balances, account and routing numbers, and which one is primary. Results are capped at maxResults (default 100) — check $summary for a truncation notice and raise maxResults if it's truncated. This is how you find the account ID that List Transactions for…

Full schema: https://pipedream.com/apps/brex/actions/list-cash-accounts.md

### `brex-list-departments` — List Departments (Read-only)

Lists the departments configured in the Brex account with their ID and name. Results are capped at maxResults (default 100) — check $summary for a truncation notice and raise maxResults if it's truncated. This is how you turn a department name into the department ID that Invite User requires. See…

Full schema: https://pipedream.com/apps/brex/actions/list-departments.md

### `brex-list-locations` — List Locations (Read-only)

Lists the office locations configured in the Brex account with their ID and name. Results are capped at maxResults (default 100) — check $summary for a truncation notice and raise maxResults if it's truncated. This is how you turn a location name into the location ID that Invite User requires. See…

Full schema: https://pipedream.com/apps/brex/actions/list-locations.md

### `brex-list-transactions-for-primary-card-account` — List Transactions for Primary Card Account (Read-only)

Lists settled card transactions, unfiltered. Despite the action name, Brex returns transactions across all card accounts rather than the primary one alone, and non-admin users only ever see their own purchases, refunds, and chargebacks. Use Search Card Transactions instead to filter by merchant…

Full schema: https://pipedream.com/apps/brex/actions/list-transactions-for-primary-card-account.md

### `brex-list-transactions-for-selected-cash-account` — List Transactions for Selected Cash Account (Read-only)

Lists transactions on one Brex cash account — transfers, deposits, and fees — rather than card spend. Use List Cash Accounts to find the account ID. For card activity use Search Card Transactions or List Transactions for Primary Card Account. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/list-transactions-for-selected-cash-account.md

### `brex-list-users` — List Users (Read-only)

Lists the people in the Brex account with their ID, name, email, status, manager, department, and location. Filter to one person with email, or set includeLimits to include each person's monthly spend limit. Results are capped at maxResults (default 100) — check $summary for a truncation notice and…

Full schema: https://pipedream.com/apps/brex/actions/list-users.md

### `brex-search-card-transactions` — Search Card Transactions (Read-only)

Searches settled card transactions across all card accounts by merchant, amount, date, or cardholder, and returns each transaction's expense_id, the handle Brex uses for the matching expense and its receipt. Non-admin users only ever see their own purchases, refunds, and chargebacks. Unlike List…

Full schema: https://pipedream.com/apps/brex/actions/search-card-transactions.md

### `brex-search-expenses` — Search Expenses (Read-only)

Searches expenses across card, bill pay, and reimbursement spend by merchant, amount, date, person, type, or status. Covers every payment method and carries receipt and approval state; use Search Card Transactions for settled card postings only. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/search-expenses.md

### `brex-set-limit-for-user` — Set Limit for User (Write)

Sets a user's recurring monthly spend limit, replacing any limit already in place. This governs corporate cards (Limit Type = USER); vendor cards carry their own limit set on the card itself. Use List Users to find the user ID and Get User Limit to read the current limit. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/set-limit-for-user.md

### `brex-unfreeze-card` — Unfreeze Card (Write)

Unfreezes (unlocks) a LOCKED card so it can be used again. Cards cancelled with Cancel Card cannot be unfrozen. See the documentation

Full schema: https://pipedream.com/apps/brex/actions/unfreeze-card.md

### `brex-update-card-limit` — Update Card Limit (Write)

Updates the spend limit on a vendor card (limit_type: CARD). This sends a complete spend_controls object, so treat it as a replacement: supply every spend control you want the card to keep, because Brex does not document whether omitted fields are preserved or cleared. Corporate cards draw on their…

Full schema: https://pipedream.com/apps/brex/actions/update-card-limit.md

## Triggers (1)

### `brex-new-transfer-event` — New Transfer Event (Instant) (Instant)

Emit new event when a Brex transfer is processed or fails. Registers a Brex webhook subscription for the selected event types and emits the transfer's full details alongside the event payload. See the documentation

Full schema: https://pipedream.com/apps/brex/triggers/new-transfer-event.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
