Brex Departments API

Endpoints for department management.

Operations 5

GET /v2/departments List departments #
POST /v2/departments Create department #
GET /v2/departments/{id} Get department #
PUT /v2/departments/{id} Update department #
DELETE /v2/departments/{id} Delete department #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/brex:brex-departments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

brex-departments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Team Departments API
  description: The team API lets you manage users, departments, locations, and cards.
  contact:
    name: Admin
    url: https://brex.com
    email: developer-support@brex.com
  version: '1.0'
  x-logo:
    altText: Brex Logo
    url: https://www.brex.com/logo.png
servers:
- url: https://api.brex.com
  description: Production
- url: https://api-staging.brex.com
  description: 'Staging (Note: This is not a sandbox. It will not work with customer tokens.)'
security:
- OAuth2: []
tags:
- name: Departments
  description: Endpoints for department management.
paths:
  /v2/departments:
    get:
      tags:
      - Departments
      summary: List departments
      description: This endpoint lists all departments.
      operationId: listDepartments
      parameters:
      - name: cursor
        in: query
        schema:
          type:
          - string
          - 'null'
      - name: limit
        in: query
        schema:
          type:
          - integer
          - 'null'
          format: int32
      - name: name
        in: query
        schema:
          type:
          - string
          - 'null'
      responses:
        '200':
          description: listDepartments 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_DepartmentResponse_'
      security:
      - OAuth2:
        - departments.readonly
      - OAuth2:
        - departments
    post:
      tags:
      - Departments
      summary: Create department
      description: This endpoint creates a new department
      operationId: createDepartment
      parameters:
      - name: Idempotency-Key
        in: header
        schema:
          type:
          - string
          - 'null'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDepartmentRequest'
        required: true
      responses:
        '200':
          description: createDepartment 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentResponse'
      security:
      - OAuth2:
        - departments
  /v2/departments/{id}:
    get:
      tags:
      - Departments
      summary: Get department
      description: This endpoint gets a department by ID.
      operationId: getDepartmentById
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: getDepartmentById 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentResponse'
      security:
      - OAuth2:
        - departments.readonly
      - OAuth2:
        - departments
    put:
      tags:
      - Departments
      summary: Update department
      description: This endpoint updates a department by ID. Only the fields present in the request body are changed.
      operationId: updateDepartment
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      - name: Idempotency-Key
        in: header
        schema:
          type:
          - string
          - 'null'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDepartmentRequest'
        required: true
      responses:
        '200':
          description: updateDepartment 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentResponse'
      security:
      - OAuth2:
        - departments
    delete:
      tags:
      - Departments
      summary: Delete department
      description: This endpoint deletes a department by ID. A department cannot be deleted while users are still assigned to it or while it is used as a filter on an active group.
      operationId: deleteDepartment
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: deleteDepartment 200 response
      security:
      - OAuth2:
        - departments
components:
  schemas:
    CreateDepartmentRequest:
      required:
      - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: Name of the department
        description:
          type:
          - string
          - 'null'
          description: Description of the department
    Page_DepartmentResponse_:
      required:
      - items
      type: object
      properties:
        next_cursor:
          type:
          - string
          - 'null'
        items:
          type: array
          items:
            $ref: '#/components/schemas/DepartmentResponse'
    UpdateDepartmentRequest:
      type: object
      properties:
        name:
          minLength: 1
          type:
          - string
          - 'null'
          description: Name of the department. Cannot be blank when supplied.
          maxLength: 255
        description:
          type:
          - string
          - 'null'
          description: Description of the department. Pass null or an empty string to clear it.
          maxLength: 255
    DepartmentResponse:
      required:
      - id
      - name
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: Name of the department
        description:
          type:
          - string
          - 'null'
          description: Description of the department
  securitySchemes:
    OAuth2:
      type: oauth2
      description: OAuth2 security scheme
      flows:
        authorizationCode:
          authorizationUrl: https://accounts-api.brex.com/oauth2/default/v1/authorize
          tokenUrl: https://accounts-api.brex.com/oauth2/default/v1/token
          scopes:
            openid: openid
            offline_access: offline access
            users.readonly: View user data
            users: View and manage user data
            locations.readonly: View location data
            locations: View and manage location data
            departments.readonly: View department data
            departments: View and manage department data
            titles: View and manage title data
            titles.readonly: View title data
            cost_centers: View and manage cost center data
            cost_centers.readonly: View cost center data
            cards: View and manage card data
            cards.readonly: View card data
            cards.pan: View and Send card number data
            legal_entities: View and manage legal entities
            legal_entities.readonly: View legal entities
x-explorer-enabled: false
x-provenance:
  method: harvested
  publisher: Brex
  source: https://developer.brex.com/_bundle/openapi/team_api.yaml?download
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)