> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Falasefemi2/companyflow/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Department

> Retrieve a specific department by ID

## Authentication

This endpoint requires authentication with a Bearer token. Only users with **Super Admin** or **HR Manager** roles can retrieve department details.

<ParamField path="id" type="string" required>
  The unique identifier of the department
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  The department object

  <Expandable title="Department Object">
    <ResponseField name="id" type="string">
      Unique department identifier
    </ResponseField>

    <ResponseField name="company_id" type="string">
      Company identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Department name
    </ResponseField>

    <ResponseField name="code" type="string">
      Department code
    </ResponseField>

    <ResponseField name="description" type="string">
      Department description
    </ResponseField>

    <ResponseField name="parent_department_id" type="string" nullable>
      Parent department ID if hierarchical
    </ResponseField>

    <ResponseField name="cost_center" type="string">
      Cost center identifier
    </ResponseField>

    <ResponseField name="status" type="string">
      Department status (active/inactive)
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of creation
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO 8601 timestamp of last update
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.companyflow.com/departments/{id} \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "data": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "company_id": "987fcdeb-51a2-43f7-9c5d-123456789abc",
      "name": "Engineering",
      "code": "ENG",
      "description": "Software engineering and development",
      "parent_department_id": null,
      "cost_center": "CC-100",
      "status": "active",
      "created_at": "2026-03-03T10:00:00Z",
      "updated_at": "2026-03-03T10:00:00Z"
    }
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
    "success": false,
    "message": "invalid department id"
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "success": false,
    "message": "missing authorization header"
  }
  ```

  ```json 500 - Internal Server Error theme={null}
  {
    "success": false,
    "message": "department not found"
  }
  ```
</ResponseExample>
