---
title: "Optimize a tour."
method: GET
path: "/tour/optimize"
tags: ["Disposition|Tour"]
---

# Optimize a tour.

`GET /tour/optimize`

This endpoint allows you to start a job to optimize a tour by providing an `id`. Upon successful request, a
`jobId` is provided in the response. geoCapture jobs are tasks that may take some time to calculate, therefore
they are executed in the background. You can to inquire about the status of the job through the
Miscellaneous|Job endpoint. After optimizing the tour, the calculation is performed automatically.

During route optimization, the system considers travel times. Additionally, it incorporates team working hours
and the duration of each order to determine the estimated arrival and departure times at each stop, as well as
the distances to and between the stops.

For optimization purposes, it can be helpful to establish parameters for the sequence that a tour should be
optimized between. For example, you may want to select a gas station to refuel your vehicle at the end of your
tour. You can retrieve the sequence of stops for a tour by accessing the `/tour/fetch_data` endpoint.

## Query parameters

- `id` integer, required
- `fromSequence` integer
- `toSequence` integer

## Response `200`

Success Response:

- StandardDispoTourOptimizeResponse
  - `jobId` integer — The id of the optimization job. (The status of the job can be queried via the job API)

---

[API](https://skmtc.net/geocapture/apis/geocapture-api.md) · [All operations](https://skmtc.net/geocapture/apis/geocapture-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/geocapture/geocapture-api/versions/869b05603541/schema)
