Workdays
A workday represents a single calendar day of work for an employee. It aggregates all timespans for that day and provides summary information like total work duration and break duration.
The Workday Object
- Name
id- Type
- string (UUID)
- Description
Unique identifier for the workday.
- Name
created_at- Type
- string (ISO 8601)
- Description
Timestamp when the workday was created.
- Name
modified_at- Type
- string (ISO 8601)
- Description
Timestamp when the workday was last modified.
- Name
workmonth_id- Type
- string (UUID)
- Description
The workmonth this workday belongs to. Read-only.
- Name
checkin- Type
- string (ISO 8601)
- Description
Earliest check-in time of the day. Read-only.
- Name
checkout- Type
- string (ISO 8601) or null
- Description
Latest check-out time of the day, or
nullif still working. Read-only.
- Name
work_duration- Type
- integer
- Description
Total working time in seconds. Read-only.
- Name
break_duration- Type
- integer
- Description
Total break time in seconds. Read-only.
- Name
note- Type
- string
- Description
Administrative note for the workday.
- Name
short_break_policy- Type
- string
- Description
The break policy applied to this workday. Read-only.
List all Workdays
Retrieve a paginated list of workdays.
Query Parameters
- Name
daterange- Type
- string
- Description
Filter by date range:
YYYY-MM-DD|YYYY-MM-DD.
- Name
token- Type
- string
- Description
Filter by employee RFID token, pipe-separated.
- Name
order- Type
- string
- Description
Sort by:
checkin,checkout,break_duration, orwork_duration.
Request
curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/workdays/?daterange=2024-06-01|2024-06-30" \
-H "Authorization: Token <YOUR_API_TOKEN>"
Response
{
"count": 22,
"next": null,
"previous": null,
"results": [
{
"id": "f6a7b8c9-d0e1-2345-fabc-678901234567",
"created_at": "2024-06-03T08:01:00Z",
"modified_at": "2024-06-03T17:02:00Z",
"workmonth_id": "a7b8c9d0-e1f2-3456-abcd-789012345678",
"checkin": "2024-06-03T08:00:00Z",
"checkout": "2024-06-03T17:00:00Z",
"work_duration": 29700,
"break_duration": 2700,
"note": "",
"short_break_policy": "auto"
}
]
}
Retrieve a Workday
Get details of a specific workday.
Request
curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/workdays/f6a7b8c9-d0e1-2345-fabc-678901234567/" \
-H "Authorization: Token <YOUR_API_TOKEN>"
Create a Workday
Create a new workday within a workmonth.
- Name
workmonth_id- Type
- string (UUID)
- Description
The workmonth to create the workday in. Required.
- Name
day- Type
- integer
- Description
The day of the month (1-31). Required.
- Name
checkin_time- Type
- string (HH:MM:SS)
- Description
The check-in time. Required.
- Name
checkout_time- Type
- string (HH:MM:SS)
- Description
The check-out time.
Request
curl -X POST "https://api.zeitstrom.com/api/v2/timestamps/workdays/" \
-H "Authorization: Token <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"workmonth_id": "a7b8c9d0-e1f2-3456-abcd-789012345678",
"day": 15,
"checkin_time": "08:00:00",
"checkout_time": "17:00:00"
}'
Update a Workday
Update a workday's note field.
Request
curl -X PATCH "https://api.zeitstrom.com/api/v2/timestamps/workdays/f6a7b8c9-d0e1-2345-fabc-678901234567/" \
-H "Authorization: Token <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"note": "Early departure approved"
}'
Delete a Workday
Delete a workday and all its associated timespans.
Request
curl -X DELETE "https://api.zeitstrom.com/api/v2/timestamps/workdays/f6a7b8c9-d0e1-2345-fabc-678901234567/" \
-H "Authorization: Token <YOUR_API_TOKEN>"
Export as CSV
Export workday data as a CSV file. Supports different export styles including workdays, timespans, and workmonths.
Request
curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/workdays/export/csv/?daterange=2024-06-01|2024-06-30" \
-H "Authorization: Token <YOUR_API_TOKEN>"