> ## 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.

# Get Jobs

> This endpoint retrieves jobs.

### Request

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

{
	data: {
	    id: "<id>",
        ids: [ "<id1>", "<id2>", "<idn>" ],
		day: 20231105,
		worker: "<worker-username>",
		team: <number> (optional),
		orderId: <number> (optional),
		orderIds: [<number1>,<number2>,...] (optional array of multiple orderIds),
		progressSuccess: 1 (optional),
		progressActive: 1 (optional),
		includeArchived: 1 (optional),
		compact: true (optional),
		sort: {
			field: "<field_name>",
			ascending: true/false,
			limit: <number>,
			skip: <number>,
			from: <timestamp>,
			until: <timestamp>,
			status: <number> (optional)
		} (optional)
	}
}
```

<ParamField body="id" type="string">
  Set this if you want to retrieve a specific job.
</ParamField>

<ParamField body="ids" type="array">
  Use this field to retrieve multiple specific jobs.
</ParamField>

<ParamField body="day" type="number">
  `day` is optional and defaults to today. To retrieve jobs with no date assigned, set `day:0`.
  To specifically ignore the `day` field, set `day:-1`.
</ParamField>

<ParamField body="worker" type="string">
  To retrieve jobs that are not assigned to a worker, set `worker:""`. To request jobs assigned to any worker, set `worker:"+"`. To request all jobs, assigned and unassigned, for a specific date, set `worker:"*"`.
</ParamField>

<ParamField body="team" type="number">
  `team` is an optional filter to only request jobs for a specific team.
</ParamField>

<ParamField body="orderId" type="number">
  Optional filter to request a specific job.
</ParamField>

<ParamField body="orderIds" type="array">
  Optional filter to request multiple specific jobs.
</ParamField>

<ParamField body="progressSuccess" type="number" default={0}>
  `progressSuccess` is an optional filter to only retrieve jobs that are marked as successfully completed. For this, set the value to `1`, else set it either to `0` or do not set the field at all.
</ParamField>

<ParamField body="progressActive" type="number" default={0}>
  `progressActive` is an optional filter to only retrieve jobs that are not marked as completed (neither success nor issue). For this, set the value to `1`, else set it either to `0` or do not set the field at all.
</ParamField>

<ParamField body="includeArchived" type="number" default={0}>
  Set to `1` to include archived jobs in the results. Defaults to `0` (exclude archived jobs).
</ParamField>

<ParamField body="compact" type="boolean" default={false}>
  If set to `true`, returns jobs in compact format (less verbose response). Defaults to `false` for legacy requests.
</ParamField>

<ParamField body="sort" type="object">
  Optional sorting and pagination configuration object with the following properties:

  * `field` (string): Field name to sort by (e.g., "tsCreated", "priority", "number")
  * `ascending` (boolean): Sort direction - true for ascending, false for descending
  * `limit` (number): Maximum number of jobs to return
  * `skip` (number): Number of jobs to skip (for pagination)
  * `from` (long): Filter jobs from this timestamp (milliseconds)
  * `until` (long): Filter jobs until this timestamp (milliseconds)
  * `status` (number): Optional status filter (-1 for all)

  When `sort` is provided, the `day` parameter defaults to undefined (all days) unless explicitly specified.
</ParamField>

### RESPONSE

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

<RequestExample>
  ```bash Example Request theme={null}
  curl -X POST https://api.hellotracks.com/api/getjobs --header 'API-Key: ...' -d '
  {
      "data": {
          "worker":"*",
          "day": "20230813"
      }
  }
  '
  ```
</RequestExample>

<Snippet file="jobs-response.mdx" />
