Absence Applications

Absence applications represent employee requests for time off that go through an approval workflow. Applications can be created by employees or managers, then approved, declined, verified, or unverified. When an application is approved, a corresponding absence record is created automatically.

The Absence Application Object

  • Name
    id
    Type
    string (UUID)
    Description

    Unique identifier for the application.

  • Name
    created_at
    Type
    string (ISO 8601)
    Description

    Timestamp when the application was created.

  • Name
    modified_at
    Type
    string (ISO 8601)
    Description

    Timestamp when the application was last modified.

  • Name
    status
    Type
    string
    Description

    Current status: new, verified, approved, or declined. Read-only.

  • Name
    absence_id
    Type
    string (UUID) or null
    Description

    The ID of the created absence (set when approved). Read-only.

  • Name
    employee_id
    Type
    string (UUID)
    Description

    The employee who submitted the application. Read-only.

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

    Requested start date.

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

    Requested end date (inclusive).

  • Name
    affected_days
    Type
    decimal
    Description

    Number of working days requested.

  • Name
    missing_type
    Type
    string
    Description

    The absence type identifier.

  • Name
    target_hour_behaviour
    Type
    string
    Description

    How the absence affects target working hours.

  • Name
    comment
    Type
    string
    Description

    Employee's comment or reason.

  • Name
    attachment
    Type
    string (URL)
    Description

    URL of an attached file.

  • Name
    history
    Type
    array
    Description

    History of status changes with timestamps and actors. Read-only.


GET/api/v2/timestamps/absence-applications/

List all Applications

Retrieve a paginated list of absence applications.

Query Parameters

  • Name
    daterange
    Type
    string
    Description

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

  • Name
    employee_ids
    Type
    string
    Description

    Filter by employee IDs, pipe-separated.

  • Name
    employee_groups
    Type
    string
    Description

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

  • Name
    status
    Type
    string
    Description

    Filter by status: new, verified, approved, or declined.

  • Name
    missing_types
    Type
    string
    Description

    Filter by absence types, pipe-separated.

  • Name
    q
    Type
    string
    Description

    Search by employee name or token.

  • 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-applications/?status=new" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Response

{
  "count": 2,
  "results": [
    {
      "id": "d2e3f4a5-b6c7-8901-defa-234567890123",
      "created_at": "2024-06-01T09:00:00Z",
      "modified_at": "2024-06-01T09:00:00Z",
      "status": "new",
      "absence_id": null,
      "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "date_from": "2024-07-15",
      "date_to": "2024-07-19",
      "affected_days": 5.0,
      "missing_type": "holiday",
      "target_hour_behaviour": "reduce",
      "comment": "Family vacation",
      "attachment": null,
      "history": []
    }
  ]
}

POST/api/v2/timestamps/absence-applications/

Create an Application

Submit a new absence application.

  • Name
    employee_id
    Type
    string (UUID)
    Description

    The employee to create the application for. Required.

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

    Requested start date. Required.

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

    Requested end date. Required.

  • Name
    missing_type
    Type
    string
    Description

    The absence type. Required.

  • Name
    target_hour_behaviour
    Type
    string
    Description

    How target hours are affected. Required.

  • Name
    affected_days
    Type
    decimal
    Description

    Number of working days. Auto-calculated if omitted.

  • Name
    comment
    Type
    string
    Description

    Reason or description.

Request

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

POST/api/v2/timestamps/absence-applications/:id/grant/

Approve an Application

Approve an absence application. This creates a corresponding absence record and sends an email notification to the employee.

  • Name
    manager_comment
    Type
    string
    Description

    Optional comment from the approving manager.

Request

curl -X POST "https://api.zeitstrom.com/api/v2/timestamps/absence-applications/d2e3f4a5-b6c7-8901-defa-234567890123/grant/" \
  -H "Authorization: Token <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "manager_comment": "Approved. Enjoy your vacation!"
  }'

Returns HTTP 204 No Content on success.


POST/api/v2/timestamps/absence-applications/:id/decline/

Decline an Application

Decline an absence application. An email notification is sent to the employee.

  • Name
    manager_comment
    Type
    string
    Description

    Reason for declining.

Request

curl -X POST "https://api.zeitstrom.com/api/v2/timestamps/absence-applications/d2e3f4a5-b6c7-8901-defa-234567890123/decline/" \
  -H "Authorization: Token <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "manager_comment": "This period conflicts with a team deadline. Please choose different dates."
  }'

POST/api/v2/timestamps/absence-applications/:id/verify/

Verify an Application

Mark an application as verified, indicating it has been reviewed but not yet approved.

Request

curl -X POST "https://api.zeitstrom.com/api/v2/timestamps/absence-applications/d2e3f4a5-b6c7-8901-defa-234567890123/verify/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

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

Delete an Application

Delete an absence application.

Request

curl -X DELETE "https://api.zeitstrom.com/api/v2/timestamps/absence-applications/d2e3f4a5-b6c7-8901-defa-234567890123/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Was this page helpful?