> For the complete documentation index, see [llms.txt](https://docs.samesystem.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samesystem.dev/business-guides/absence/periodical-absence/fetch-periodical-absence-logs.md).

# Fetch periodical absence logs

{% hint style="info" %}
Only available in API v2.
{% endhint %}

The periodical absence logs can be used to track changes to periodical absences over time, from the initial creation of a periodical absence through subsequent changes and cancelling.

This is particularly useful for integrations with external systems where periodical absence changes need to be synchronized over time, such as HRIS, payroll, or other absence management systems. Instead of retrieving and comparing all periodical absence data, the integration can use the logs to identify what has changed since the previous synchronization.

The endpoint returns an array of `PeriodAbsenceLockLog` objects representing the periodical absence changes.

{% hint style="warning" %}
This endpoint will only return logs from absences that are **periodical**.
{% endhint %}

### Endpoint

You can use this endpoint to retrieve the periodical absence logs.

`/{clientToken}/period_absences/logs`&#x20;

### Request

Use `changesFrom` to retrieve periodical absence changes from a specific date. You can optionally limit the request to specific users.

```json
{
  "data": {
    "attributes": {
      "changesFrom": "2024-01-01",
      "userIds": [
        738912,
        172390
      ]
    }
  }
}
```

#### Request Parameters

* `changesFrom` – Retrieve periodical absence changes from the specified date.
* `userIds` – Limit the result to specific users.

> **Integration tip:** For recurring integrations, periodical absence logs can be used for incremental synchronization, allowing the external system to process only period absences that have changed since the previous synchronization.

### Response

The response is an array of `PeriodAbsenceLockLog` objects. Atrributes are:

<table data-header-hidden data-search="false"><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><code>id</code></td><td valign="top">A unique id to the periodical absence log.</td></tr><tr><td valign="top"><code>status</code></td><td valign="top">Status. Can be:<br><code>Current</code> : The current periodical absence<br><code>Cancelled</code> : Either a deleted absence or a previous version of the absence.</td></tr><tr><td valign="top">startDate</td><td valign="top">The start date of the periodical absence.</td></tr><tr><td valign="top">endDate</td><td valign="top">The end date of the periodical absence.</td></tr><tr><td valign="top">user</td><td valign="top">The user this periodical absence is created for.</td></tr><tr><td valign="top">wageEarnerNo</td><td valign="top">Payroll number of the user.</td></tr><tr><td valign="top">absenceType</td><td valign="top">The absence type.</td></tr><tr><td valign="top">createdAt</td><td valign="top">The date/time the periodical absence was modified.</td></tr></tbody></table>

Refer to the API reference for the complete `PeriodAbsenceLockLog` schema and available fields.

### Example

Periodical absence "Parental leave" is created from 2026-08-24 to 2026-08-31 in the schedule. It will return this log with status "current":

```json
{
    "data": [
        {
            "type": "PeriodicalAbsenceLockLog",
            "id": "1782960",
            "attributes": {
                "id": "1782960",
                "startDate": "2026-08-24",
                "endDate": "2026-08-31",
                "status": "current",
                "createdAt": "2026-08-21 11:14:44 UTC",
                "wageEarnerNo": "10000",
                "absenceType": {
                    "id": "104997",
                    "name": "Parental leave"
                },
                "user": {
                    "id": "758494",
                    "fullName": "John Doe"
                }
            }
        }
    ]
}
```

The periodical absence is modified and extended with end date 2026-09-06.  The log will return the three objects below. The original one with `id:1782960` was cancelled, a new one with same id for the cancelled date/time, and a new log for the current extended periodical absence with `id:1782961`:

```json
{
    "data": [
        {
            "type": "PeriodicalAbsenceLockLog",
            "id": "1782960",
            "attributes": {
                "id": "1782960",
                "startDate": "2026-08-24",
                "endDate": "2026-08-31",
                "status": "cancelled",
                "createdAt": "2026-08-21 11:16:42 UTC",
                "wageEarnerNo": "10000",
                "absenceType": {
                    "id": "104997",
                    "name": "Parental leave"
                },
                "user": {
                    "id": "758494",
                    "fullName": "John Doe"
                }
            }
        },
        {
            "type": "PeriodicalAbsenceLockLog",
            "id": "1782961",
            "attributes": {
                "id": "1782961",
                "startDate": "2026-08-24",
                "endDate": "2026-09-06",
                "status": "current",
                "createdAt": "2026-08-21 11:16:42 UTC",
                "wageEarnerNo": "10000",
                "absenceType": {
                    "id": "104997",
                    "name": "Parental leave"
                },
                "user": {
                    "id": "758494",
                    "fullName": "John Doe"
                }
            }
        },
        {
            "type": "PeriodicalAbsenceLockLog",
            "id": "1782960",
            "attributes": {
                "id": "1782960",
                "startDate": "2026-08-24",
                "endDate": "2026-08-31",
                "status": "cancelled",
                "createdAt": "2026-08-21 11:14:44 UTC",
                "wageEarnerNo": "10000",
                "absenceType": {
                    "id": "104997",
                    "name": "Parental leave"
                },
                "user": {
                    "id": "758494",
                    "fullName": "John Doe"
                }
            }
        }
    ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.samesystem.dev/business-guides/absence/periodical-absence/fetch-periodical-absence-logs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
