Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Brex

Brex

Corporate cards and spend management: users, cards, card transactions, expenses and cash accounts.

6 actions API key 6 read0 write Calls api.brex.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "brex" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Get current userreadbrex.get_meGet the Brex user that owns the token.

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "brex.get_me",
  input: {},
});
List card transactionsreadbrex.list_card_transactionsList settled transactions across all card accounts, newest first. Use posted_at_start to limit by date.
InputTypeDescription
posted_at_startstringOptionalOnly transactions posted at or after this ISO 8601 time
limitintegerOptionalPage size
cursorstringOptionalCursor from next_cursor
TypeScript
await setu.execute({
  userId: "user_1",
  action: "brex.list_card_transactions",
  input: {},
});
List cardsreadbrex.list_cardsList cards, optionally for one cardholder (user_id).
InputTypeDescription
user_idstringOptionalOnly cards of this user id
limitintegerOptionalPage size
cursorstringOptionalCursor from next_cursor
TypeScript
await setu.execute({
  userId: "user_1",
  action: "brex.list_cards",
  input: {},
});
List cash accountsreadbrex.list_cash_accountsList cash accounts with names, balances and primary flag.

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "brex.list_cash_accounts",
  input: {},
});
List expensesreadbrex.list_expensesList expenses with status, merchant memo and amount. Filter by user, status (DRAFT, SUBMITTED, APPROVED, OUT_OF_POLICY, VOID, CANCELED, SPLIT, SETTLED), type or purchase date.
InputTypeDescription
user_idstringOptionalOnly this user's expenses
statusstringOptionalOne expense status
expense_typestringOptionalOne expense type
purchased_at_startstringOptionalPurchased at or after (ISO 8601)
purchased_at_endstringOptionalPurchased at or before (ISO 8601)
limitintegerOptionalPage size
cursorstringOptionalCursor from next_cursor
TypeScript
await setu.execute({
  userId: "user_1",
  action: "brex.list_expenses",
  input: {},
});
List usersreadbrex.list_usersList Brex users, optionally filtered by status (ACTIVE, INVITED, INACTIVE...) or by exact email.
InputTypeDescription
statusstringOptionalOne status, e.g. ACTIVE
emailstringOptionalExact email lookup
limitintegerOptionalPage size
cursorstringOptionalCursor from next_cursor
TypeScript
await setu.execute({
  userId: "user_1",
  action: "brex.list_users",
  input: {},
});