Brex ACTION
Create Card
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 monthly limit instead, which Set Limit for User controls. Use List Users to find the cardholder. The returned card ID is what Get Card, Freeze Card, Cancel Card, and Update Card Limit take. See the documentation- Action
- Writes data
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Brex account once, then configure and run Create Card from your backend or agent.
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-create-card",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
brex: { authProvisionId: "apn_xxxxxxx" },
user: "User",
cardName: "Card Name",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "brex-create-card",
"configured_props": {
"brex": { "authProvisionId": "apn_xxxxxxx" },
"user": "User",
"cardName": "Card Name"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "brex-create-card",
arguments: {
user: "User",
cardName: "Card Name",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
user User | string | The person the card is issued to, as a Brex user ID, e.g. cuuser_ckze72soa117f01pkmf1wcpl3. Use List Users to find a user ID by email address. Required |
cardName Card Name | string | A label for the card, shown in the Brex dashboard and printed on physical cards, e.g. AWS Vendor Card. Required |
cardType Card Type | string | Must be VIRTUAL, for a card usable immediately. PHYSICAL is not supported — Brex requires a mailing address to ship a card and this action does not collect one. Required |
limitType Limit Type | string | limit_type = CARD for vendor cards. Vendor cards must have a card_type of VIRTUAL and do not rely on the user specific limit. For corporate cards, limit_type = USER. Required |
amount Spend Limit Amount | integer | The spend limit, in the currency's smallest denomination — 2500 is $25.00 in USD. Required when Limit Type is CARD; ignored when it is USER, because a corporate card draws on the cardholder's own limit. Optional |
currency Spend Limit Currency | string | The type of currency, in ISO 4217 format. Defaults to USD when omitted. Ignored when Limit Type is USER. Optional |
spendDuration Spend Duration | string | How often the spend limit refreshes: MONTHLY, QUARTERLY, or YEARLY to refresh on that cadence, or ONE_TIME for a limit that never refreshes. Required when Limit Type is CARD; ignored when it is USER. Optional |
reason Spend Limit Reason | string | A note explaining what the card is for, shown alongside the limit in Brex, e.g. AWS monthly hosting. Ignored when Limit Type is USER. Optional |
lockAfterDate Spend Limit Lock After Date | string | The date the card stops accepting purchases, in yyyy-mm-dd format, e.g. 2026-12-31. Omit for a card that never locks. Ignored when Limit Type is USER. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- brex-create-card
- Version
- 0.1.3
- App
- Brex
- Authentication
- OAuth
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗