Get Workforce Verification Data
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/own_workforces/verification-data', 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/verification-data"
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_workforces/verification-data \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"external_employee_id": "<string>",
"date_ranges": {
"start_date": "<string>",
"end_date": {}
}
}Get Workforce Verification Data
Retrieve employee identifiers and their contract date ranges, used to validate a file before importing it
GET
/
v1
/
own_workforces
/
verification-data
Get Workforce Verification Data
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/own_workforces/verification-data', 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/verification-data"
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_workforces/verification-data \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"external_employee_id": "<string>",
"date_ranges": {
"start_date": "<string>",
"end_date": {}
}
}← Own Workforce API
Return every employee identifier in the organization together with the date ranges of their contracts. Its purpose is narrow: it lets an uploader check, before submitting, that the employees named in a trainings or absences file exist and that the dates fall inside a contract.
Unlike List Workforce Countries and List Workforce Job Categories, which walk the organization tree, this endpoint returns the header organization’s employees only. A holding using it to pre-validate a group-wide import would reject every subsidiary employee. It takes no filters and does not paginate.
Support endpoint, not recommended for new integrations. It exists to back the in-app import screen and its response is shaped for that screen, so it may change with the importer. For validation in your own pipeline, prefer the Imports API: create a session and call validate, which applies the same employee and contract-range rules server-side and returns them as per-row errors. Use this endpoint only if you need the raw ranges for something the importer cannot express.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faResponse
A bare JSON array, one entry per employee.string
The identifier from your HR system, the same value the trainings and absences import templates key on
array[object]
Example
curl -X GET "https://api.dcycle.io/v1/own_workforces/verification-data" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import os
from datetime import date
import requests
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
response = requests.get(
"https://api.dcycle.io/v1/own_workforces/verification-data",
headers=headers,
)
ranges = {row["external_employee_id"]: row["date_ranges"] for row in response.json()}
def covered(employee_id: str, day: date) -> bool:
"""True when the employee had a contract on that day."""
for span in ranges.get(employee_id, []):
start = date.fromisoformat(span["start_date"])
end = date.fromisoformat(span["end_date"]) if span["end_date"] else None
if start <= day and (end is None or day <= end):
return True
return False
print(covered("EMP-2024-001", date(2026, 3, 1)))
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
axios.get('https://api.dcycle.io/v1/own_workforces/verification-data', { headers })
.then(response => {
const ranges = Object.fromEntries(
response.data.map(row => [row.external_employee_id, row.date_ranges])
);
const covered = (id, day) => (ranges[id] || []).some(
span => span.start_date <= day && (span.end_date === null || day <= span.end_date)
);
console.log(covered('EMP-2024-001', '2026-03-01'));
})
.catch(error => console.error(error));
Successful Response
[
{
"external_employee_id": "EMP-2024-001",
"date_ranges": [
{ "start_date": "2023-06-01", "end_date": null }
]
},
{
"external_employee_id": "EMP-2024-002",
"date_ranges": [
{ "start_date": "2022-01-01", "end_date": "2024-03-31" },
{ "start_date": "2025-09-01", "end_date": null }
]
}
]
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"
}
Related Endpoints
Own workforce import templates
The rules this data helps you satisfy
Validate an import
The recommended way to check a file
Was this page helpful?