Upsert Routes Ep
POST/v1/route/upsert_many
Upsert Many Routes
This endpoint allows for the creation or update (upsert) of a route. If the route does not exist the corresponding locations (site, terminals, depots) must exist in order to create the route. By default routes use google's map api to calculate distance. If this integration is being used to completely use another api then the api_ fields should be used. Overriding the api is a permanent change and cannot be undone by a user. Otherwise the override_ fields should be use to set an override which a user can remove to fall back to the default api.
Request
origin_name: str
Name of the location where the route originates. See location/all for a list of locations.
destination_name: str
Name of the location where the route ends. See location/all for a list of locations.
api_distance_miles: float | None = None
Sets the default distance in miles for the route. Should only be used to override the system defaults.
api_travel_time_seconds: int | None = None
Sets the default duration in seconds for the route. Should only be used to override the system defaults.
override_travel_time_seconds: int | None = None
Sets an override duration in seconds for the route. Can be modified or removed by a user inside the application.
override_distance_miles: float | None = None
Sets an override distance in miles for the route. Can be modified or removed by a user inside the application.
override_pyroll_miles: int | None_ = None
Sets an override distance in miles for the route that will only affect a driver's deemed miles for payroll.
Can be modified or removed by a user inside the application.
Response
errors: list[dict]
A list of errors that occurred during the upsert process.
updated: int
The number of routes that were successfully updated.
Responses
- 200
- 422
Successful Response
Validation Error
- application/json
- Example (from schema)
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}