Create a plan
The plan id is generated by the service: sending an id in the payload is rejected with a
400. Use the id returned in the response to address the plan on the other endpoints.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The plan to create.
A full plan for a date and agency, with its associated resources, orders, constraints, ...
The corresponding plan's state.
- waiting: The plan was received and is awaiting processing.
- processing: The plan is being processed.
- preOptimizing: The plan is being optimized while awaiting traffic or other information.
- preOptimized: While still awaiting traffic or other information, one of the following events has occurred: no better solution can be produced, or the optimization period has reached its limit. Note that 'preOptimized' should be followed by 'optimizing' and 'optimized'.
- optimizing: The plan is being optimized with all required information.
- optimized: This state can be triggered by one of the following events: no better solution can be produced, or the optimization period has reached its limit.
- stopped: The plan's awaiting optimizations were canceled.
- deleted: The plan was deleted and awaiting optimizations were canceled.
- interrupted: The plan was either updated, stopped or deleted during its optimization.
waiting, processing, preOptimizing, preOptimized, optimizing, optimized, stopped, deleted, interrupted Additional operation time for a resource and a stop, according to tags (pairs of tags must be unique).
Policies to remove the operation durations, by resource tag.
If the tour has not, at each stop, one of its capacities lower than or equal to the link limit, then the tour is invalid.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
List of global constraints to be satisfied by the returned solution.
Access durations is an additional duration before the beginning of a group of stops with the same stop tag.
This field allows users to define a limit in the number of resources that are simultaneously present at stops sharing the same stop tag.
maximizeMandatoryStops, minimizeDelay, minimizeCosts, minimizeResources, minimizeOverOverlappingCapacitiesOnStops, maximizeOptionalStops, maximizePreferredStops, minimizeLargestTourDuration, minimizeWorkingDuration, minimizeDistance, minimizeEarlyLoadings A period of time, expressed in the ISO8601 duration format.
^P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?)?$"PT4M"
The time zone is a string code which identifies a region of the world in the "time zone database", also called "tz database". The tz database is a partition of the world into regions where local clocks all show the same time. This database gives the rules for time offset and daylight saving time in each region.
How do we use it?
In order to work with time events accurately, we usually use datetimes in the iso-8601 format, without explicit time zone. This format is quite well suported by many programming languages, and it is well suited for technical data exchange. But it is not easy to use for humans.
For instance, here are three datetimes in iso-8601 format, which give the same exact moment in time:
- "2025-05-22T05:43:00Z"
- "2025-05-22T06:43:00+01:00"
- "2025-05-22T07:43:00+02:00"
For a non-technical user, it is difficult to know how to relate this to the time displayed on a watch or a clock.
We improve the user experience by adding the support of local datetimes, thanks to the use of the time zone, which allows to transform a local datetime into an iso-8601 datetime:
- local datetime + timezone (tz) = iso-8601 datetime
For instance, here are five datetimes which all give the same exact moment in time:
- "2025-05-22T05:43:00Z"
- "2025-05-22T06:43:00+01:00"
- "2025-05-22T07:43:00+02:00"
- "2025-05-22 07:43:00" + timezone "tz": "Europe/Paris"
- "2025-05-22 07:43" + timezone "tz": "Europe/Paris"
Note: the last example ("2025-05-22 07:43") illustrates the support of local datetimes without seconds, which can be very practical for users.
In order for local datetimes to be supported, some JSON input objects contain a "tz" time zone property. This "tz" property is used to pre-process the JSON input payload, like this:
- We check if a valid timezone can be extracted from the "tz" property,
- If so, we perform the following actions:
- Walk through the whole JSON content to look for local datetimes,
- Use the timezone to transform each local datetime into an iso-8601 datetime.
Important: some objects contain a "properties" sub-object, which is a map of custom client data; the content of the "properties" sub-objects is always excluded from the time zone pre-processing.
"Europe/Paris"
True if lateDeparture is requested for Resources, false otherwise.
True if sharedCapacities is requested for Resources, false otherwise. It enables resources to share capacities between stops of different orders.
Thresholds for capacities below which a resource is considered "empty" for empty distance calculation, grouped by resource tag. A resource is "empty" (kilometers traveled count as empty distance) when all capacities are at or below their threshold. The wildcard tag "*" matches all resources.
Early loading declarations grouped by resource tag. The wildcard tag "*" matches all resources. Each entry identifies a stop tag and optional capacities used to compute the minimizeEarlyLoadings objective.
Optional CO2 emission calculation parameters grouped by resource tag. Each value is a Cost-shaped object.
Applies to every resource carrying the corresponding tag.
When set, the resulting emissions are reported on tours as CO2Emission and aggregated on the solution as CO2Emission.
If a resource matches multiple tags, only its first declared matching tag is used.
Overridden by the resource-level declaration.
Response
Plan response created.
A full plan for a date and agency, with its associated resources, orders, constraints, ...
The agency id.
^BLD[0-9]{7}_[a-zA-Z0-9-._~:@!$,]+$"BLD1234567_production"
The plan id.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"4cbd0ab8-282c-4b30-b981-29e1ed8a2016"
The plan version.
x >= 142

