> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi Tag Jobs V1

> Apply tag updates to up to 50 jobs in one transaction. Two modes — merge adds the new tags to whatever's there; replace overwrites the entire tag set…

Apply tag updates to up to 50 jobs in one transaction.

Two modes — `merge` adds the new tags to whatever's there; `replace`
overwrites the entire tag set. Per-row outcomes: cross-tenant /
unknown ids surface as failures without aborting the batch. Single
commit at the end so a partial failure leaves the DB consistent.

### Request body

`MultiTagRequest`

<ParamField body="job_ids" type="string (uuid)[]" required>
  List of job UUIDs to tag (1..50).
</ParamField>

<ParamField body="tags" type="string[]" required>
  Tag values to apply. Same per-tag rules as `TriggerRequest.tags`. Pass an empty array with `mode=replace` to clear tags entirely.
</ParamField>

<ParamField body="mode" type="string">
  `merge` (default) adds the supplied tags to whatever's already on each job, deduplicating. `replace` overwrites — the supplied tags become the complete set, and any existing tags not in the request are removed.
</ParamField>

### Response

`MultiTagResponse`

<ResponseField name="tagged" type="integer" required />

<ResponseField name="skipped" type="integer" required />

<ResponseField name="results" type="MultiTagItemResult[]" required>
  <Expandable title="MultiTagItemResult">
    <ResponseField name="job_id" type="string" required />

    <ResponseField name="tagged" type="boolean" required />

    <ResponseField name="tags" type="string[]" />

    <ResponseField name="error" type="string,null" />
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `200` | Successful Response |
| `422` | Validation Error    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.computer.stateset.app/api/v1/jobs/multi-tag' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "job_ids": [
      "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    ],
    "tags": [
      "priority"
    ],
    "mode": "merge"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "tagged": 1,
    "skipped": 1,
    "results": [
      {
        "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "tagged": true,
        "tags": [],
        "error": "string"
      }
    ]
  }
  ```
</ResponseExample>
