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": [
			{
				"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.