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).


GET/api/v2/exports/

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, or Multi. Required.

  • Name
    export_format
    Type
    string
    Description

    Output format: csv, json, table, plain, or xlsx. 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

ExporterDescription
GenericFlexible exporter with configurable columns and row types. Suitable for most integrations.
SageFormat compatible with Sage accounting software.
DatevFormat compatible with DATEV payroll software (common in Germany).
MultiCombines multiple export configurations.

Export Formats

FormatContent-TypeDescription
csvtext/csvComma-separated values file.
jsonapplication/jsonJSON array of objects.
xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetExcel spreadsheet.
tabletext/plainFormatted ASCII table.
plaintext/plainPlain text output.

GET/api/v2/exports/:exporter/columns/

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/api/v2/exports/:exporter/types/

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>"

Was this page helpful?