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

# Delete Leave Type

> Delete a leave type from the system

Permanently delete a leave type. This operation removes the leave type configuration from the system.

<Warning>
  This is a destructive operation. Ensure that no active leave balances or pending requests depend on this leave type before deletion.
</Warning>

## Authentication

Requires authentication with Bearer token. Available to:

* **Super Admin**
* **HR Manager**

## Path Parameters

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

  **Example:** `"a1b2c3d4-e5f6-7890-abcd-ef1234567890"`
</ParamField>

## Response

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

<ResponseField name="message" type="string">
  Confirmation message
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE https://api.companyflow.com/leave-types/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.companyflow.com/leave-types/a1b2c3d4-e5f6-7890-abcd-ef1234567890',
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  url = 'https://api.companyflow.com/leave-types/a1b2c3d4-e5f6-7890-abcd-ef1234567890'
  headers = {
      'Authorization': 'Bearer YOUR_TOKEN'
  }

  response = requests.delete(url, headers=headers)
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "message": "leave type deleted"
  }
  ```

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

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

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

## Important Considerations

<Warning>
  Before deleting a leave type, consider the following:

  * **Active balances**: Employees may have leave balances associated with this type
  * **Pending requests**: There may be pending leave requests using this type
  * **Historical data**: Approved leave history will be affected
  * **Reporting**: Reports may be incomplete if historical leave types are removed
</Warning>

## Alternative: Deactivate Instead

<Tip>
  Instead of deleting, consider setting the leave type status to `inactive` using the [Update Leave Type](/api/leaves/types/update) endpoint. This preserves historical data while preventing new leave requests.

  ```json theme={null}
  {
    "status": "inactive"
  }
  ```
</Tip>

## Related Endpoints

* [Create Leave Type](/api/leaves/types/create) - Create a new leave type
* [Update Leave Type](/api/leaves/types/update) - Modify or deactivate a leave type
* [List Leave Types](/api/leaves/types/list) - View all leave types
