Skip to main content
POST
/
v2
/
employees
/
bulk-delete
Bulk Delete
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({employee_ids: ['<string>']})
};

fetch('https://api.dcycle.io/v2/employees/bulk-delete', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "total": 123,
  "success": 123,
  "failed": 123,
  "errors": {}
}

Bulk Delete

Delete multiple employees by their IDs in a single request. Progress is tracked via a processing job and real-time Redis notifications. All employees must belong to the requesting organization. Employees from other organizations will be reported as failed in the response.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body Parameters

employee_ids
string[]
required
List of employee UUIDs to delete (1–100,000)

Response

total
integer
Total number of employees processed
success
integer
Number of employees successfully deleted
failed
integer
Number of employees that failed to delete
errors
array[object]
Details of failed deletions

Example

curl -X POST "https://api.dcycle.io/v2/employees/bulk-delete" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "employee_ids": ["emp-uuid-1", "emp-uuid-2", "emp-uuid-3"]
  }'

Successful Response

{
  "total": 3,
  "success": 3,
  "failed": 0,
  "errors": []
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The authenticated user is not a member of the organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}

422 Unprocessable Entity

Cause: Empty or invalid employee_ids array
{
  "detail": [
    {
      "loc": ["body", "employee_ids"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Bulk Delete by Filters

Delete all employees matching filter criteria

Delete Employee

Delete a single employee