List Workforce Absences by Employee
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/own_workforce/{own_workforce_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/own_workforce/{own_workforce_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/own_workforce/{own_workforce_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'List Workforce Absences by Employee
Retrieve every absence and accident record belonging to one own workforce employee
GET
/
v1
/
own_workforce_absenteeisms_accidents
/
own_workforce
/
{own_workforce_id}
List Workforce Absences by Employee
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/own_workforce/{own_workforce_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/own_workforce/{own_workforce_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/own_workforce/{own_workforce_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'← Own Workforce API
Return the absence and accident records of a single employee. The employee id goes in the path, which is what distinguishes this from the organization-wide List Workforce Absences.
These records are health data: sick-leave dates and hours, and the context of workplace accidents, each tied to an identifiable employee. That is special-category personal data under the GDPR. Do not log responses verbatim or cache them in shared stores, and restrict the API keys that can reach this endpoint.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
Employee UUID, from List Workforce EmployeesExample:
550e8400-e29b-41d4-a716-446655440000Response
A bare JSON array with the same fields as List Workforce Absences, including the accident/absence split described there. An employee with no records returns an empty array, not a 404.Example
curl -X GET "https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/own_workforce/550e8400-e29b-41d4-a716-446655440000" \
-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"),
}
employee_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.get(
f"https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/own_workforce/{employee_id}",
headers=headers,
)
for record in response.json():
kind = "accident" if record["accident_id"] else "absence"
print(kind, record["accident_date"] or record["absenteeism_start_date"])
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
const employeeId = '550e8400-e29b-41d4-a716-446655440000';
axios.get(
`https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/own_workforce/${employeeId}`,
{ headers }
)
.then(({ data }) => {
data.forEach(record => {
const kind = record.accident_id ? 'accident' : 'absence';
console.log(kind, record.accident_date || record.absenteeism_start_date);
});
})
.catch(error => console.error(error));
Successful Response
[
{
"id": "6f2c8d13-4a5b-4c6d-9e0f-1a2b3c4d5e6f",
"own_workforce_id": "550e8400-e29b-41d4-a716-446655440000",
"external_employee_id": "EMP-2024-001",
"type": "Accidente de Trabajo",
"accident_id": "7a3d9e24-5b6c-4d7e-8f90-2b3c4d5e6f70",
"accident_date": "2026-04-12",
"accident_context": "in_labore",
"absenteeism_id": "8b4e0f35-6c7d-4e8f-9a01-3c4d5e6f7081",
"absenteeism_start_date": "2026-04-13",
"absenteeism_end_date": "2026-04-25",
"absenteeism_hours": 80.0,
"file_name": "absences_2026.csv",
"status": "active"
}
]
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 inx-organization-id.
{
"detail": "Logged User is not Member of Organization",
"code": "LOGGED_USER_NOT_MEMBER"
}
404 Not Found
Cause: no employee with that id inside your perimeter. An employee owned by another organization answers 404, the same as one that does not exist.{
"code": "NOT_FOUND",
"detail": "OwnWorkforceModel with id='550e8400-e29b-41d4-a716-446655440000' not found"
}
Related Endpoints
Get employee
The person these records belong to
Trainings of an employee
The same view for trainings
Was this page helpful?