Absences

Absences represent periods when an employee is not working, such as vacation, sick leave, parental leave, or other types of time off. Each absence is linked to an employee and has a configurable type that determines how it affects working time calculations.

The Absence Object

  • Name
    id
    Type
    string (UUID)
    Description

    Unique identifier for the absence.

  • Name
    created_at
    Type
    string (ISO 8601)
    Description

    Timestamp when the absence was created.

  • Name
    modified_at
    Type
    string (ISO 8601)
    Description

    Timestamp when the absence was last modified.

  • Name
    employee_id
    Type
    string (UUID)
    Description

    The employee this absence belongs to.

  • Name
    date_from
    Type
    string (YYYY-MM-DD)
    Description

    Start date of the absence.

  • Name
    date_to
    Type
    string (YYYY-MM-DD)
    Description

    End date of the absence (inclusive).

  • Name
    affected_days
    Type
    decimal
    Description

    Number of working days affected by this absence.

  • Name
    missing_type
    Type
    string
    Description

    The absence type identifier (e.g. holiday, sickday). Configured per organization.

  • Name
    target_hour_behaviour
    Type
    string
    Description

    How this absence affects target working hours.

  • Name
    comment
    Type
    string
    Description

    A note or description for the absence.

  • Name
    attachment
    Type
    string (URL)
    Description

    URL of an attached file (e.g. doctor's note).

  • Name
    additional_fields
    Type
    object
    Description

    Custom key-value data.


GET/api/v2/timestamps/absence/

List all Absences

Retrieve a paginated list of absences.

Query Parameters

  • Name
    daterange
    Type
    string
    Description

    Filter by date range: YYYY-MM-DD|YYYY-MM-DD. Returns absences that overlap with the range.

  • Name
    created_at
    Type
    string
    Description

    Filter by creation date range: YYYY-MM-DD|YYYY-MM-DD.

  • Name
    employee_ids
    Type
    string
    Description

    Filter by employee IDs, pipe-separated.

  • Name
    employee_group_ids
    Type
    string
    Description

    Filter by employee group IDs, pipe-separated. Use null for ungrouped.

  • Name
    missing_types
    Type
    string
    Description

    Filter by absence types, pipe-separated (e.g. holiday|sickday).

  • Name
    has_attachment
    Type
    boolean
    Description

    Filter by presence of an attachment.

  • Name
    order
    Type
    string
    Description

    Sort by: created_at, date_from, or date_to.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence/?daterange=2024-06-01|2024-06-30&missing_types=holiday" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Response

{
  "count": 3,
  "results": [
    {
      "id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
      "created_at": "2024-05-15T10:00:00Z",
      "modified_at": "2024-05-15T10:00:00Z",
      "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "date_from": "2024-06-10",
      "date_to": "2024-06-14",
      "affected_days": 5.0,
      "missing_type": "holiday",
      "target_hour_behaviour": "reduce",
      "comment": "Summer vacation",
      "attachment": null,
      "additional_fields": {}
    }
  ]
}

GET/api/v2/timestamps/absence/:id/

Retrieve an Absence

Get details of a specific absence.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence/c1d2e3f4-a5b6-7890-cdef-123456789012/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

POST/api/v2/timestamps/absence/

Create an Absence

Create a new absence for an employee.

Required Parameters

  • Name
    employee_id
    Type
    string (UUID)
    Description

    The employee to create the absence for.

  • Name
    date_from
    Type
    string (YYYY-MM-DD)
    Description

    Start date.

  • Name
    date_to
    Type
    string (YYYY-MM-DD)
    Description

    End date (inclusive).

  • Name
    missing_type
    Type
    string
    Description

    The absence type identifier.

  • Name
    target_hour_behaviour
    Type
    string
    Description

    How the absence affects target hours.

Optional Parameters

  • Name
    affected_days
    Type
    decimal
    Description

    Number of affected working days. Auto-calculated if omitted.

  • Name
    comment
    Type
    string
    Description

    A description or note.

Request

curl -X POST "https://api.zeitstrom.com/api/v2/timestamps/absence/" \
  -H "Authorization: Token <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "date_from": "2024-07-15",
    "date_to": "2024-07-19",
    "missing_type": "holiday",
    "target_hour_behaviour": "reduce",
    "comment": "Summer break"
  }'

PATCH/api/v2/timestamps/absence/:id/

Update an Absence

Update an existing absence.

Request

curl -X PATCH "https://api.zeitstrom.com/api/v2/timestamps/absence/c1d2e3f4-a5b6-7890-cdef-123456789012/" \
  -H "Authorization: Token <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "date_to": "2024-06-21",
    "affected_days": 10.0,
    "comment": "Extended vacation"
  }'

DELETE/api/v2/timestamps/absence/:id/

Delete an Absence

Delete an absence.

Request

curl -X DELETE "https://api.zeitstrom.com/api/v2/timestamps/absence/c1d2e3f4-a5b6-7890-cdef-123456789012/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

GET/api/v2/timestamps/absence/missing-types/

List Absence Types

Retrieve the available absence types configured for your organization. Each type has an ID, label, and color.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence/missing-types/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Response

[
  { "id": "holiday", "label": "Holiday", "color": "#4CAF50" },
  { "id": "sickday", "label": "Sick Day", "color": "#F44336" },
  { "id": "parental", "label": "Parental Leave", "color": "#2196F3" }
]

GET/api/v2/timestamps/absence/working-day-count/

Working Day Count

Calculate the number of working days within a date range for specific employees. Useful for determining how many days an absence will affect.

Query Parameters

  • Name
    daterange
    Type
    string
    Description

    The date range: YYYY-MM-DD|YYYY-MM-DD. Required.

  • Name
    employee_ids
    Type
    string
    Description

    Employee IDs, pipe-separated. Required.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence/working-day-count/?daterange=2024-07-01|2024-07-31&employee_ids=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Response

[
  {
    "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "count": 23
  }
]

GET/api/v2/timestamps/absence/working-hours/

Working Hours

Get the expected working hours for a specific date for employees.

Query Parameters

  • Name
    date
    Type
    string (YYYY-MM-DD)
    Description

    The date to check. Required.

  • Name
    employee_ids
    Type
    string
    Description

    Employee IDs, pipe-separated. Required.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence/working-hours/?date=2024-07-15&employee_ids=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Response

[
  {
    "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "total_credit_hours": 8.0,
    "total_debit_hours": 0,
    "total_days": 1.0
  }
]

GET/api/v2/timestamps/absence/transactions/

Absence Transactions

Get absence balance transactions for employees within a date range, including starting balances and all transactions (absences taken, manual adjustments, rule-based accruals).

Query Parameters

  • Name
    daterange
    Type
    string
    Description

    The date range: YYYY-MM-DD|YYYY-MM-DD. Required.

  • Name
    employee_ids
    Type
    string
    Description

    Filter by employee IDs, pipe-separated.

  • Name
    missing_type
    Type
    string
    Description

    Filter by a specific absence type.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence/transactions/?daterange=2024-01-01|2024-12-31&employee_ids=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

GET/api/v2/timestamps/absence/ical/

iCal Export

Export absences as an iCalendar (.ics) file for integration with calendar applications.

First, generate a signed iCal URL:

Generate iCal URL

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence/ical-generate/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Then use the returned URL to subscribe to the calendar feed.

Was this page helpful?