---
title: "Retrieves an existing job by Id."
method: GET
path: "/routing/jobs/{jobId}"
---

# Retrieves an existing job by Id.

`GET /routing/jobs/{jobId}`

## Request

- Base URL: `{endpoint}`
- URL: `{endpoint}/routing/jobs/{jobId}`
- Auth: OAuth 2
  - Authorization code: `https://login.microsoftonline.com/common/oauth2/authorize`
  - Token URL: `https://login.microsoftonline.com/common/oauth2/token` scopes: `https://communication.azure.com/.default`

Retrieves an existing job by Id.

## Path parameters

- `jobId` string, required

## Query parameters

- `api-version` string, required

## Response `200`

The request has succeeded.

- RouterJob: A unit of work to be routed
  - `etag` string, required: The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource. It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed. It is a string of ASCII characters placed between double quotes, like "675af34563dc-tr34".
  - `id` string, required: Id of a job.
  - `channelReference` string: Reference to an external parent context, eg. call ID.
  - `status` 'pendingClassification' | 'queued' | 'assigned' | 'completed' | 'closed' | 'cancelled' | 'classificationFailed' | 'created' | 'pendingSchedule' | 'scheduled' | 'scheduleFailed' | 'waitingForActivation': Describes the various status of a job.
  - `enqueuedAt` string, date-time: Timestamp a job was queued in UTC.
  - `channelId` string: The channel identifier. eg. voice, chat, etc.
  - `classificationPolicyId` string: Id of a classification policy used for classifying this job.
  - `queueId` string: Id of a queue that this job is queued to.
  - `priority` integer: Priority of this job. Value must be between -100 to 100.
  - `dispositionCode` string: Reason code for cancelled or closed jobs.
  - `requestedWorkerSelectors` RouterWorkerSelector[]: A collection of manually specified worker selectors, which a worker must satisfy in order to process this job.
    - `key` string, required: The label key to query against.
    - `labelOperator` 'equal' | 'notEqual' | 'lessThan' | 'lessThanOrEqual' | 'greaterThan' | 'greaterThanOrEqual', required: Describes supported operations on label values.
    - `value` unknown
    - `expiresAfterSeconds` number, double: Describes how long this label selector is valid in seconds.
    - `expedite` boolean: Pushes a job to the front of the queue as long as this selector is active.
    - `status` 'active' | 'expired': Describes the status of a worker selector.
    - `expiresAt` string, date-time: The time at which this worker selector expires in UTC.
  - `attachedWorkerSelectors` RouterWorkerSelector[]: A collection of worker selectors attached by a classification policy, which a worker must satisfy in order to process this job.
    - `key` string, required: The label key to query against.
    - `labelOperator` 'equal' | 'notEqual' | 'lessThan' | 'lessThanOrEqual' | 'greaterThan' | 'greaterThanOrEqual', required: Describes supported operations on label values.
    - `value` unknown
    - `expiresAfterSeconds` number, double: Describes how long this label selector is valid in seconds.
    - `expedite` boolean: Pushes a job to the front of the queue as long as this selector is active.
    - `status` 'active' | 'expired': Describes the status of a worker selector.
    - `expiresAt` string, date-time: The time at which this worker selector expires in UTC.
  - `labels` object: A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.
  - `assignments` object: A collection of the assignments of the job. Key is AssignmentId.
  - `tags` object: A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean.
  - `notes` RouterJobNote[]: Notes attached to a job, sorted by timestamp.
    - `message` string, required: The message contained in the note.
    - `addedAt` string, date-time: The time at which the note was added in UTC. If not provided, will default to the current time.
  - `scheduledAt` string, date-time: If set, job will be scheduled to be enqueued at a given time.
  - `matchingMode` JobMatchingMode: A matching mode of one of the following types: QueueAndMatchMode: Used when matching worker to a job is required to be done right after job is queued. ScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a worker to the job will not start automatically. SuspendMode: Used when matching workers to a job needs to be suspended.
    - `kind` 'queueAndMatch' | 'scheduleAndSuspend' | 'suspend', required: Discriminators for supported matching mode types.

## Other responses

- `default`: An unexpected error response.

## Changes

- **2022-05-05** `8cbeaf5a7ce3`: 3 warning, 2 info
  - the optional response header `ETag` removed for the status `200`
  - the optional response header `Last-Modified` removed for the status `200`
  - the optional response header `x-ms-error-code` removed for the status `default`
  - api operation id `JobRouterOperations_GetJob` removed and replaced with `JobRouter_GetJob`
  - …1 more

[Operation history](https://skmtc.dev/azure/apis/communication-jobrouter/changes/routing/jobs/:jobId/get.md)

---

[API](https://skmtc.dev/azure/apis/communication-jobrouter.md) - [All operations](https://skmtc.dev/azure/apis/communication-jobrouter/llms.txt) - [OpenAPI document](https://skmtc.dev/azure/apis/communication-jobrouter/revisions/c06e8f55d8b7?raw)
