Skip to main content
POST
Create Commuting Period

Create Commuting Period

Create a new commuting period for an employee. This defines how the employee commutes during a specific date range, enabling CO2e emissions calculations.
Transport Type Rules: Different transport types require different field combinations. See the transport validation rules below.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body Parameters

string
required
UUID of the employee this period belongs toExample: "550e8400-e29b-41d4-a716-446655440000"
date
required
Period start date (YYYY-MM-DD)Example: "2024-01-01"
date
required
Period end date (YYYY-MM-DD). Must be after start_date.Example: "2024-12-31"
string
required
Type of commuteAvailable values:
  • in_itinere - Home to work commute (daily commuting)
  • in_labore - Travel during work hours
Example: "in_itinere"
string
required
Mode of transportationAvailable values: car, bus, train, metro, tram, motorbike, bicycle, walking, telecommuting, electric_kick_scooter, trolleybusExample: "car"
number
One-way distance in kilometers. Required for all transport types except telecommuting.Example: 15
array[integer]
Days of the week the employee commutes (0=Monday, 6=Sunday). Required for all transport types except telecommuting.Example: [0, 1, 2, 3, 4] (Monday to Friday)
integer
required
Number of round trips per day (usually 1)Example: 1
string
Vehicle size (required for car transport type)Available values: small, medium, largeExample: "medium"
string
Fuel type. Required for car, bus, motorbike. Optional for train, metro, bicycle, trolleybus.Available values: petrol, diesel, electric, hybrid, lpg, natural_gas, not_fuel_based, do_not_knowExample: "petrol"
string
For electric vehicles/transport - whether powered by renewable energyAvailable values: yes, no, do_not_knowExample: "yes"
boolean
required
Whether the employee carpools. Must be true or false for car, must be false for other transport types.Example: false
string
required
Period statusAvailable values: active, inactive, terminatedExample: "active"
string
required
How the commuting data was collectedAvailable values: manual, qr, formExample: "manual"

Transport Validation Rules

When providing transport fields, all related fields must be provided together:

Car

Bus

Train / Metro / Trolleybus

Motorbike

Bicycle

Walking / Tram / Electric Kick Scooter / Telecommuting

Response

string
Unique identifier (UUID)
string
Employee UUID
number
Calculated CO2 equivalent emissions in kg for the period
All other fields mirror the request body.

Example

Successful Response

Common Errors

422 Validation Error

Cause: Invalid field combinations
Solution: Ensure all required fields for the transport type are provided.

404 Not Found

Cause: Employee not found

Use Cases

Create Car Commute

Create Public Transit Commute

Create Remote Worker Period

Create Carpool Commute

Update Commuting Period

Modify period details

Delete Commuting Period

Remove a period

List Periods

View all periods

Employee Commuting Guide

Complete commuting tutorial