# Team API The team API lets you manage users, departments, locations, and cards. Version: 1.0 ## Servers Production ``` https://api.brex.com ``` Staging (Note: This is not a sandbox. It will not work with customer tokens.) ``` https://api-staging.brex.com ``` ## Security ### OAuth2 OAuth2 security scheme Type: oauth2 ## Download OpenAPI description [Team API](https://developer.brex.com/_bundle/openapi/team_api.yaml) ## Users Endpoints for user management. ### List users - [GET /v2/users](https://developer.brex.com/openapi/team_api/users/listusers.md): This endpoint lists all users. To find a user id by email, you can filter using the email query parameter. ### Invite user - [POST /v2/users](https://developer.brex.com/openapi/team_api/users/createuser.md): This endpoint invites a new user as an employee. To update user's role, check out this article. ### Get current user - [GET /v2/users/me](https://developer.brex.com/openapi/team_api/users/getme.md): This endpoint returns the user associated with the OAuth2 access token. ### Get user - [GET /v2/users/{id}](https://developer.brex.com/openapi/team_api/users/getuserbyid.md): This endpoint gets a user by ID. ### Update user - [PUT /v2/users/{id}](https://developer.brex.com/openapi/team_api/users/updateuser.md): This endpoint updates a user. Any parameters not provided will be left unchanged. ### Get limit for the user - [GET /v2/users/{id}/limit](https://developer.brex.com/openapi/team_api/users/getuserlimit.md): This endpoint gets the monthly limit for the user including the monthly available limit. ### Set limit for the user - [POST /v2/users/{id}/limit](https://developer.brex.com/openapi/team_api/users/setuserlimit.md): This endpoint sets the monthly limit for a user. The limit amount must be non-negative. To unset the monthly limit of the user, just set monthly_limit to null. ## Locations Endpoints for location management. ### List locations - [GET /v2/locations](https://developer.brex.com/openapi/team_api/locations/listlocations.md): This endpoint lists all locations. ### Create location - [POST /v2/locations](https://developer.brex.com/openapi/team_api/locations/createlocation.md): This endpoint creates a new location. ### Get location - [GET /v2/locations/{id}](https://developer.brex.com/openapi/team_api/locations/getlocationbyid.md): This endpoint gets a location by ID. ## Departments Endpoints for department management. ### List departments - [GET /v2/departments](https://developer.brex.com/openapi/team_api/departments/listdepartments.md): This endpoint lists all departments. ### Create department - [POST /v2/departments](https://developer.brex.com/openapi/team_api/departments/createdepartment.md): This endpoint creates a new department ### Get department - [GET /v2/departments/{id}](https://developer.brex.com/openapi/team_api/departments/getdepartmentbyid.md): This endpoint gets a department by ID. ## Titles Endpoints for title management. ### List titles - [GET /v2/titles](https://developer.brex.com/openapi/team_api/titles/listtitles.md): This endpoint lists all titles. ### Create title - [POST /v2/titles](https://developer.brex.com/openapi/team_api/titles/createtitle.md): This endpoint creates a new title ### Get title - [GET /v2/titles/{id}](https://developer.brex.com/openapi/team_api/titles/gettitlebyid.md): This endpoint gets a title by ID. ## Cards Endpoints for card management. ### List cards - [GET /v2/cards](https://developer.brex.com/openapi/team_api/cards/listcardsbyuserid.md): Lists all cards by a user_id. Only cards with limit_type = CARD have spend_controls ### Create card - [POST /v2/cards](https://developer.brex.com/openapi/team_api/cards/createcard.md): Creates a new card. The spend_controls field is required when limit_type = CARD. The mailing_address field is required for physical cards and is the shipping address used to send the card; it is not the same as the billing and mailing address used for online purchases. The first 2 lines of this address must be under 60 characters long. Each user can only have up to 10 active physical cards. For Empower accounts, this endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. If this is the case and you want to gain access to this endpoint, please contact Brex support. ### Get card - [GET /v2/cards/{id}](https://developer.brex.com/openapi/team_api/cards/getcardbyid.md): Retrieves a card by ID. Only cards with limit_type = CARD have spend_controls ### Update card - [PUT /v2/cards/{id}](https://developer.brex.com/openapi/team_api/cards/updatecard.md): Update an existing vendor card ### Lock card - [POST /v2/cards/{id}/lock](https://developer.brex.com/openapi/team_api/cards/lockcard.md): Locks an existing, unlocked card. And the card owner will receive a notification about it. ### Get card number - [GET /v2/cards/{id}/pan](https://developer.brex.com/openapi/team_api/cards/getcardnumber.md): Retrieves card number, CVV, and expiration date of a card by ID. ### Create secure email to send card number - [POST /v2/cards/{id}/secure_email](https://developer.brex.com/openapi/team_api/cards/emailcardnumber.md): Creates a secure email to send card number, CVV, and expiration date of a card by ID to the specified email. This endpoint is currently gated. If you would like to request access, please reach out to developer-support@brex.com ### Terminate card - [POST /v2/cards/{id}/terminate](https://developer.brex.com/openapi/team_api/cards/terminatecard.md): Terminates an existing card. The card owner will receive a notification about it. ### Unlock card - [POST /v2/cards/{id}/unlock](https://developer.brex.com/openapi/team_api/cards/unlockcard.md): Unlocks an existing card. ## Legal Entities Endpoints for legal entities. ### List legal entities - [GET /v2/legal_entities](https://developer.brex.com/openapi/team_api/legal-entities/listlegalentities.md): List legal entities for the account. ### Get legal entity - [GET /v2/legal_entities/{id}](https://developer.brex.com/openapi/team_api/legal-entities/getlegalentity.md): Get a legal entity by its ID. ## Companies ### Get company - [GET /v2/company](https://developer.brex.com/openapi/team_api/companies/getcompany.md): This endpoint returns the company associated with the OAuth2 access token.