---
title: "Bulk Set Agent Attribute Values Job"
method: POST
path: "/api/v2/routing/agents/instance_values/job"
tags: ["Skill Based Routing", "Job Statuses"]
---

# Bulk Set Agent Attribute Values Job

`POST /api/v2/routing/agents/instance_values/job`

Adds, replaces or removes multiple attributes for up to 100 agents.

#### Allowed For
* Admins
* [Agents in custom role with permission to manage skills](https://support.zendesk.com/hc/en-us/articles/4408882153882-Creating-custom-roles-and-assigning-agents)

#### Available Parameters

The request takes a data object with the following properties:
| Name       | Type   | Required | Description                                                                                       |
| ---------- | ------ | -------- | ------------------------------------------------------------------------------------------------- |
| action     | string | true     | The action to perform on the attribute values. One of the following: "upsert", "update", "delete" |
| attributes | object | true     | The attribute values to update. See [Attribute Values](#attribute-values)                         |
| items      | array  | true     | The list of agent ids                                                                             |

Action can be one of the following:
  * upsert: Adds new attribute values to the agents
  * update: Replaces all the current attribute values of the agents with the new values
  * delete: Removes specified attribute values from the agents

This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion.

## Request body

- BulkSkillBasedRoutingAttributeValuesRequest
  - `job` BulkSkillBasedRoutingAttributeValueJob
    - `action` string, required — The action to perform on the attribute values. One of the following: "upsert", "update", "delete"
    - `attributes` object, required — The attribute values to update. See [Attribute Values](#attribute-values)
      - `attribute_values` SkillBasedRoutingAttributeValueObject[]
        - `attribute_id` string — Id of the associated attribute
        - `created_at` string, date-time — When this record was created
        - `id` string — Automatically assigned when an attribute value is created
        - `name` string — The name of the attribute value
        - `updated_at` string, date-time — When this record was last updated
        - `url` string — URL of the attribute value
    - `items` integer[], required — The list of agent ids

## Response `200`

Success response

- JobStatusResponse
  - `job_status` JobStatusObject
    - `id` string — Automatically assigned when the job is queued
    - `job_type` string — The type of the job
    - `message` string, nullable — Message from the job worker, if any
    - `progress` integer, nullable — Number of tasks that have already been completed
    - `results` union — Result data from processed tasks. See [Results](#results) below
      - JobStatusResultObject[], nullable
        - union
          - object
            - `id` integer, required — the id of the new resource
            - `index` integer, required — the index number of the resul
          - object
            - `action` string, required — the action the job attempted (`"action": "update"`)
            - `id` integer, required — the id of the resource the job attempted to update
            - `status` string, required — the status (`"status": "Updated"`)
            - `success` boolean, required — whether the action was successful or not (`"success": true`)
          - object
            - `action` string, required — The action the job attempted (`"action": "update"`)
            - `details` string, required — The details of the error
            - `error` string, required — The error message
            - `id` integer, required — The id of the resource the job attempted to update
            - `success` boolean, required — Whether the action was successful or not (`"success": true`)
      - object
        - `success` boolean, required — Whether the action was successful or not
    - `status` string — The current status. One of the following: "queued", "working", "failed", "completed"
    - `total` integer, nullable — The total number of tasks this job is batching through
    - `url` string — The URL to poll for status updates

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.dev/botbrains-io/apis/support-api.md) · [All operations](https://skmtc.dev/botbrains-io/apis/support-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/botbrains-io/support-api/revisions/d53eac07ba68/schema)
