Skip to main content
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
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": 0,
	"clusters": [
			{
				"id": <number>,
				"name": "Cluster 1",
				"center_lat": <latitude>,
				"center_lng": <longitude>,
				"jobs": ["<job_id>",...,"<job_id>"]
			},
			...
			{ ... }
	]
}
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
I