Bulk Delete Workforce Absences
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({absenteeism_accident_ids: {}, consolidate_group: true})
};
fetch('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/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_workforce_absenteeisms_accidents/bulk-delete"
payload = {
"absenteeism_accident_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_workforce_absenteeisms_accidents/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"absenteeism_accident_ids": {},
"consolidate_group": true
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}Bulk Delete Workforce Absences
Delete many absence and accident records at once by passing their ids
POST
/
v1
/
own_workforce_absenteeisms_accidents
/
bulk-delete
Bulk Delete Workforce Absences
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({absenteeism_accident_ids: {}, consolidate_group: true})
};
fetch('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/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_workforce_absenteeisms_accidents/bulk-delete"
payload = {
"absenteeism_accident_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_workforce_absenteeisms_accidents/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"absenteeism_accident_ids": {},
"consolidate_group": true
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}← Own Workforce API
Delete up to 100,000 absence and accident records in one call. The response reports what succeeded and what did not, so a partial failure is visible rather than silent.
Irreversible: there is no endpoint that recreates these records, only a re-import. Remember that a row covering an accident and its sick leave removes both events.
The call returns
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faBody
array[string]
required
Record UUIDs to delete — the
id of each row, not accident_id or absenteeism_id. Between 1 and 100,000 entries.boolean
default:"false"
Group view.
false authorizes deletion inside the header organization only; true across the whole accepted family.Ids outside the resolved perimeter are never deleted — they come back in failed_ids.Response
integer
How many records were deleted
array[string]
Ids of the deleted records
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. Read failed_count, not the status code.
Example
curl -X POST "https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/bulk-delete" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{"absenteeism_accident_ids": ["6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6f"]}'
import os
import requests
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
response = requests.post(
"https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/bulk-delete",
headers=headers,
json={"absenteeism_accident_ids": ["6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6f"]},
)
result = response.json()
print(f"deleted {result['success_count']}, failed {result['failed_count']}")
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_workforce_absenteeisms_accidents/bulk-delete', {
absenteeism_accident_ids: ['6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6f']
}, { headers })
.then(({ data }) => console.log(`deleted ${data.success_count}, failed ${data.failed_count}`))
.catch(error => console.error(error));
Successful Response
{
"success_count": 1,
"success_ids": ["6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6f"],
"failed_count": 0,
"failed_ids": [],
"message": "Deleted 1 absenteeism/accident record"
}
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: emptyabsenteeism_accident_ids, more than 100,000 entries, or a value that is not a UUID.
{
"detail": [
{
"type": "too_short",
"loc": ["body", "absenteeism_accident_ids"],
"msg": "List should have at least 1 item after validation, not 0"
}
]
}
Related Endpoints
Bulk delete by filters
Delete a filtered set without collecting ids
Delete one record
Single-record deletion
Was this page helpful?