> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Workforce Employee

> Permanently delete one own workforce employee and the records that hang off them

[← Own Workforce API](/api-reference/own-workforce/overview)

Delete a single employee. This is irreversible, and there is no endpoint that creates one back — the only way to restore an employee is to re-import them through the [Imports API](/api-reference/imports/overview).

<Warning>
  Deleting an employee removes the records that depend on them: contracts, remunerations, trainings and absence/accident records. Their reported headcount, FTE and training hours change accordingly for every period they appeared in.
</Warning>

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Path Parameters

<ParamField path="own_workforce_id" type="string" required>
  Employee UUID

  **Example:** `550e8400-e29b-41d4-a716-446655440000`
</ParamField>

## Response

`204 No Content` with an empty body.

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X DELETE "https://api.dcycle.io/v1/own_workforces/550e8400-e29b-41d4-a716-446655440000" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os

  import requests

  headers = {
      "x-api-key": os.getenv("DCYCLE_API_KEY"),
      "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
  }

  employee_id = "550e8400-e29b-41d4-a716-446655440000"
  response = requests.delete(
      f"https://api.dcycle.io/v1/own_workforces/{employee_id}",
      headers=headers,
  )

  print(response.status_code)  # 204
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  const headers = {
    'x-api-key': process.env.DCYCLE_API_KEY,
    'x-organization-id': process.env.DCYCLE_ORG_ID
  };

  const employeeId = '550e8400-e29b-41d4-a716-446655440000';

  axios.delete(`https://api.dcycle.io/v1/own_workforces/${employeeId}`, { headers })
    .then(response => console.log(response.status))
    .catch(error => console.error(error));
  ```
</CodeGroup>

## Common Errors

### 401 Unauthorized

**Cause:** the key is invalid, or it does not belong to the organization in `x-organization-id` — the two are looked up as a pair. A request carrying no credentials at all answers `AUTH_REQUIRED` instead.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Invalid API key for organization",
  "code": "INVALID_API_KEY"
}
```

### 403 Forbidden

**Cause:** the key's owner is not an enabled member of the organization in `x-organization-id`, or the key's role cannot write.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Logged User is not Member of Organization",
  "code": "LOGGED_USER_NOT_MEMBER"
}
```

### 404 Not Found

**Cause:** no employee with that id inside your perimeter. A row owned by an organization outside the header organization's accepted family answers 404, never 403.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "code": "NOT_FOUND",
  "detail": "OwnWorkforceModel with id='550e8400-e29b-41d4-a716-446655440000' not found"
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Bulk delete employees" icon="trash" href="/api-reference/own-workforce/bulk-delete">
    Delete up to 100,000 by id
  </Card>

  <Card title="Bulk delete by filters" icon="filter-circle-xmark" href="/api-reference/own-workforce/bulk-delete-by-filters">
    Delete everything a filtered list returned
  </Card>
</CardGroup>
