This API endpoint allows for the automated assignment of a set of jobs to a specified group of workers.

REQUEST

Initiate a POST request to auto-assign jobs based on specified criteria.

POST https://api.hellotracks.com/api/autoassign

{
	"data": {
		"jobs":  [ "<job_id_1>", "<job_id_2>" , "<job_id_n>" ],
		"workers": [ "<username_1>", "<username_2>" , "<username_n>" ],
		"method": <String> (optional),
		"pickupCapacity": <Int> (optional),
		"dropoffCapacity": <Int> (optional),
		"day": <Int> (optional) // format YYYYMMDD e.g. 20210701
	}
}
jobs
array
required

Array of job IDs to be assigned.

workers
array
required

Array of worker usernames for job assignment.

method
string
default: "distance"

Assignment method: distance, zones, or size.

pickupCapacity
integer

Pickup capacity constraint for assignment.

dropoffCapacity
integer

Dropoff capacity constraint for assignment.

day
integer
default: 0

The specific day for assignment, format YYYYMMDD. Defaults to today (=0).

RESPONSE

Response detailing the assignment status of the jobs.

{
	"status": 0,
	"assignedJobs": [ "<job_id_1>", "<job_id_2>" ],
	"unassignedJobs": [ "<job_id_1>", "<job_id_2>" ],
	"jobs": [
		{ <job_1> },
		{ <job_2> },
		   ...
		{ <job_n> }
	]
}
assignedJobs
array

List of job IDs that were successfully assigned.

unassignedJobs
array

List of job IDs that could not be assigned.

jobs
array

A comprehensive list of all jobs considered during the assignment process.