Get Card By Id
get_card_by_idFull Description
Get a card by its ID
Parameters (1 required)
idstringCard ID to retrieve (base64-encoded).
Connect Brex to ChatGPT and review your company finances through natural conversation — at ChatGPT speed.
For finance teams: Analyze spend, detect anomalies, and run custom queries and reports instantly to accelerate decisions and do more with less.
For employees: See how much you can spend, ask policy questions, check reimbursement status, manage travel, and more right in ChatGPT.
Access is role-aware by default: employees see only what applies to them, while admins retain full visibility and control.
get_card_by_idGet a card by its ID
idstringCard ID to retrieve (base64-encoded).
get_expense_by_idGet an expense by its ID
Expand:
Additional Fields:
Example 1: Getting an expense with expanded receipts: { "id": "expense_123", "expand": ["RECEIPTS"] }
Example 2: Getting an expense with travel metadata and location: { "id": "expense_123", "additional_fields": ["TRAVEL_METADATA", "LOCATION"] }
Example 3: Getting an expense with everything: { "id": "expense_123", "expand": ["RECEIPTS"], "additional_fields": ["TRAVEL_METADATA", "LOCATION"] }
Understanding Expense Lifecycle and Compliance Status:
Expense Lifecycle: 1. New expense created (card transaction or reimbursement submitted) 2. Documentation phase: System checks if documentation is required (receipts, memo, attendees, etc.) 3. Spender submits documentation if needed 4. Review phase: System checks if approval/review is required based on company policy 5. Reviewer reviews and approves/rejects if necessary 6. Expense is finalized
Each expense returns TWO sets of compliance-related fields:
A. DOCUMENTATION COMPLIANCE (for spenders - receipts, memo, attendees):
B. REVIEW COMPLIANCE (for reviewers - approval/rejection):
KEY DISTINCTIONS:
idstringExpense ID to fetch
additional_fieldsOptional fields to include: TRAVEL_METADATA (travel data), LOCATION (expense location details).
expandUse ['RECEIPTS'] to include receipt download_uri and parsed content; otherwise only IDs are returned.
get_expense_policyGet expense policy information for a budget/spend limit as structured, validatable content.
This tool returns expense policy rules in the EXACT same format as shown in the Brex Dashboard's "View policy" sidebar, but structured as JSON for proper validation.
What you'll get:
Use this tool to answer questions like:
Parameters:
Response Format: Returns structured JSON with:
spend_limit_idstringThe ID of the spend limit/budget. Pass the ID directly from list_my_limits response.
rules_filterstringWhich view of the policy to return. ONLY_RELEVANT_FOR_REQUESTER (default) shows personalized rules for the user. ALL_RULES shows complete policy including all user-specific exceptions (requires admin permissions).
ALL_RULESONLY_RELEVANT_FOR_REQUESTERONLY_RELEVANT_FOR_REQUESTERget_reimbursement_payout_dateGet the expected payout date for a reimbursement expense. Returns the date when the reimbursement payment is expected to arrive. Only works for REIMBURSEMENT type expenses that are paid through Brex.
Note: This tool will return an error if the reimbursement is configured to be paid outside of Brex (Pay outside of Brex / PoB). In those cases, the payment is handled directly between the company and employee (usually at payroll time), and Brex does not control the payment date.
Parameters:
Example: { "expense_id": "expense_123" }
Response includes:
expense_idstringReimbursement expense ID to query.
get_user_by_idGet a user by their unique ID
This tool retrieves detailed information about a specific user using their unique user ID. Use this when you have a user ID and need to get their complete profile information.
Example Input: { "id": "cuuser_123" }
Example Output: { "id": "cuuser_123", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "role": "CARD_ADMIN", "status": "ACTIVE", "managerId": "cuuser_5678", "managerFirstName": "Jane", "managerLastName": "Smith", "managerTitleId": "ti_1234", "managerTitleName": "Engineering Manager", "departmentId": "cudmnt_1234", "departmentName": "Engineering", "locationId": "culoc_1234", "locationName": "San Francisco", "titleId": "ti_5678", "titleName": "Software Engineer" }
idstringThe Brex user ID to retrieve (e.g., cuuser_abc123def456ghi789jkl012)
get_user_myselfGet the current authenticated user
This tool retrieves the profile information of the currently authenticated user making the request. Use this when you need to get information about who is currently logged in or making the API call. No input parameters required.
Example Output: { "id": "cuuser_123", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "role": "CARD_ADMIN", "status": "ACTIVE", "managerId": "cuuser_5678", "managerFirstName": "Jane", "managerLastName": "Smith", "managerTitleId": "ti_1234", "managerTitleName": "Engineering Manager", "departmentId": "cudmnt_1234", "departmentName": "Engineering", "locationId": "culoc_1234", "locationName": "San Francisco", "titleId": "ti_5678", "titleName": "Software Engineer" }
list_my_cardsList cards belonging to the calling user. You can filter by status views (ACTIVE, EXPIRED, LOCKED, TERMINATED, WAITING_ACTIVATION). Results are paginated - use limit and cursor for pagination.
Example 1: Getting all my active cards: { "status": ["ACTIVE"] }
Example 2: Getting all my cards (any status): {}
Example 3: Getting my active and locked cards: { "status": ["ACTIVE", "LOCKED"] }
cursorPagination cursor from previous response.
limitPage size limit for pagination.
statusFilter by card statuses (ACTIVE, EXPIRED, LOCKED, TERMINATED, WAITING_ACTIVATION).
list_my_expensesList expenses with filters. expense types (BILLPAY, CARD, CLAWBACK, REIMBURSEMENT),
Date Filtering (only one type can be used at a time):
Amount Filtering (all amounts in USD):
Text Search:
Limit Filtering:
Additional Fields:
Understanding Expense Lifecycle and Compliance Status:
Expense Lifecycle: 1. New expense created (card transaction or reimbursement submitted) 2. Documentation phase: System checks if documentation is required (receipts, memo, attendees, etc.) 3. Spender submits documentation if needed 4. Review phase: System checks if approval/review is required based on company policy 5. Reviewer reviews and approves/rejects if necessary 6. Expense is finalized
Each expense returns TWO sets of compliance-related fields:
A. DOCUMENTATION COMPLIANCE (for spenders - receipts, memo, attendees):
B. REVIEW COMPLIANCE (for reviewers - approval/rejection):
KEY DISTINCTIONS:
All dates should be in ISO 8601 format (e.g., "2025-04-01T07:00:00.000Z"). Date must be in UTC timezone. All amounts are assumed to be in USD currency. Results are paginated - use limit and cursor for pagination.
Example 1: Getting all my reimbursements: { "types": ["REIMBURSEMENT"], }
Example 2: Getting all card expenses purchased in April 2025 (UTC timezone): { "types": ["CARD"], "purchased_at_start": "2025-04-01T00:00:00.000Z", "purchased_at_end": "2025-04-30T23:59:59.999Z" }
Example 3: Getting reimbursements for transactions after a specific date (UTC timezone): { "types": ["REIMBURSEMENT"], "purchased_at_start": "2025-04-01T07:00:00.000Z" }
Example 4: Getting my expenses that are missing compliance documentation (e.g. receipts, memo): { "missing_compliance_documentation": true }
Example 5: Getting expenses between $100 and $500: { "min_amount": 120.78, "max_amount": 500.00 }
Example 6: Search for Nike expenses: { "search": "nike" }
Example 7: Getting expenses for a specific limit: { "limit_ids": ["limit_123"] }
Example 8: Getting expenses with travel metadata and location data: { "types": ["CARD"], "additional_fields": ["TRAVEL_METADATA", "LOCATION"] }
additional_fieldsOptional fields to include: TRAVEL_METADATA (flights/cars/lodging/trains), LOCATION (expense location details).
[]cursorPagination cursor from previous response.
expandUse ['RECEIPTS'] to include receipt download_uri and parsed content. Without it, only receipt IDs are returned.
limitPage size limit for pagination.
limit_idsFilter by spend limit IDs.
max_amountReturn expenses with amount <= this value (USD, up to 2 decimals, e.g., 500.00).
min_amountReturn expenses with amount >= this value (USD, up to 2 decimals, e.g., 120.50).
missing_compliance_documentationtrue: only expenses missing required documentation (receipts/memo/attendees); false: only complete; omit: no filter.
purchased_at_endReturn expenses purchased on/before this UTC datetime (ISO 8601, e.g., 2025-04-30T23:59:59.999Z).
purchased_at_startReturn expenses purchased on/after this UTC datetime (ISO 8601, e.g., 2025-04-01T00:00:00.000Z).
searchText search over merchant, memo, etc. Case-insensitive. Example: "nike".
typesFilter by expense types. Options: BILLPAY (vendor invoices), CARD (card transactions), CLAWBACK (reversed), REIMBURSEMENT (employee reimbursement).
list_my_limitsGet all limits that apply to the current user with pagination support.
This includes:
Each limit shows:
Pagination:
Example usage:
cursorPagination cursor from previous response (use next_cursor).
limitnumberNumber of limits to return (1-1000, default 100).
100list_usersList users with optional filtering and pagination
This tool retrieves a paginated list of all users in the system with full control over sorting and pagination. Use this when you need to browse through users, get multiple users at once, or need specific sorting.
Parameters:
Example Input 1 (basic, with defaults): {}
Example Input 2 (with pagination and sorting): { "limit": 50, "direction": "DESC", "sort": "LAST_NAME", "cursor": "cursor_1234" }
Example Output: { "items": [ { "id": "cuuser_123", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "role": "CARD_ADMIN", "status": "ACTIVE", "managerId": "cuuser_5678", "managerFirstName": "Jane", "managerLastName": "Smith", "managerTitleId": "ti_1234", "managerTitleName": "Engineering Manager", "departmentId": "cudmnt_1234", "departmentName": "Engineering", "locationId": "culoc_1234", "locationName": "San Francisco", "titleId": "ti_5678", "titleName": "Software Engineer" } ], "nextCursor": "cursor_5678" }
cursorstringPagination cursor from a previous response (use nextCursor to fetch the next page)
directionstringSort direction: "ASC" or "DESC" (default: "ASC")
ascdescasclimitintegerNumber of users to return (1-1000, default 100)
100sortstringField to sort by (default: "FIRST_NAME"). Other options include LAST_NAME, EMAIL, etc.
FIRST_NAMELAST_NAMEFIRST_NAMElist_users_by_name_or_emailList users by name or email
This tool allows you to search for users by name or email. It will return a paginated list of up to 10 users that match the search criteria, sorted by first name. If you only have the name or email, you can use this tool to find the user ID and their full details.
Example Input 1 (search by name): { "search_text": "John Smith" }
Example Input 2 (search by email): { "search_text": "john.smith@example.com" }
Example Output: { "items": [ { "id": "cuuser_123", "firstName": "John", "lastName": "Smith", "email": "john.smith@example.com", "role": "CARD_ADMIN", "status": "ACTIVE", "managerId": "cuuser_5678", "managerFirstName": "Jane", "managerLastName": "Doe", "managerTitleId": "ti_1234", "managerTitleName": "Engineering Manager", "departmentId": "cudmnt_1234", "departmentName": "Engineering", "locationId": "culoc_1234", "locationName": "San Francisco", "titleId": "ti_5678", "titleName": "Software Engineer" } ], "nextCursor": "cursor_1234" }
search_textstringName or email to search for (e.g., 'John Smith' or 'john.smith@example.com'). Returns up to 10 matches sorted by first name.
query_expense_analyticsQuery Brex expense data using natural language for comprehensive financial and operational analytics
This tool provides access to advanced expense reporting and analytics powered by specialized data models. It allows you to ask questions about spending patterns, compliance issues, budget performance, and organizational metrics using natural language queries.
ADMIN ONLY: This tool is only accessible to account administrators.
The tool has access to 9 specialized analytical views:
1. "What was our total spending on travel expenses in Q4 2025?" 2. "Show me the top 10 vendors by spend last month" 3. "How much did the Engineering department spend on software purchases?" 4. "Compare our card spending between December and January" 5. "What are the largest transactions over $10,000 this quarter?" 6. "Show me spending trends over the last 6 months" 7. "What's our average expense amount by category?"
8. "Which employees have the most transactions missing receipts?" 9. "Show me all manually approved expenses without documentation" 10. "List expenses that are out of policy this month" 11. "What's our receipt compliance rate by department?"
12. "Which departments are most over budget by percentage?" 13. "Show me budget utilization for all departments" 14. "What budgets were recently created or edited?"
15. "Who are the top 5 spenders in the Engineering department?" 16. "Show me employee expense patterns by manager" 17. "Which users have the most spend per merchant category?"
18. "Show me all recurring SaaS vendor spend from highest to lowest" 19. "What are our top non-SaaS vendors by spend?" 20. "Compare vendor spend quarter over quarter"
21. "Which managers have the most expenses pending their review?" 22. "Show me all disputed transactions this year by user" 23. "What's the status of pending reimbursements?"
{ "question": "What was our total spending on travel expenses in Q4 2025?" }
{ "answer": "Your total spending on travel expenses in Q4 2025 was $125,450.32. Here's the breakdown by month: October: $38,200, November: $42,150, December: $45,100. The top categories were flights (45%), hotels (35%), and ground transportation (20%).", "metadata": { "toolCalls": [ { "name": "query_expenses", "input": {...}, "result": {...} } ] } }
✓ USE this tool for:
✗ DO NOT use this tool for:
questionstringNatural language query about card expenses and transactions