# 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.

## Update department

 - [PUT /v2/departments/{id}](https://developer.brex.com/openapi/team_api/departments/updatedepartment.md): This endpoint updates a department by ID. Only the fields present in the request body are changed.

## Delete department

 - [DELETE /v2/departments/{id}](https://developer.brex.com/openapi/team_api/departments/deletedepartment.md): 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.

