Dispatch and Routing
Distribute Jobs
You can distribute multiple jobs, e.g. 100 jobs, into a few regions/clusters, e.g. 10 clusters.
This API endpoint is designed to distribute a set of jobs across specified regions or clusters.
REQUEST
POST https://api.hellotracks.com/api/distributejobs
{
data: {
jobs: [
"<job_id_1>",
"<job_id_2>",
...
"<job_id_n>"
],
regions: 5,
max: 10,
method: "distance",
}
}
jobs
array
requiredArray of job ids.
regions
number
requiredNumber of regions/clusters to split all jobs ids into.
max
number
default: 28The maximum number of jobs per cluster.
method
string
default: "distance"Assignment method: distance
, zones
, or size
.
RESPONSE
{
"status": 0,
"clusters": [
{
"center_lat": <latitude>,
"center_lng": <longitude>,
"jobs" ["<job_id>",...,""<job_id>""],
"method": <String> (optional), // one of "distance", "zones", "size"
},
...
{ ... }
]
}
clusters
array
An array of clusters, each containing center coordinates (latitude and longitude), assigned job IDs, and the distribution method used.