# Get latest generated sequence for a given tour

Endpoint: GET /v1/tours/{tourId}/sequences/latest
Version: 1.0.0
Security: ApiKeyAuth

## Security:

  - `ApiKeyAuth` (unknown)
    apiKey in header x-api-key

## Path parameters:

  - `tourId` (string, required)
    Unique tour identifier (generated by Better Route backend)

## Response 200:

  - `200` (unknown)
    Full sequence information, including open, closed and unassigned waypoints

## Response 200 fields (application/json):

  - `data` (object)
    Full information about a sequence, including open, closed and unassigned waypoints
    Example: {"sequenceId":10234,"mode":"FIXED_OPTIMIZATION","coords":{"lat":52.52,"lon":13.405},"startTime":"2026-08-03T08:00:00Z","sequenceIdWithPreviousWaypointOrder":null,"created":"2026-08-03T07:55:00Z","sequ…

  - `data.sequenceId` (number)

  - `data.mode` (string)
    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"

  - `data.coords` (object)
    A pair of coordinates

  - `data.coords.lat` (number)
    Latitude

  - `data.coords.lon` (number)
    Longitude

  - `data.startTime` (string)

  - `data.sequenceIdWithPreviousWaypointOrder` (number)

  - `data.created` (string)

  - `data.sequenceFidelity` (number)

  - `data.destination` (object)
    Destination for a tour / sequence
    Example: {"address":{"street":"Oranienstraße","streetNumber":"183","locality":"Berlin","subLocality":null,"postalCode":"10999","country":"DE","streetCoordinates":{"lat":52.4998,"lon":13.4189},"rooftopCoordinat…

  - `data.destination.address` (object)
    An address

  - `data.destination.address.street` (string)
    Street

  - `data.destination.address.streetNumber` (string)
    Street number

  - `data.destination.address.locality` (string)
    City, town, village etc

  - `data.destination.address.subLocality` (string)
    Subdivision of city, district etc

  - `data.destination.address.postalCode` (string)
    Postal/zip code

  - `data.destination.address.country` (string)
    Country as "alpha-2 code" of ISO 3166 (https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)

  - `data.destination.address.streetCoordinates` (any)

  - `data.destination.address.rooftopCoordinates` (any)

  - `data.destination.eta` (string)
    Arrival time to the destination

  - `data.openWaypoints` (array)
    Open waypoints, ordered accordingly to their place in the sequence

  - `data.openWaypoints.waypointId` (string)
    A unique identifier of this waypoint

  - `data.openWaypoints.jobIds` (array)
    List of job references as UUIDs.
Deprecated use jobIdentifiers instead

  - `data.openWaypoints.jobIdentifiers` (array)
    List of job IDs (internal and external)

  - `data.openWaypoints.jobIdentifiers.internalId` (string)
    Internal Job ID reference as UUID

  - `data.openWaypoints.jobIdentifiers.externalId` (string)
    External Job ID reference as string

  - `data.openWaypoints.status` (string)
    State of the waypoint:
- UNPROCESSED: None of the waypoint's jobs have been processed yet
- PROCESSED: All of the waypoint's jobs have been processed
- CONFIRMED: The waypoint has been processed, and this has additionally been confirmed
    Enum: "UNPROCESSED", "PROCESSED", "CONFIRMED"

  - `data.openWaypoints.closedAtTimestamp` (string)
    Time at which this waypoint was closed

  - `data.openWaypoints.stopTimeInSeconds` (number)
    How much time is planned for stopping at the waypoint and delivering / picking up parcels

  - `data.openWaypoints.timeFrame` (any)

  - `data.openWaypoints.timeFrame.earliest` (string)
    Example: 14:00:00

  - `data.openWaypoints.timeFrame.latest` (string)
    Example: 16:00:00

  - `data.openWaypoints.timeFrame.timezone` (string)
    Example: Europe/Berlin

  - `data.openWaypoints.type` (string)
    Type of the waypoint:
- GENERATED means that the waypoint was generated automatically
- CUSTOM means that the waypoint was created via Custom Waypoint API
    Enum: "GENERATED", "CUSTOM"

  - `data.openWaypoints.eta` (string)
    Estimated time of arrival at this waypoint

  - `data.openWaypoints.sequenceError` (any)
    Example: null

  - `data.closedWaypoints` (array)
    Waypoints that are already closed (i.e. all jobs are done)

  - `data.unassignedWaypoints` (array)
    Waypoints that are not part of the sequence but are still open
(e.g. waypoints that could not be added to the sequence due to unreachable timeframes)

## Response 400:

  - `400` (unknown)
    Error response returned when the request is invalid. In most cases this implies that some data in the request is either missing or has incorrect format.

## 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:

  - `401` (unknown)
    Error response returned when the provided API key is missing or invalid

## 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:

  - `404` (unknown)
    Error response returned in cases the requested endpoint or data can't be found

## 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 429:

  - `429` (unknown)
    Error response returned in case operation encounter rate limit

## Response 429 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:

  - `500` (unknown)
    Error response returned whenever the server fails to process the request

## 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)

