Delete Workforce Absence
const options = {
method: 'DELETE',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/{absenteeism_accident_id}', 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/{absenteeism_accident_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/{absenteeism_accident_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'Delete Workforce Absence
Permanently delete one absence or workplace accident record
DELETE
/
v1
/
own_workforce_absenteeisms_accidents
/
{absenteeism_accident_id}
Delete Workforce Absence
const options = {
method: 'DELETE',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/{absenteeism_accident_id}', 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/{absenteeism_accident_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/{absenteeism_accident_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'← Own Workforce API
Delete a single absence or accident record. Irreversible, and there is no endpoint that creates one back — restoring it means re-importing through the Imports API.
Deleting a record changes the reported absence hours and accident counts for every period it fell in.
A record that describes an accident and the sick leave it caused is one row. Deleting it removes both events, not just one of them. There is no way to delete only the absence half and keep the accident.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
Record UUID — the
id of the row, not accident_id or absenteeism_idExample: 6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6fResponse
204 No Content with an empty body.
Example
curl -X DELETE "https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6f" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import os
import requests
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
record_id = "6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6f"
response = requests.delete(
f"https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/{record_id}",
headers=headers,
)
print(response.status_code) # 204
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
const recordId = '6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6f';
axios.delete(
`https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/${recordId}`,
{ headers }
)
.then(response => console.log(response.status))
.catch(error => console.error(error));
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"
}
404 Not Found
Cause: no record with that id inside your perimeter. A record whose employee belongs to another organization answers 404, never 403. Passing anaccident_id or absenteeism_id instead of the row id also answers 404.
{
"code": "NOT_FOUND",
"detail": "OwnWorkforceAbsenteeismsAccidentsModel with id='550e8400-e29b-41d4-a716-446655440000' not found"
}
Related Endpoints
Bulk delete absences
Delete many by id
Bulk delete by filters
Delete a filtered set
Was this page helpful?