> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.hellotracks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign Job

> Move a job into a worker's route on a day, at a position.

Puts one job into a worker's route on a day, at the position you choose. Use it to dispatch: unlike changing the worker with [Edit Jobs](https://api-docs.hellotracks.com/api-reference/endpoint/editjobs.md), it keeps both routes in order. The job leaves the previous worker's route, which closes the gap, and the jobs after it in the new route move down by one. The saved route of both days is recalculated.

### REQUEST

```shell theme={null}
POST https://api.hellotracks.com/api/assignjob

{
	data: {
		id: "<job_id>",
		assignee: "<member_uid>",
		day: 20261102,
		index: 2,
		notify: true,
		push: true,
		webhook: true
	}
}
```

**id** `string` *required*

The job to move.

**assignee** `string` *required*

UID of the member who gets the job. An empty string takes the job off any worker.

**day** `number` (default: 0)

The day as YYYYMMDD. `0` leaves the job without a date; it is then not part of a route.

**index** `number` (default: 0)

Position in the worker's route on that day, starting at `0` for the first job. A position after the last job puts it at the end.

**notify** `boolean` (default: false)

Update open dashboards right away.

**push** `boolean` (default: false)

Update the jobs in both workers' apps.

**webhook** `boolean` (default: false)

Send the company's `job_updated` webhooks for every job that changed.

### RESPONSE

```shell theme={null}
{
	status: 0,
	jobs: [
		{ <job_1> },
		{ <job_2> },
		   ...
	]
}
```

`jobs` lists the moved job and every job of both routes, with their new positions. An unknown job id changes nothing and returns an empty list.

```bash Example Request theme={null}
curl -X POST https://api.hellotracks.com/api/assignjob \
  --header 'API-Key: YOUR_KEY_ID.YOUR_SECRET' \
  --header 'Content-Type: application/json' \
  -d '{ "data": { "id": "650000000000000000000001", "assignee": "a1b2c3", "day": 20261102, "index": 0, "notify": true, "push": true } }'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.