Bulk Delete Workforce 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({own_workforce_ids: {}, consolidate_group: true})
};
fetch('https://api.dcycle.io/v1/own_workforces/bulk-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/own_workforces/bulk-delete"
payload = {
"own_workforce_ids": {},
"consolidate_group": True
}
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/v1/own_workforces/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"own_workforce_ids": {},
"consolidate_group": true
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}Bulk Delete Workforce Employees
Delete many own workforce employees at once by passing their ids
POST
/
v1
/
own_workforces
/
bulk-delete
Bulk Delete Workforce 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({own_workforce_ids: {}, consolidate_group: true})
};
fetch('https://api.dcycle.io/v1/own_workforces/bulk-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/own_workforces/bulk-delete"
payload = {
"own_workforce_ids": {},
"consolidate_group": True
}
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/v1/own_workforces/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"own_workforce_ids": {},
"consolidate_group": true
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}← Own Workforce API
Delete up to 100,000 employees in one call by listing their ids. The response reports what succeeded and what did not, so a partial failure is visible rather than silent.
The call returns
Irreversible, and it cascades: each deleted employee takes their contracts, remunerations, trainings and absence records with them. There is no create endpoint to put them back — only a re-import.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faBody
array[string]
required
Employee UUIDs to delete. Between 1 and 100,000 entries.
boolean
default:"false"
Group view.
false authorizes deletion inside the header organization only. true authorizes it across the whole accepted family.Ids outside the resolved perimeter are never deleted; they come back in failed_ids instead.Response
integer
How many employees were deleted
array[string]
Ids of the deleted employees
integer
How many ids were not deleted — unknown, already gone, or outside your perimeter
array[string]
Ids that were not deleted
string
Human-readable summary
200 OK even when some ids fail. Always read failed_count rather than relying on the status code.
Example
curl -X POST "https://api.dcycle.io/v1/own_workforces/bulk-delete" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"own_workforce_ids": [
"550e8400-e29b-41d4-a716-446655440000",
"661f9511-f3ac-52e5-b827-557766551111"
]
}'
import os
import requests
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
payload = {
"own_workforce_ids": [
"550e8400-e29b-41d4-a716-446655440000",
"661f9511-f3ac-52e5-b827-557766551111",
]
}
response = requests.post(
"https://api.dcycle.io/v1/own_workforces/bulk-delete",
headers=headers,
json=payload,
)
result = response.json()
print(f"deleted {result['success_count']}, failed {result['failed_count']}")
if result["failed_ids"]:
print("not deleted:", result["failed_ids"])
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
axios.post('https://api.dcycle.io/v1/own_workforces/bulk-delete', {
own_workforce_ids: [
'550e8400-e29b-41d4-a716-446655440000',
'661f9511-f3ac-52e5-b827-557766551111'
]
}, { headers })
.then(response => {
const { success_count, failed_count, failed_ids } = response.data;
console.log(`deleted ${success_count}, failed ${failed_count}`);
if (failed_ids.length) console.log('not deleted:', failed_ids);
})
.catch(error => console.error(error));
Successful Response
{
"success_count": 1,
"success_ids": ["550e8400-e29b-41d4-a716-446655440000"],
"failed_count": 1,
"failed_ids": ["661f9511-f3ac-52e5-b827-557766551111"],
"message": "Deleted 1 of 2 own workforce records"
}
Common Errors
401 Unauthorized
Cause: the key is invalid, or it does not belong to the organization inx-organization-id — the two are looked up as a pair. A request carrying no credentials at all answers AUTH_REQUIRED instead.
{
"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, or their role cannot write.{
"detail": "Logged User is not Member of Organization",
"code": "LOGGED_USER_NOT_MEMBER"
}
422 Unprocessable Entity
Cause: emptyown_workforce_ids, more than 100,000 entries, or a value that is not a UUID.
{
"detail": [
{
"type": "too_short",
"loc": ["body", "own_workforce_ids"],
"msg": "List should have at least 1 item after validation, not 0"
}
]
}
Related Endpoints
Bulk delete by filters
Delete what a filtered list returned, without collecting ids
Delete one employee
Single-record deletion
Was this page helpful?