Skip to main content
This API endpoint is designed to distribute a set of jobs across specified regions or clusters.

REQUEST

jobs
array
required
Array of job ids.
regions
number
required
Number of regions/clusters to split all jobs ids into.
max
number
default:28
The maximum number of jobs per cluster.
method
string
default:"distance"
Assignment method: distance, zones, or size.

RESPONSE

status
number
Status code. 0 indicates success.
clusters
array
An array of cluster objects, each containing:
  • id (number): Unique cluster identifier
  • name (string): Cluster name (e.g., “Cluster 1”, “Cluster 2”)
  • center_lat (double): Latitude of cluster center point
  • center_lng (double): Longitude of cluster center point
  • jobs (array): Array of job IDs assigned to this cluster

Usage Notes

  • The clustering algorithm groups jobs geographically to minimize travel distance within each cluster
  • The max parameter prevents any single cluster from becoming too large
  • Empty clusters may be returned if the number of jobs is less than the requested regions
  • The algorithm uses the company location as the initial center point for all clusters