# Tour Commander API Part of Bettermile Route API responsible for tour management Version: 1.0.0 License: Proprietary ## Servers Dev API ``` https://dev.routes.bettermile.com ``` ## Security ### ApiKeyAuth Type: apiKey In: header Name: x-api-key ## Download OpenAPI description [Tour Commander API](https://docs.bettermile.com/_bundle/products/route/apis/ntc/@1.0/tour-commander-api.yaml) ## Tour Operations on the tour level ### Request creation of a new tour - [POST /v1/tours](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/tour/createtour.md) ### Get tours for a given date, optionally narrowed down by a given assignment value - [GET /v1/tours](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/tour/gettours.md) ### Get tour by ID - [GET /v1/tours/{tourId}](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/tour/gettourbyid.md) ### Set tour destination - [PUT /v1/tours/{tourId}/destination](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/tour/settourdestination.md) ### Get potential recalculation gain for tour - [GET /v1/tours/{tourId}/potential-recalc-gain](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/tour/getpotentialrecalcgain.md): Get potential recalculation gain for tour. Recommended for tours with “fixed” and “use provided” optimization only ## Sequence Operations on the sequence level ### Request creation of a new sequence - [POST /v1/tours/{tourId}/sequences](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/sequence/createsequence.md) ### Get sequences for a given tour, ordered from newest to oldest - [GET /v1/tours/{tourId}/sequences](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/sequence/getsequences.md) ### Get latest generated sequence for a given tour - [GET /v1/tours/{tourId}/sequences/latest](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/sequence/getlatestsequence.md) ### Get a sequence by ID - [GET /v1/tours/{tourId}/sequences/{sequenceId}](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/sequence/getsequencebyid.md) ## Waypoint Operations on the waypoint level ### Pin waypoint timeframe - [PUT /v1/tours/{tourId}/waypoints/{waypointId}/time-frame](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/waypoint/pinwaypointtimeframe.md): Pins the provided timeframe to the waypoint. If the provided timeframe is NULL, the current waypoint timeframe will be removed if present. Calling this endpoint, even with the NULL timeframe, prevents the automatic timeframe resolution logic from running for the affected waypoint. ### Pin waypoint stop time - [PUT /v1/tours/{tourId}/waypoints/{waypointId}/stop-time](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/waypoint/pinwaypointstoptime.md): Pins the provided stop time value to the waypoint. Calling this endpoint "freezes" the stop time of the waypoint at provided value. ### Unpin waypoint stop time - [DELETE /v1/tours/{tourId}/waypoints/{waypointId}/stop-time](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/waypoint/unpinwaypointstoptime.md): Removes the previously pinned stop time value from the waypoint. Calling this endpoint "unfreezes" the stop time of the waypoint, allowing for the stop time value to be to dynamically calculated. ## Job Operations on the job level ### Apply changes to statuses of jobs - [POST /v1/tours/{tourId}/jobs/statuses](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/job/applyjobstatuschanges.md): Updates the status of one of more jobs, so that these changes can be reflected upon the tour instantly. This is only an auxiliary way for providing Bettermile with job updates, while the main job updates are still to be transmitted over the connector. ## Custom Job Operations on custom jobs ### Create a custom job - [POST /v1/tours/{tourId}/custom-jobs](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/custom-job/createcustomjob.md): Creates a custom job ### Deletes a custom job - [DELETE /v1/tours/{tourId}/custom-jobs/{jobId}](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/custom-job/deletecustomjob.md): Deletes a custom job ## Custom Waypoint Operations on custom waypoints ### Create a custom waypoint - [POST /v1/tours/{tourId}/custom-waypoints](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/custom-waypoint/createcustomwaypoint.md): Creates a custom waypoint by grouping provided jobs together ### Deletes a custom waypoint - [DELETE /v1/tours/{tourId}/custom-waypoints/{waypointId}](https://docs.bettermile.com/products/route/apis/ntc/tour-commander-api/custom-waypoint/deletecustomwaypoint.md): Deletes a custom waypoint, allowing the backend to regroup the jobs from this waypoint freely.