# Brex (Staging) — Pipedream Connect

> Payments, Deposits, Cards

- API slug: `brex_staging` (use in MCP headers and tool keys)
- Auth: OAuth (Pipedream-managed)
- Categories: Commerce
- 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-staging
- Tools: 5 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_staging`

```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_staging",
      },
    },
  },
)

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

const { tools } = await mcp.listTools()

// e.g. run Create Card:
const result = await mcp.callTool({
  name: "brex_staging-create-card",
  arguments: {
    user: "User",
    cardName: "Card Name",
  },
})
```

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

## API proxy

For a Brex (Staging) 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.staging.brexapps.com/v2/cards

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9wbGF0Zm9ybS5zdGFnaW5nLmJyZXhhcHBzLmNvbS92Mi9jYXJkcw?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_staging-create-card",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    brex_staging: { authProvisionId: "apn_xxxxxxx" },
    user: "User",
    cardName: "Card Name",
  },
})
```

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

## Actions (5)

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

Creates a new card. See the docs here.

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

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

Invites a new user as an employee. See the docs here.

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

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

Lists all settled transactions for the primary card account. See the docs here.

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

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

Lists all transactions for the specified cash account. See the docs here.

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

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

Sets the monthly limit for a user. See the docs here.

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

## Triggers (1)

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

Emit new event for new failed or processed events

Full schema: https://pipedream.com/apps/brex-staging/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
