> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Workforce Verification Data

> Retrieve employee identifiers and their contract date ranges, used to validate a file before importing it

[← Own Workforce API](/api-reference/own-workforce/overview)

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.

<Warning>
  **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](/api-reference/imports/overview): 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.
</Warning>

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

## Response

A bare JSON array, one entry per employee.

<ResponseField name="external_employee_id" type="string">
  The identifier from your HR system, the same value the trainings and absences import templates key on
</ResponseField>

<ResponseField name="date_ranges" type="array[object]">
  <Expandable title="contract range">
    <ResponseField name="start_date" type="string">
      `YYYY-MM-DD`
    </ResponseField>

    <ResponseField name="end_date" type="string | null">
      Null means open-ended, so any date on or after `start_date` falls inside it
    </ResponseField>
  </Expandable>
</ResponseField>

Unlike [List Workforce Countries](/api-reference/own-workforce/countries) and [List Workforce Job Categories](/api-reference/own-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.

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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)))
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
[
  {
    "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 in `x-organization-id` — the two are looked up as a pair. A request carrying no credentials at all answers `AUTH_REQUIRED` instead.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "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 in `x-organization-id`.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Logged User is not Member of Organization",
  "code": "LOGGED_USER_NOT_MEMBER"
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Own workforce import templates" icon="table-columns" href="/api-reference/imports/own-workforce-templates">
    The rules this data helps you satisfy
  </Card>

  <Card title="Validate an import" icon="circle-check" href="/api-reference/imports/validate">
    The recommended way to check a file
  </Card>
</CardGroup>
