---
title: "Creates or updates a worker."
method: PATCH
path: "/routing/workers/{workerId}"
---

# Creates or updates a worker.

`PATCH /routing/workers/{workerId}`

Creates or updates a worker.

## Path parameters

- `workerId` string, required

## Query parameters

- `api-version` string, required

## Headers

- `If-Match` string
- `If-Unmodified-Since` string, date-time-rfc7231

## Response `200`

The request has succeeded.

- RouterWorker — An entity for jobs to be routed to.
  - `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 worker.
  - `state` 'active' | 'draining' | 'inactive' — Enums for worker states.
  - `queues` string[] — Collection of queue(s) that this worker can receive work from.
  - `capacity` integer — The total capacity score this worker has to manage multiple concurrent jobs.
  - `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.
  - `tags` object — A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean.
  - `channels` RouterChannel[] — Collection of channel(s) this worker can handle and their impact on the workers capacity.
    - `channelId` string, required — Id of a channel.
    - `capacityCostPerJob` integer, required — The amount of capacity that an instance of a job of this channel will consume of the total worker capacity.
    - `maxNumberOfJobs` integer — The maximum number of jobs that can be supported concurrently for this channel. Value must be greater than zero.
  - `offers` RouterJobOffer[] — A list of active offers issued to this worker.
    - `offerId` string, required — Id of an offer.
    - `jobId` string, required — Id of the job.
    - `capacityCost` integer, required — The capacity cost consumed by the job offer.
    - `offeredAt` string, date-time — Timestamp when the offer was created in UTC.
    - `expiresAt` string, date-time — Timestamp when the offer will expire in UTC.
  - `assignedJobs` RouterWorkerAssignment[] — A list of assigned jobs attached to this worker.
    - `assignmentId` string, required — Id of the assignment.
    - `jobId` string, required — Id of the job assigned.
    - `capacityCost` integer, required — The amount of capacity this assignment has consumed on the worker.
    - `assignedAt` string, date-time, required — The assignment time of the job in UTC.
  - `loadRatio` number, double — A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed.
  - `availableForOffers` boolean — A flag indicating this worker is open to receive offers or not.
  - `maxConcurrentOffers` integer — If this is set, the worker will only receive up to this many new offers at a time.

## Other responses

- `201` — The request has succeeded and a new resource has been created as a result.
- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/communication-jobrouter.md) · [All operations](https://skmtc.net/azure/apis/communication-jobrouter/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/communication-jobrouter/versions/c06e8f55d8b7/schema)
