Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
  • Platform
Try models
  • Employee Shift Scheduling
  • User guide
  • Using the API
  • API tooling

Employee Shift Scheduling

    • Introduction
    • Getting started: Hello world
    • User guide
      • Terminology
      • Use case guide
      • Scheduling API concepts
      • Integration
      • Constraints
      • Using the API
        • Using the OpenAPI spec
        • API tooling
      • Demo datasets
      • Input datasets
        • Model configuration
        • Model input
        • Planning window
      • Planning window
      • Time zones and Daylight Saving Time (DST)
      • Tags and tag types
      • Input validation
      • Output datasets
        • Metadata
        • Model output
        • Input metrics
        • Key performance indicators (KPIs)
      • Metrics and optimization goals
      • Score analysis
      • Visualizations
    • Employee resource constraints
      • Employee availability and preferences
        • Employee availability
        • Employee preferences
      • Employee contracts
      • Employee priority
      • Pairing employees
      • Shift travel and locations
      • Shift Breaks
      • Employee activation
      • Work limits
        • Minutes worked per period
        • Minutes worked in a rolling window
        • Minutes logged per period
        • Days worked per period
        • Days worked in a rolling window
        • Consecutive days worked
        • Shifts worked per period
        • Shifts worked in a rolling window
        • Weekend minutes worked per period
        • Weekends worked per period
        • Weekends worked in a rolling window
        • Consecutive weekends worked
        • Consecutive shifts worked
      • Time off
        • Days off per period
        • Consecutive days off per period
        • Consecutive days off in a rolling window
        • Consecutive minutes off in a rolling window
        • Shifts to avoid close to day off requests
        • Consecutive weekends off per period
      • Shift rotations and patterns
        • Shift rotations
        • Single day shift sequence patterns
        • Minimize gaps between shifts
        • Multi-day shift sequence patterns
        • Daily shift pairings
        • Overlapping shifts
        • Shift start times differences
        • Minutes between shifts
      • Shift type diversity
        • Shift tag types
        • Shift types worked per period
        • Unique tags per period
      • Fairness
        • Balance time worked
        • Balance shift count
    • Shift service constraints
      • Alternative shifts
      • Cost management
        • Cost groups
        • Employee rates
      • Demand-based scheduling
      • Mandatory and optional shifts
      • Skills and risk factors
      • Shift assignments
        • Shift selection
        • Employee selection
    • Manual intervention
    • Recommendations
    • Real-time planning
    • Real-time planning with patches
    • Scenarios
      • Configuring labor law compliance
      • Configuring employee well-being
      • Self-rostering and optimization
    • Changelog
    • Upgrade to the latest version
    • Feature requests

API tooling

Overview

The Employee Shift Scheduling API follows the OpenAPI specification, which makes it compatible with a wide range of developer tooling. Refer to Using the OpenAPI spec to learn how to access the spec.

Use a code generation tool when you need a typed client library in a specific programming language. Use Postman or Bruno when you want to explore and test the API interactively without writing code.

Generating a code client

Not all generator options and language combinations are verified against the Employee Shift Scheduling spec. Timefold provides support for client generation on a best-effort basis.

You can use any OpenAPI-compatible code generation tool to generate an API client in the language of your choice, including Java, Python, TypeScript, and many others. Because client generation is supported for a wide range of languages through these tools, Timefold doesn’t maintain a dedicated API client library.

Using OpenAPI Generator

OpenAPI Generator is a popular option that supports many target languages and libraries.

Download the raw OpenAPI spec and pass it to the generator tool along with the target language and library.

Via CLI / Docker

The OpenAPI Generator CLI can be run as a standalone tool or as a Docker container without a local installation.

docker run --pull always --rm --user $(id -u) \
  -v "${PWD}:/local" \
  openapitools/openapi-generator-cli generate \
  -i /local/openapi.json \
  -g java \
  -o /local/out/java
  • The -i flag specifies the input spec.

  • -g specifies the target generator (language).

  • -o specifies the output directory.

  • The spec file and output directory are mounted from the current directory via -v.

  • --pull always ensures you use the latest image.

  • --user $(id -u) ensures generated files are owned by the current user.

Java generator configuration

When generating a Java client, specific configuration is required because of how the spec models GeoJSON geometry types. This configuration applies regardless of which mode you use to run the generator.

Prerequisites

Version 7.22.0 introduced the REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING normalizer option that is required for correct code generation.

Required configuration

Set the REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING normalizer option to true.

Without this option, the generated Java code may fail to compile due to name clashes on the coordinates field across the Point, Polygon, and MultiPolygon types.

Via CLI / Docker
docker run --pull always --rm --user $(id -u) \
  -v "${PWD}:/local" \
  openapitools/openapi-generator-cli generate \
  -i /local/openapi.json \
  -g java \
  --openapi-normalizer REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING=true \
  --library apache-httpclient \
  -o /local/out/java
Workarounds to avoid

Don’t remove allOf references from subtypes as a workaround for compilation errors. Removing these references breaks polymorphism in the generated client code. Specifically, it prevents adding Polygon instances into Vehicle.requiredArea and FixedBreak instances into VehicleShift.requiredBreaks. Use the normalizer option described above instead.

Postman

Postman is a widely used API client for exploring, testing, and sharing API requests through a graphical interface. Importing the OpenAPI spec generates a ready-to-use collection of all endpoints, so you can start making calls without writing any code.

See the Postman OpenAPI documentation for instructions on how to import the spec.

Bruno

Bruno is an offline-first API client that stores collections as plain-text files. Because collections live on disk, they can be committed to Git alongside your code, making it easy to version-control your API requests and collaborate with teammates.

See the Bruno OpenAPI converter documentation for instructions on how to import the spec.

Next

  • Using the OpenAPI spec

  • Integration

  • © 2026 Timefold BV
  • Timefold.ai
  • Documentation
  • Changelog
  • Send feedback
  • Privacy
  • Legal
    • Light mode
    • Dark mode
    • System default