{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-communication-services/json-schema/microsoft-azure-communication-services-router-worker-create-or-update-schema.json",
  "title": "RouterWorkerCreateOrUpdate",
  "description": "An entity for jobs to be routed to.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-communication-services-jobrouter-api-openapi.yml#/components/schemas/RouterWorkerCreateOrUpdate",
  "type": "object",
  "properties": {
    "queues": {
      "type": "array",
      "description": "Collection of queue(s) that this worker can receive work from.",
      "items": {
        "type": "string"
      }
    },
    "capacity": {
      "type": "integer",
      "format": "int32",
      "description": "The total capacity score this worker has to manage multiple concurrent jobs."
    },
    "labels": {
      "type": "object",
      "description": "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.",
      "additionalProperties": {}
    },
    "tags": {
      "type": "object",
      "description": "A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean.",
      "additionalProperties": {}
    },
    "channels": {
      "type": "array",
      "description": "Collection of channel(s) this worker can handle and their impact on the workers capacity.",
      "items": {
        "$ref": "#/$defs/RouterChannel"
      }
    },
    "availableForOffers": {
      "type": "boolean",
      "description": "A flag indicating this worker is open to receive offers or not."
    }
  },
  "$defs": {
    "RouterChannel": {
      "type": "object",
      "description": "Represents the capacity a job in this channel will consume from a worker.",
      "properties": {
        "channelId": {
          "type": "string",
          "description": "Id of a channel."
        },
        "capacityCostPerJob": {
          "type": "integer",
          "format": "int32",
          "description": "The amount of capacity that an instance of a job of this channel will consume of the total worker capacity."
        },
        "maxNumberOfJobs": {
          "type": "integer",
          "format": "int32",
          "description": "The maximum number of jobs that can be supported concurrently for this channel. Value must be greater than zero."
        }
      },
      "required": [
        "channelId",
        "capacityCostPerJob"
      ]
    }
  }
}