> ## 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.

# List Workforce Employees

> Retrieve a paginated list of own workforce employees with their current contract summary

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

Retrieve a paginated list of employee records. Each item is one person, flattened with the dates and category of the contract that represents them in the listing.

## 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>

### Query Parameters

<ParamField query="page" type="integer" default="1">
  Page number, starting at 1
</ParamField>

<ParamField query="size" type="integer" default="50">
  Page size, between 1 and 100
</ParamField>

<ParamField query="external_employee_id" type="string">
  Search by the employee identifier your own HR system uses

  **Example:** `external_employee_id=EMP-2024-001`
</ParamField>

<ParamField query="file_id[]" type="array[string]">
  Filter by the source upload file. Repeat the parameter for several files.

  Pass the nil UUID `00000000-0000-0000-0000-000000000000` to match rows that came from **no** file — that is, rows with a null `file_id`.

  **Example:** `file_id[]=9f1c7f2a-64a1-4b2c-9d3e-70a5b8c1d2e3`
</ParamField>

<ParamField query="created_at_from" type="datetime">
  Only rows created at or after this instant

  **Format:** ISO 8601 — `2026-01-01T00:00:00`
</ParamField>

<ParamField query="created_at_to" type="datetime">
  Only rows created at or before this instant

  **Format:** ISO 8601 — `2026-12-31T23:59:59`
</ParamField>

<ParamField query="consolidate_group" type="boolean" default="false">
  Group view. `false` returns the header organization only. `true` widens the list to the header organization's accepted business family — itself plus its accepted, enabled descendants.
</ParamField>

<ParamField query="organization_id[]" type="array[string]">
  Restrict a group-view list to these organizations, intersected with the family resolved above. Only meaningful together with `consolidate_group=true`.

  **Example:** `organization_id[]=a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

<ParamField query="project_id" type="string">
  Scope the list to a project's reporting perimeter. Only applied together with `scope_to_project_organizations=true`.
</ParamField>

<ParamField query="scope_to_project_organizations" type="boolean" default="false">
  When `true`, narrow the perimeter to the organizations attached to `project_id` instead of the whole group tree.
</ParamField>

## Response

<ResponseField name="items" type="array[object]">
  <Expandable title="employee">
    <ResponseField name="id" type="string">
      Employee UUID
    </ResponseField>

    <ResponseField name="external_employee_id" type="string">
      The identifier from your HR system. Unique per organization, so the same value can exist in two organizations of the same group.
    </ResponseField>

    <ResponseField name="employment_category" type="string">
      Free-text job category as uploaded, e.g. `Engineer`
    </ResponseField>

    <ResponseField name="location_code" type="string">
      Name of the contract's work location. On this endpoint it is the location **name**; the contract detail endpoint returns the country name in the field of the same name.
    </ResponseField>

    <ResponseField name="nationality" type="string | null">
      Employee nationality, null when it was not provided
    </ResponseField>

    <ResponseField name="contract_start_date" type="string">
      Contract start, `YYYY-MM-DD`
    </ResponseField>

    <ResponseField name="contract_end_date" type="string | null">
      Contract end, `YYYY-MM-DD`. Null means open-ended.
    </ResponseField>

    <ResponseField name="created_at" type="string | null">
      When the row was ingested
    </ResponseField>

    <ResponseField name="file_id" type="string | null">
      Source upload file, null for rows not created from a file
    </ResponseField>

    <ResponseField name="file_name" type="string | null">
      Name of that file
    </ResponseField>

    <ResponseField name="processing_job_id" type="string | null">
      Ingestion job that produced the row
    </ResponseField>

    <ResponseField name="status" type="string | null">
      Ingestion status of the row
    </ResponseField>

    <ResponseField name="organization_id" type="string | null">
      Owning organization. Populated on group-view responses.
    </ResponseField>

    <ResponseField name="organization_name" type="string | null">
      Owning organization name. Group view only.
    </ResponseField>

    <ResponseField name="organization_logo_url" type="string | null">
      Owning organization logo. Group view only.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer">
  Number of rows matching the filters, across all pages
</ResponseField>

<ResponseField name="page" type="integer">
  Current page
</ResponseField>

<ResponseField name="size" type="integer">
  Current page size
</ResponseField>

<ResponseField name="filter_hash" type="string | null">
  Fingerprint of the filters that produced this page. Pass it to [Bulk Delete Workforce Employees by Filters](/api-reference/own-workforce/bulk-delete-by-filters) to prove you are deleting exactly what you listed — if the filters changed in between, that call fails instead of deleting a wider set.
</ResponseField>

<Warning>
  Every date field in this response is typed as a **string**, not a date, including `contract_start_date` and `created_at`. Parse accordingly.
</Warning>

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/own_workforces?page=1&size=50&created_at_from=2026-01-01T00:00:00" \
    -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

  import requests

  headers = {
      "x-api-key": os.getenv("DCYCLE_API_KEY"),
      "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
  }

  params = {"page": 1, "size": 50, "created_at_from": "2026-01-01T00:00:00"}

  response = requests.get(
      "https://api.dcycle.io/v1/own_workforces",
      headers=headers,
      params=params,
  )

  result = response.json()
  print(f"{result['total']} employees")
  for employee in result["items"]:
      print(f"{employee['external_employee_id']}: {employee['employment_category']} ({employee['location_code']})")
  ```

  ```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', {
    headers,
    params: { page: 1, size: 50, created_at_from: '2026-01-01T00:00:00' }
  })
  .then(response => {
    console.log(`${response.data.total} employees`);
    response.data.items.forEach(employee => {
      console.log(`${employee.external_employee_id}: ${employee.employment_category} (${employee.location_code})`);
    });
  })
  .catch(error => console.error(error));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "external_employee_id": "EMP-2024-001",
      "employment_category": "Engineer",
      "location_code": "Spain",
      "nationality": "Spain",
      "contract_start_date": "2023-06-01",
      "contract_end_date": null,
      "created_at": "2026-02-15T09:30:00",
      "file_id": "9f1c7f2a-64a1-4b2c-9d3e-70a5b8c1d2e3",
      "processing_job_id": "c2a7b81e-3f55-4c0b-9a6d-1e2f3a4b5c6d",
      "file_name": "workforce_2026.csv",
      "status": "active",
      "organization_id": null,
      "organization_name": null,
      "organization_logo_url": null
    }
  ],
  "total": 145,
  "page": 1,
  "size": 50,
  "filter_hash": "b6d1f0c47a9e2d38"
}
```

## 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"
}
```

### 400 Bad Request

**Cause:** `x-organization-id` absent while authenticating with an API key. It is the first error a new integration hits, and it is a 400 rather than a 422 because the header is read inside the auth dependency.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "x-organization-id header required when using API key authentication",
  "code": "ORGANIZATION_ID_REQUIRED"
}
```

### 422 Unprocessable Entity

**Cause:** a malformed query parameter. Authentication is resolved first — the router-level dependency runs before the endpoint's own parameters are validated — so a request that is both unauthenticated and malformed answers 401, not 422.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": [
    {
      "type": "uuid_parsing",
      "loc": ["query", "file_id[]", 0],
      "msg": "Input should be a valid UUID"
    }
  ]
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Get employee" icon="user" href="/api-reference/own-workforce/get">
    A single employee by id
  </Card>

  <Card title="Unique values" icon="filter" href="/api-reference/own-workforce/unique-values">
    Build the file filter for this list
  </Card>

  <Card title="Employees with contracts" icon="layer-group" href="/api-reference/own-workforce/with-contracts">
    Employees, contracts and remuneration periods in one call
  </Card>

  <Card title="Bulk delete by filters" icon="trash" href="/api-reference/own-workforce/bulk-delete-by-filters">
    Delete exactly what this list returned
  </Card>
</CardGroup>
