# Request creation of a new sequence Endpoint: POST /v1/tours/{tourId}/sequences Version: 1.0.0 Security: ApiKeyAuth ## Path parameters: - `tourId` (string, required) Unique tour identifier (generated by Better Route backend) ## Request fields (application/json): - `mode` (string, required) Mode which is used to create a sequence: - FIXED_OPTIMIZATION instructs that ETAs of waypoints are to be re-calculated, while the order of the waypoints is mostly kept intact (waypoint may only be moved in certain special cases, like when the time frame changes for a waypoint) - FULL_OPTIMIZATION instructs the backend to create an entirely new sequence, without attempts to maintain the previous order of waypoints - RETURN_TO_PREVIOUS_WAYPOINT_ORDER can be used to return to a previously used order of waypoints, in a situation when results of running FULL_OPTIMIZATION need to be "undone" - USE_PROVIDED instructs the backend to keep the order of the provided waypoint ids (time frames will be ignored) Enum: "FIXED_OPTIMIZATION", "FULL_OPTIMIZATION", "RETURN_TO_PREVIOUS_WAYPOINT_ORDER", "USE_PROVIDED" - `coords` (object, required) A pair of coordinates - `coords.lat` (number) Latitude - `coords.lon` (number) Longitude - `startTime` (string, required) Example: "08:00:00" - `waypointIds` (array) List of waypoints IDs representing expected order of waypoints in the generated sequence. When provided, sequence creation mode must be 'USE_PROVIDED'. - `firstWaypointId` (string) ID of the waypoint which must become first in the generated sequence. When provided, sequence creation mode must be 'FULL_OPTIMIZATION'. ## Response 200 fields (application/json): - `data` (object) Output from sequence creation - `data.sequenceId` (number) ## Response 400 fields (application/json): - `error` (object) Error response - `error.status` (integer) HTTP error status Example: 400 - `error.message` (string) Human readable error message Example: "'depot' field can't be null" - `error.errorCode` (string) Machine-friendly error message containing only alphanumeric characters and '.' Example: "tour.list.fetch.failed.bad.request" - `error.details` (array) ## Response 401 fields (application/json): - `error` (object) Error response - `error.status` (integer) HTTP error status Example: 400 - `error.message` (string) Human readable error message Example: "'depot' field can't be null" - `error.errorCode` (string) Machine-friendly error message containing only alphanumeric characters and '.' Example: "tour.list.fetch.failed.bad.request" - `error.details` (array) ## Response 404 fields (application/json): - `error` (object) Error response - `error.status` (integer) HTTP error status Example: 400 - `error.message` (string) Human readable error message Example: "'depot' field can't be null" - `error.errorCode` (string) Machine-friendly error message containing only alphanumeric characters and '.' Example: "tour.list.fetch.failed.bad.request" - `error.details` (array) ## Response 500 fields (application/json): - `error` (object) Error response - `error.status` (integer) HTTP error status Example: 400 - `error.message` (string) Human readable error message Example: "'depot' field can't be null" - `error.errorCode` (string) Machine-friendly error message containing only alphanumeric characters and '.' Example: "tour.list.fetch.failed.bad.request" - `error.details` (array)