Bulk Delete Employees
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));import requests
url = "https://api.dcycle.io/v2/employees/bulk-delete"
payload = { "employee_ids": ["<string>"] }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v2/employees/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"employee_ids": [
"<string>"
]
}
'{
"total": 123,
"success": 123,
"failed": 123,
"errors": {}
}Bulk Delete Employees
Delete multiple employees by their IDs
POST
/
v2
/
employees
/
bulk-delete
Bulk Delete Employees
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));import requests
url = "https://api.dcycle.io/v2/employees/bulk-delete"
payload = { "employee_ids": ["<string>"] }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v2/employees/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"employee_ids": [
"<string>"
]
}
'{
"total": 123,
"success": 123,
"failed": 123,
"errors": {}
}← Employees API
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.
Deprecated. Use
POST /v2/employees/delete: up to 5,000 employees per request by id, including those of the organizations under yours that you can write to, idempotent, deleted asynchronously as an ingest job, with webhooks. This endpoint keeps working; its responses carry Deprecation and Link: </v2/employees/delete>; rel="successor-version" headers. Its responses also carry Sunset: Fri, 30 Apr 2027 00:00:00 GMT: the endpoint is retired on April 30, 2027 (see the changelog).Request
Headers
Body Parameters
Response
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"]
}'
import requests
import os
response = requests.post(
"https://api.dcycle.io/v2/employees/bulk-delete",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
"Content-Type": "application/json",
},
json={
"employee_ids": ["emp-uuid-1", "emp-uuid-2", "emp-uuid-3"],
},
)
result = response.json()
print(f"Deleted {result['success']}/{result['total']} employees")
if result["failed"] > 0:
print(f"Failed: {result['failed']}")
const axios = require('axios');
const { data } = await axios.post(
'https://api.dcycle.io/v2/employees/bulk-delete',
{
employee_ids: ['emp-uuid-1', 'emp-uuid-2', 'emp-uuid-3'],
},
{
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
'Content-Type': 'application/json',
},
}
);
console.log(`Deleted ${data.success}/${data.total} employees`);
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"
}
]
}
Related Endpoints
Bulk Delete by Filters
Delete all employees matching filter criteria
Delete Employee
Delete a single employee
Was this page helpful?