Delta

Delta

This page documents the delta specification for the Protime API, including delta properties, expiration rules, response structure, supported collections, and external reference support.

For step-by-step instructions, see How to track changes with delta. For background on the synchronization model, see Delta synchronization.

Delta endpoint URL pattern

Delta responses are served from a dedicated path:

connector/protimeapi/api/v1/delta/{collection}?deltaToken={token}

The {collection} segment matches the name of the source collection (e.g. clockings, people).

Delta properties

Property Type Description
changeType string The type of data change. Possible values: InsertOrUpdate, Delete.
data.changeVersion string Version identifier for the change. Determines the correct processing order of changes.
data.... various The data of the requested object (e.g. clocking, person). Layout matches the collection schema.
deltaLink string A link to obtain new data changes in the next request.

Delta token format

The deltaToken query parameter is a Base64-encoded JSON object with the following fields:

Field Type Description
DeltaId long Unique identifier of the delta request.
StartingCursor long Sequence cursor indicating how far processing has progressed.
TimeStamp DateTime UTC timestamp of the token’s creation.

The token is opaque to consumers and is produced and validated by the API. Consumers pass it back unchanged via the deltaToken query parameter.

Delta expiration

  • A delta expires 72 hours after the last request.
  • Once expired, the delta data is deleted and cannot be retrieved.
  • An expired delta link returns 410 Gone.
  • Even when the delta endpoint returns an empty list, the response contains a new deltaLink. Using that new link keeps the delta valid within the 72-hour window.

changeVersion comparison

The changeVersion field supports string comparison for determining relative ordering. If a newly received object has a changeVersion that is lexicographically smaller than a previously received object with the same unique identifier, the newer receipt can be safely ignored.

Concurrency constraint

Only one delta can be active at a time per collection.

Initial request vs. subsequent requests

Aspect Initial delta request Subsequent delta requests
Pagination Paginated – responses include nextLink until the last page Not paginated – all changes in a single response
Final link Last page contains a deltaLink instead of a nextLink Every response contains a new deltaLink
Trigger &delta query parameter appended to a GET collection endpoint The deltaLink from the previous response

Initial request response structure

The initial delta request is always paginated. Pages are linked via nextLink until a deltaLink appears on the last page.

Last page example:

{
    "value": [],
    "deltaLink": "/connector/protimeapi/api/v1/delta/clockings?deltaToken=eyJEZWx0YUlkIjozMDA4MCwiU3RhcnRpbmdDdXJzb3IiOjQ1NTIyLCJUaW1lU3RhbXAiOiIyMDI1LTAxLTEwVDEzOjMxOjE0LjE2Njk3NjhaIn0="
}

Subsequent delta response structure

{
    "value": [
        {
            "changeType": "InsertOrUpdate",
            "data": {
                "changeVersion": "0000090200004BD0000A",
                "id": 18618,
                "date": "2025-01-10"
            }
        },
        {
            "changeType": "Delete",
            "data": {
                "id": 1001,
                "changeVersion": "0000090200004BD0000C"
            }
        }
    ],
    "deltaLink": "/connector/protimeapi/api/v1/delta/clockings?deltaToken=eyJEZWx0YUlkIjozMDA4MCwiU3RhcnRpbmdDdXJzb3IiOjQ1NTIyLCJUaW1lU3RhbXAiOiIyMDI1LTAxLTEwVDEzOjMxOjE0LjE2Njk3NjhaIn0="
}

Response fields

Field Description
value List of all data changes for the requested collection.
changeType The type of data change: InsertOrUpdate or Delete.
data The actual object, with the same layout as described in the collection.
deltaLink A new link to obtain subsequent data changes.

Supported collections

The following collections support delta tracking:

Collection Delta endpoint path
absence-definitions connector/protimeapi/api/v1/delta/absence-definitions
absence-groups connector/protimeapi/api/v1/delta/absence-groups
absences connector/protimeapi/api/v1/delta/absences
access-clockings connector/protimeapi/api/v1/delta/access-clockings
activity-durations connector/protimeapi/api/v1/delta/activity-durations
assignments connector/protimeapi/api/v1/delta/assignments
break-definitions connector/protimeapi/api/v1/delta/break-definitions
breaks connector/protimeapi/api/v1/delta/breaks
calculated-totals connector/protimeapi/api/v1/delta/calculated-totals
clockings connector/protimeapi/api/v1/delta/clockings
contracts connector/protimeapi/api/v1/delta/contracts
counter-definitions connector/protimeapi/api/v1/delta/counter-definitions
counter-groups connector/protimeapi/api/v1/delta/counter-groups
counters connector/protimeapi/api/v1/delta/counters
paid-presences connector/protimeapi/api/v1/delta/paid-presences
people connector/protimeapi/api/v1/delta/people
shift-definitions connector/protimeapi/api/v1/delta/shift-definitions
work-interruptions connector/protimeapi/api/v1/delta/work-interruptions

External references with delta

External references can be included in delta requests by appending the externalReferences query parameter.

Example – clockings with badge number:

GET
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/clockings?filter=date ge '2025-12-01'&delta&externalReferences=(people,@badge-number)

See the external references reference for details on predefined and custom external references.

See also