# List departments This endpoint lists departments of a company. Endpoint: POST /v3/companies/{companyId}/departments/list Version: v2 Security: Bearer ## Path parameters: - `companyId` (string, required) Identifier for company. Example: "4974a66b-7493-4f41-908c-58ba81093947" ## Request fields (application/json): - `searchText` (string) Search string entered by the user Example: "Engineering" - `paginationParams` (object, required) Pagination information. - `paginationParams.offset` (integer) The starting index in the list from which results are returned. The value must be greater than or equal to 0. - `paginationParams.limit` (integer) Maximum number of results to be fetched. - `filters` (array) List of filters. Departments matching with any filter would be returned. - `filters.externalIds` (array) List of external ids. Example: ["department-external-id"] - `filters.departmentIds` (array) List of department ids. Example: ["731ccbca-0415-6fe1-d235-c324dfbe7423"] ## Response 200 fields (application/json): - `paginationParams` (object, required) Pagination information. - `paginationParams.totalNumResults` (integer, required) Total number of results. - `departments` (array) List of departments containing id and name. - `departments.id` (string, required) Example: "731ccbca-0415-6fe1-d235-c324dfbe7423" - `departments.name` (string) Example: "Accounting" ## Response 400 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error. ## Response 401 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error. ## Response 403 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error. ## Response 404 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error.