← Own Workforce APIReturn 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.
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.
Null means open-ended, so any date on or after start_date falls inside it
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.
import osfrom datetime import dateimport requestsheaders = { "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 Falseprint(covered("EMP-2024-001", date(2026, 3, 1)))
Cause: the key is invalid or revoked (INVALID_API_KEY), expired (API_KEY_EXPIRED), belongs neither to the organization in x-organization-id nor to one of its parents (API_KEY_ORG_MISMATCH), or has no owner (API_KEY_NO_OWNER). A request carrying no credentials at all answers AUTHENTICATION_REQUIRED. See Errors.
{ "detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}