Exports
The exports API allows you to generate data exports in various formats compatible with payroll and accounting systems. Exports can be generated synchronously for small datasets or asynchronously for large ones.
Overview
Exports combine time tracking data from employees, timespans, and projects into structured output files. Three exporter engines are available: Generic (flexible), Sage (accounting), and DATEV (German payroll).
Generate an Export
Generate a data export with the specified parameters.
Query Parameters
- Name
exporter- Type
- string
- Description
The exporter engine to use:
Generic,Sage,Datev, orMulti. Required.
- Name
export_format- Type
- string
- Description
Output format:
csv,json,table,plain, orxlsx. Required.
- Name
daterange- Type
- string
- Description
Date range for the export:
YYYY-MM-DD|YYYY-MM-DD. Required.
- 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.
- Name
types- Type
- string
- Description
Filter by row types, pipe-separated. Available types depend on the exporter.
- Name
columns- Type
- string
- Description
Specify columns to include, pipe-separated.
- Name
skip_zero_rows- Type
- boolean
- Description
Skip rows with zero values. Defaults to
true.
- Name
is_async- Type
- boolean
- Description
Generate the export asynchronously. Defaults to
false.
- Name
response_only- Type
- boolean
- Description
Return data as JSON instead of a file download. Defaults to
false.
- Name
filter- Type
- string
- Description
Additional filters as key-value pairs.
CSV Export
curl -X GET "https://api.zeitstrom.com/api/v2/exports/?exporter=Generic&export_format=csv&daterange=2024-06-01|2024-06-30" \
-H "Authorization: Token <YOUR_API_TOKEN>" \
-o export-june.csv
JSON Export
curl -X GET "https://api.zeitstrom.com/api/v2/exports/?exporter=Generic&export_format=json&daterange=2024-06-01|2024-06-30&response_only=true" \
-H "Authorization: Token <YOUR_API_TOKEN>"
Available Exporters
| Exporter | Description |
|---|---|
Generic | Flexible exporter with configurable columns and row types. Suitable for most integrations. |
Sage | Format compatible with Sage accounting software. |
Datev | Format compatible with DATEV payroll software (common in Germany). |
Multi | Combines multiple export configurations. |
Export Formats
| Format | Content-Type | Description |
|---|---|---|
csv | text/csv | Comma-separated values file. |
json | application/json | JSON array of objects. |
xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Excel spreadsheet. |
table | text/plain | Formatted ASCII table. |
plain | text/plain | Plain text output. |
Binary formats (xlsx) are only available when response_only is true or when downloading the file directly. When using response_only=false, use ASCII formats like csv or json.
Get Available Columns
Retrieve the list of available columns for a specific exporter.
Request
curl -X GET "https://api.zeitstrom.com/api/v2/exports/Generic/columns/" \
-H "Authorization: Token <YOUR_API_TOKEN>"
Get Row Types
Retrieve the available row types for a specific exporter.
Request
curl -X GET "https://api.zeitstrom.com/api/v2/exports/Generic/types/" \
-H "Authorization: Token <YOUR_API_TOKEN>"
Asynchronous Exports
For large datasets, set is_async=true to generate the export in the background. The API returns a task ID that you can poll via the asynchronous tasks endpoint.
Start Async Export
curl -X GET "https://api.zeitstrom.com/api/v2/exports/?exporter=Generic&export_format=xlsx&daterange=2024-01-01|2024-12-31&is_async=true" \
-H "Authorization: Token <YOUR_API_TOKEN>"
Check Task Status
curl -X GET "https://api.zeitstrom.com/api/v2/asynchronous-tasks/tasks/<TASK_ID>/" \
-H "Authorization: Token <YOUR_API_TOKEN>"