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

> Retrieve absence and accident records in pages, with filters, group view and a filter hash

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

The paginated absence and accident list, and the one to build against. It takes the same filters as the flat list, adds group view and column filters, and returns the `filter_hash` that [Bulk Delete Workforce Absences by Filters](/api-reference/own-workforce/bulk-delete-absences-by-filters) requires.

<Note>
  This endpoint declares no response schema in the OpenAPI document, so generated clients will see an untyped body. The shape below is what it returns; the items are the same records as [List Workforce Absences](/api-reference/own-workforce/list-absences), including the accident/absence split described there.
</Note>

<Warning>
  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.
</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>

### 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="file_id[]" type="array[string]">
  Filter by source upload file. The nil UUID matches rows with no file.
</ParamField>

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

<ParamField query="created_at_to" type="datetime">
  Only rows created on or before this instant, inclusive
</ParamField>

<ParamField query="search" type="string">
  Free-text search, up to 255 characters
</ParamField>

<ParamField query="consolidate_group" type="boolean" default="false">
  Group view. `true` widens the list to the header organization's accepted business family.
</ParamField>

<ParamField query="organization_id[]" type="array[string]">
  Restrict a group-view list to these organizations. Only meaningful with `consolidate_group=true`.
</ParamField>

<ParamField query="project_id" type="string">
  Scope to a project's reporting perimeter, together with `scope_to_project_organizations`
</ParamField>

<ParamField query="scope_to_project_organizations" type="boolean" default="false">
  Narrow the perimeter to the organizations attached to `project_id`
</ParamField>

## Response

<ResponseField name="items" type="array[object]">
  Absence and accident records — see [List Workforce Absences](/api-reference/own-workforce/list-absences) for the fields
</ResponseField>

<ResponseField name="total" type="integer">
  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">
  Fingerprint of the applied filters, required by bulk delete by filters
</ResponseField>

## Example

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

  response = requests.get(
      "https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/paginated",
      headers=headers,
      params={"page": 1, "size": 50},
  ).json()

  lost_hours = sum(r["absenteeism_hours"] or 0 for r in response["items"])
  print(f"{response['total']} records, {lost_hours} hours lost on this page")
  ```

  ```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_workforce_absenteeisms_accidents/paginated', {
    headers,
    params: { page: 1, size: 50 }
  })
  .then(({ data }) => {
    const lostHours = data.items.reduce((total, r) => total + (r.absenteeism_hours || 0), 0);
    console.log(`${data.total} records, ${lostHours} hours lost on this page`);
  })
  .catch(error => console.error(error));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "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_id": "dd44ee55-ff66-4077-8188-99aabbccddee",
      "file_name": "absences_2026.csv",
      "status": "active"
    }
  ],
  "total": 96,
  "page": 1,
  "size": 50,
  "filter_hash": "9c1b7e34a0f5d862"
}
```

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

### 422 Unprocessable Entity

**Cause:** a malformed parameter, or `size` above 100.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": [
    {
      "type": "less_than_equal",
      "loc": ["query", "size"],
      "msg": "Input should be less than or equal to 100"
    }
  ]
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Absences unique values" icon="filter" href="/api-reference/own-workforce/unique-values-absences">
    Build the file filter
  </Card>

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