Generic Reporting API

The Generic Reporting API enables organizations to create fully customized data exports for manual review or automated import into payroll systems. It provides a flexible query-based approach where you specify row types, columns, filters, and output formats to generate exactly the data you need.

Overview

Unlike the fixed report endpoints, the Generic Reporting API lets you compose exports dynamically by combining three core concepts:

  • Types — Define what data to export (each type generates a row per employee). Examples: credit-time, debit-time, absence-vacation.
  • Columns — Define which fields appear in each row. Examples: first-name, last-name, accounting-number, value.
  • Date Range — The time period the export covers.

The result is a table where each row represents one type per employee, and each column contains the requested field value.


GET/api/v2/exports/generic/

Generate an Export

Generate a customized data export with the Generic exporter.

Query Parameters

  • Name
    daterange
    Type
    string
    Description

    The date range for the export, pipe-separated: YYYY-MM-DD|YYYY-MM-DD.

  • Name
    types
    Type
    string
    Description

    Row types to include, pipe-separated. Each type generates one row per employee. Use the discovery endpoint to see all available types.

  • Name
    columns
    Type
    string
    Description

    Columns to include in the output, pipe-separated. Use the discovery endpoint to see all available columns.

  • Name
    export_format
    Type
    string
    Description

    Output format: table, csv, json, or xlsx. Defaults to table.

  • Name
    filter
    Type
    string
    Description

    Filter employees or departments. Can be specified multiple times. See Filtering.

  • Name
    skip_zero_rows
    Type
    boolean
    Description

    Whether to omit rows with a zero value. Defaults to true.

  • Name
    response_only
    Type
    string
    Description

    Set to 1 to return the export as a direct download rather than a wrapped response.

Basic Export

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/?daterange=2024-09-01|2024-09-30&types=credit-time&columns=first-name|last-name|value&export_format=json" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Response

[
  {
    "first-name": "Max",
    "last-name": "Mustermann",
    "value": 576000
  },
  {
    "first-name": "Erika",
    "last-name": "Musterfrau",
    "value": 547200
  }
]

Multiple Types

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/?daterange=2024-09-01|2024-09-30&types=credit-time:hours|debit-time:hours&columns=first-name|last-name|accounting-number|value&export_format=csv" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Column Customization

Columns support several advanced features for formatting, renaming, and combining values.

Header Renaming

Rename any column header in the output using the > operator:

first-name>Vorname

This outputs the first-name column but labels it "Vorname" in the header row.

Renamed Headers

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/?daterange=2024-09-01|2024-09-30&types=credit-time:hours&columns=first-name>Vorname|last-name>Nachname|value>Stunden&export_format=csv" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Column Parameters

Some columns accept parameters using the : separator:

credit-time:hours

This tells the credit-time type to return its value in hours instead of seconds.

Modifiers

Apply string modifiers to transform column values using the :m/ syntax:

accounting-number:m/rfill/8/0

This right-fills the accounting-number value with zeros to a total length of 8 characters.

Use the modifiers discovery endpoint to see all available modifiers.

Column Concatenation

Combine multiple columns into a single output column using the ^ operator:

first-name^static: ^last-name>Full Name

This concatenates first-name, a literal space (via static: ), and last-name into a single column labeled "Full Name".

Concatenated Columns

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/?daterange=2024-09-01|2024-09-30&types=credit-time:hours&columns=first-name^static: ^last-name>Name|accounting-number:m/rfill/8/0>Lohnart|value>Stunden&export_format=csv" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Row Types and Salary Classes

Row Types

Each type represents a category of data to export. When you specify multiple types separated by pipes, the export generates one row per type per employee:

types=credit-time:hours|debit-time:hours|absence-vacation:hours

This produces up to three rows per employee — one for each type that has data.

Salary Classes (Lohnarten)

You can assign salary class identifiers to row types using the > operator on the type. This populates the key column:

types=credit-time:hours>S|debit-time:hours>H

Here, credit-time rows get key "S" and debit-time rows get "H". This is useful for payroll integrations that require salary class codes.

With Salary Classes

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/?daterange=2024-09-01|2024-09-30&types=credit-time:hours>100|debit-time:hours>200|absence-vacation:hours>300&columns=staff-number|key|value&export_format=csv" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Filtering

Use the filter query parameter to restrict the export to specific employees or departments. The parameter can be specified multiple times to combine filters.

Filter by Employee

filter=employee_ids=508d5250-7399-4b65-a574-3da53d9ddc25

Filter by Department

filter=employee_group_ids=ab5abc73-33ce-4da1-a900-d743d0bbc3e8

Filter by Custom Field

filter=custom-field:role=non_manager_report

Combining Filters

Multiple filter parameters are combined:

Combined Filters

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/?daterange=2024-09-01|2024-09-30&types=credit-time:hours&columns=first-name|last-name|value&filter=employee_group_ids=ab5abc73-33ce-4da1-a900-d743d0bbc3e8&filter=custom-field:role=non_manager_report&export_format=json" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Use the filters discovery endpoint to see all available filter options.


CSV Format Options

The CSV export format supports additional configuration via the export_format parameter.

Custom Delimiter

Change the CSV delimiter by specifying it URL-encoded after csv:delimiter>:

export_format=csv:delimiter>%3b

This uses a semicolon (;) instead of the default comma.

Disable Header Row

Suppress the header row in CSV output:

export_format=csv:writeheader>false

Combined Options

CSV with Semicolons and No Header

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/?daterange=2024-09-01|2024-09-30&types=credit-time:hours&columns=staff-number|value&export_format=csv:delimiter>%3b:writeheader>false" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

GET/api/v2/exports/multi/

Multi-Export

The Multi-Export endpoint combines multiple export configurations into a single request. Pass a JSON array of export configurations via the config parameter.

Each configuration object in the array contains the same parameters as a standard generic export (daterange, types, columns, etc.).

Multi-Export Request

curl -X GET "https://api.zeitstrom.com/api/v2/exports/multi/?config=[{\"daterange\":\"2024-09-01|2024-09-30\",\"types\":\"credit-time:hours\",\"columns\":\"staff-number|value\"},{\"daterange\":\"2024-09-01|2024-09-30\",\"types\":\"debit-time:hours\",\"columns\":\"staff-number|value\"}]&export_format=xlsx" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Discovery Endpoints

The Generic Reporting API provides several discovery endpoints to inspect available types, columns, filters, and modifiers.

List Available Types

Returns all row types available for the Generic exporter.

Request

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

List Available Columns

Returns all columns available for the Generic exporter.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/columns/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

List Available Filters

Returns all filter options available for the Generic exporter.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/filters/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

List Available Modifiers

Returns all value modifiers that can be applied to columns.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/exports/generic/modifiers/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Access Control

Exports respect the permissions of the authenticated user. Department leaders only see data for employees in their departments. The set of accessible records determines the scope of the export.

Was this page helpful?