REST DocumentationBest Practices

Best Practices

Fewer requests, faster syncs, no 429. Six habits that save the most, each with a copy-and-paste example.

Fetch large pages

Without limit, a list returns only 15 results per page, so a long list needs many requests.

Do this instead: send limit=200, the maximum. A value of 201 or more is rejected with 422.

curl 'https://www.zep-online.de/zepinstanz/next/api/v1/attendances?limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

Saves roughly 93 % of the requests for a long list (1 instead of 14 for 200 entries).

Incremental sync

For a sync that fetches only what changed, see Incremental sync for the modified_after watermark, id_after, id[] and what such a sync does not detect.

Narrow the date range

A range such as 2000 to 2026 makes the server read and send years of data you do not need.

Do this instead: send start_date and end_date (YYYY-MM-DD) for the period you really need.

curl 'https://www.zep-online.de/zepinstanz/next/api/v1/attendances?start_date=2026-10-01&end_date=2026-10-31&limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

Saves roughly the share of years you cut: one month instead of 26 years is about 99.7 % less data.

Respect the rate limits

Beyond the limits, the API answers with 429 and your sync stops.

Do this instead: read X-RateLimit-Remaining to see your budget, and on 429 wait for the seconds in Retry-After before you retry. Limits and headers are described under Authentication.

curl -i 'https://www.zep-online.de/zepinstanz/next/api/v1/projects?limit=1' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

Saves roughly every retry that would be rejected anyway: waiting once is cheaper than hammering.

Filter flat instead of looping over parents

One request per project, employee, receipt or invoice multiplies your request count by the number of parents. A tenant may send 1000 requests per 5 minutes, shared by all its tokens (see Rate Limiting), so a loop over a few thousand parents uses up several windows and your sync waits.

Do this instead: read the flat list once with limit=200 and group the rows by their parent id, for example project_id. Every row carries that id. If you only need some parents, filter by their ids.

Project assignments

Good: one request per project, GET /projects/{id}/employees, or per employee, GET /employees/{username}/projects.

Better: one flat list for all projects. /project-employees returns the same rows with the same fields.

curl 'https://www.zep-online.de/zepinstanz/next/api/v1/project-employees?limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

For a tenant with 1,650 projects and 16,000 assignments: 80 pages instead of 1,650 calls.

For some projects or one employee, send project_id or employee_id (the username), once or as a list. curl needs -g for the brackets:

curl -g 'https://www.zep-online.de/zepinstanz/next/api/v1/project-employees?project_id[]=2&project_id[]=3&limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'
curl 'https://www.zep-online.de/zepinstanz/next/api/v1/project-employees?employee_id=jdoe&limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

/project-employees has no modified_after, but every created, changed or deleted assignment updates the project’s modified (see Incremental sync). After the first full load, ask /projects?modified_after=… and reload the assignments only for the projects it returns:

curl 'https://www.zep-online.de/zepinstanz/next/api/v1/projects?modified_after=2026-10-27T15:57:15.000000Z&limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

Detail calls after the list

Good: list /projects, then GET /projects/{id} for every row. The same with /customers and /employees.

Better: use the rows of the list. They have the same fields as the detail, except:

  • /projects/{id} adds priceTables.
  • /customers/{customer_number} adds addresses, managers and priceTables. The list has counts instead, for example addresses_count, contacts_count and managers_count.
  • /employees/{username} adds absences_count. The list takes the same include as the detail.

Call the detail only for the rows where you need these fields. For 1,650 projects: 9 pages instead of 1,659 calls.

Receipt amounts

Good: GET /receipts/{id}/amounts for every receipt.

Better: /receipts-amounts, filtered by receipt_id or employee_id if you need only part of them. An amount has no modified of its own: a created or changed amount updates the modified of its receipt. So send the watermark of your /receipts sync as modified_after:

curl 'https://www.zep-online.de/zepinstanz/next/api/v1/receipts-amounts?modified_after=2026-10-27T15:57:15.000000Z&limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

Invoice items

Good: GET /invoices/{invoice_number}/items for every invoice, or GET /projects/{id}/invoice-items for every project.

Better: /invoice-items once. Every item carries invoice_number and project_id. For some projects, send project_id once or as a list; planned_from and planned_to narrow by planned date. There is no modified_after and no filter by invoice.

curl 'https://www.zep-online.de/zepinstanz/next/api/v1/invoice-items?project_id=2&limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

Absences

Good: GET /employees/{username}/absences for every employee.

Better: /absences with modified_after, for all employees at once, or with employee_id (the username) for one. The flat list also contains absenceReason and leaveApprovalApplication, which the per-employee list leaves out.

curl 'https://www.zep-online.de/zepinstanz/next/api/v1/absences?modified_after=2026-10-27T15:57:15.000000Z&limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

Employment periods, regular working times, internal rates

Good: three requests per employee: /employees/{username}/employment-periods, /employees/{username}/regular-working-times, /employees/{username}/internal-rates.

Better: include on the employee list puts all three into every employee, complete and not paged. internal_rates is not available with a ZEP Clock licence.

curl 'https://www.zep-online.de/zepinstanz/next/api/v1/employees?include=employment_periods,regular_working_times,internal_rates&modified_after=2026-10-27T15:57:15.000000Z&limit=200' -H 'Authorization: Bearer {token}' -H 'Accept: application/json'

For 700 employees: 4 pages instead of 2,100 calls.

Overview

Per parentFlatFiltersmodified_after
/projects/{id}/employees/project-employeesproject_id, employee_id (one or a list), project_status, project_start_date, project_end_dateno, narrow with /projects?modified_after
/employees/{username}/projects/project-employees?employee_id={username}as aboveno, narrow with /projects?modified_after
/receipts/{id}/amounts/receipts-amountsreceipt_id, employee_id, date_from, date_toyes, watermark from /receipts
/invoices/{invoice_number}/items/invoice-itemsproject_id, id, status (one or a list), planned_from, planned_tono
/projects/{id}/invoice-items/invoice-items?project_id={id}as aboveno
/employees/{username}/absences/absences?employee_id={username}employee_id, start_date, end_dateyes
/employees/{username}/employment-periods, /regular-working-times, /internal-rates/employees?include=…personal_number, employed, employed_onyes
/projects/{id}, /customers/{customer_number}, /employees/{username} after the list/projects, /customers, /employeessee Filteryes

Data that exists only per parent

There is no flat list for these. The cheapest way to read them:

  • Tasks: /projects/{id}/tasks?modified_after=…&limit=200. Skip projects whose tasks_count on /projects is 0. For task master data, ask only the projects that /projects?modified_after returns; booked hours change only the task’s own modified, so they need the call per project.
  • Task employees: call /projects/{id}/tasks/{task_id}/employees only for tasks with all_project_employees: false. With true the list is always empty, and every employee from /project-employees?project_id={id} may book. This skips one request per task, up to 12,800 for a tenant with 12,800 tasks.
  • Project activities: /projects/{id}/activities only for projects whose activities_count is above 0, and after the first load only for those that /projects?modified_after returns.
  • Price tables: /projects/{id}/price-tables and /customers/{customer_number}/price-tables. The detail /projects/{id} already contains them as priceTables (the same list as /projects/{id}/price-tables?fallback=true), so do not call both.
  • Customer contacts: /customers/{customer_number}/contacts only for customers whose contacts_count on /customers is above 0.
  • Offer items: /offers/{id}/items, one request per offer. /offers has no item count and no modified_after.
  • Receipt attachments: /receipts/{id}/attachments only for receipts with a filename. Without one, the receipt has no file.

In the examples above, the per-parent way adds up to 5,409 calls for project assignments, project details and the three employee lists, more than five windows of the rate limit. The flat way needs 93, a tenth of one window.

Saves roughly one request per parent object you no longer loop over: 80 instead of 1,650 for the project assignments of the example tenant, about 95 %.

Generated clients

You do not have to write the HTTP code yourself: generate a client from the OpenAPI specification. Our CI generates and compiles a Java client from the specification on every change.