Skip to main content
POST
Create or Update Route
A Route object represents a planned sequence of stops for a vehicle or delivery agent. The core of the Route is the stops array, which lists the specific locations to visit in order. Each stop within this array details:
  • The actions to be performed (like stopType).
  • Associated items (objectIds).
  • Timing estimates (arrivalTime, departTime, serviceTime).
  • Travel details from the prior stop (distanceFromPrevious, durationFromPrevious).
  • The physical coordinates (location).
This endpoint allows you to create a new route or update an existing one by providing route configuration and stop details.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Input for creating or updating a route.

externalId
string | null

Route ID. If provided, the route will be updated. If not provided, a new route will be created.

Example:

"rte_JphRWDiEosGpXuxwgaYfY3"

name
string | null

Name of the route.

Example:

"Route 1"

stops
RouteStopInputSerializer · object[] | null

Complete route stops structure with timing, location, and stop types. Supports all stop types including PICKUP, DROPOFF, ROUTE_START, ROUTE_END, and DRIVER_BREAK.

Example:
routeMetadata
Routemetadata · object | null

Additional metadata for the route.

Example:
vehicleId
string | null

Vehicle ID (or external ID) to assign to this route.

Example:

"veh_4hL8pXq2sVn6RtY3wCbD9M"

courierId
string | null

Courier/Driver ID (or external ID) to assign to this route.

Example:

"cor_9dK2mNp7xVt3RfWzY8sLbQ"

driverGroupId
string | null

Driver group/Contract ID (or external ID) to assign to this route. Required when assigning a courier or vehicle.

Example:

"cntr_7mP3xVt9Nk8sRfWzY2hLbQ"

autoDispatch
boolean
default:false

If true, dispatch the route to providers in the same request after upsert. Default: false.

Response

OK

Response for route upsert operation.

route
RouteSerializer · object
required

The created or updated route.