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

# Update Level

> Update an existing organizational level

## Authorization

Requires authentication with a Bearer token. Only users with the following roles can update levels:

* Super Admin
* HR Manager

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the level (UUID format)
</ParamField>

## Request Body

All fields are optional. Only include fields you want to update.

<ParamField body="name" type="string">
  Name of the level (2-255 characters)
</ParamField>

<ParamField body="hierarchy_level" type="integer">
  Hierarchy level number (minimum 1). Used for ordering levels within the organization.
</ParamField>

<ParamField body="min_salary" type="number">
  Minimum salary for this level (must be non-negative)
</ParamField>

<ParamField body="max_salary" type="number">
  Maximum salary for this level (must be non-negative)
</ParamField>

<ParamField body="description" type="string">
  Description of the level
</ParamField>

## Response

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

<ResponseField name="data" type="object">
  The updated level object

  <Expandable title="Level Response">
    <ResponseField name="id" type="string">
      Unique identifier for the level
    </ResponseField>

    <ResponseField name="company_id" type="string">
      The company this level belongs to
    </ResponseField>

    <ResponseField name="name" type="string">
      Name of the level
    </ResponseField>

    <ResponseField name="hierarchy_level" type="integer">
      Hierarchy level number
    </ResponseField>

    <ResponseField name="min_salary" type="number">
      Minimum salary for this level
    </ResponseField>

    <ResponseField name="max_salary" type="number">
      Maximum salary for this level
    </ResponseField>

    <ResponseField name="description" type="string">
      Description of the level
    </ResponseField>

    <ResponseField name="created_at" type="string">
      Timestamp when the level was created
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      Timestamp when the level was last updated
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```json theme={null}
  {
    "name": "Staff Engineer",
    "min_salary": 90000,
    "max_salary": 140000
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "company_id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Staff Engineer",
      "hierarchy_level": 3,
      "min_salary": 90000,
      "max_salary": 140000,
      "description": "Senior level individual contributor",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T14:20:00Z"
    }
  }
  ```
</ResponseExample>

## HTTP Methods

This endpoint supports both `PUT` and `PATCH` methods with the same behavior. Both methods perform partial updates, allowing you to update only the fields you specify.

## Error Responses

<ResponseExample>
  ```json 400 Bad Request theme={null}
  {
    "success": false,
    "message": "invalid level id"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 401 Unauthorized theme={null}
  {
    "success": false,
    "message": "unauthorized"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 500 Internal Server Error theme={null}
  {
    "success": false,
    "message": "internal server error"
  }
  ```
</ResponseExample>
