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

# Tag links

> Add or remove workspace tags (and optionally set one type) on up to 100 monitored links in one change.

`tag_links`

Add or remove workspace tags (and optionally set one type) on up to 100 monitored links in one change. Tags never replace each other.

<Note>This command name is absent from deployment evidence dated 2026-09-20. Hosted availability for this current definition is unverified; inspect your connected catalog before invoking it. Verify the command and its input schema in the selected environment.</Note>

| Access | Behavior |
| - | - |
| `watches:write` | Writes or admits work |

This operation changes saved state. Review its inputs and retry behavior before calling.

## Example request

Connect through [MCP](/guides/connect-mcp), [CLI](/guides/connect-cli), or [HTTP](/guides/connect-http). Replace example identifiers with records from your workspace.

<CodeGroup>
  ```json MCP theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "tag_links",
      "arguments": {
        "watchIds": [
          "wat_00000000-0000-4000-8000-000000000000"
        ],
        "addTagIds": [
          "tag_example"
        ]
      }
    }
  }
  ```

  ```bash CLI theme={null}
  agentlinkops call tag_links --args '{"watchIds":["wat_00000000-0000-4000-8000-000000000000"],"addTagIds":["tag_example"]}'
  ```

  ```bash HTTP theme={null}
  curl --fail-with-body https://app.agentlinkops.com/v1/commands/tag_links \
    -H "Authorization: Bearer $AGENTLINKOPS_TOKEN" \
    -H 'Content-Type: application/json' \
    --data '{"watchIds":["wat_00000000-0000-4000-8000-000000000000"],"addTagIds":["tag_example"]}'
  ```
</CodeGroup>

## Returned result

Illustrative data validated against the documented response schema. IDs and dates are examples, not a live account capture. MCP returns this data in `structuredContent` and in a text content block; generic HTTP and CLI return the JSON result directly.

```json theme={null}
{
  "updated": 1,
  "items": [
    {
      "id": "wat_00000000-0000-4000-8000-000000000000",
      "type": "directory_entry",
      "type_source": "person",
      "type_revision": 1,
      "tags": [
        {
          "id": "tag_example",
          "name": "Outreach Q4",
          "color": "#075985"
        }
      ],
      "disavow": null
    }
  ]
}
```

## Input fields

Omit optional fields when you do not want to supply them. Null is accepted only where listed. Unknown input properties are rejected.

| Field | Type | Presence | Meaning and constraints |
| - | - | - | - |
| `watchIds` | array | Required | watch ids; see schema. minItems: 1; maxItems: 100 |
| `addTagIds` | array | Optional | add tag ids; see schema. maxItems: 20 |
| `removeTagIds` | array | Optional | remove tag ids; see schema. maxItems: 20 |
| `type` | string / null | Optional | type; see schema. |

### Validation and omitted values

Adds or removes workspace tags (and optionally sets one type) on up to 100 links; tags never replace each other.

## Output fields

Fields inside optional or nullable parents apply only when that parent exists. [Common schema conventions](/reference/schemas) explain evidence states, empty lists and extensions.

| Field | Type | Presence | Meaning and constraints |
| - | - | - | - |
| `updated` | integer | Required | minimum: -9007199254740991; maximum: 9007199254740991 |
| `items` | array | Required | Records in this bounded page. |
| `items[].id` | string | Required | Resource identifier returned by the operation. |
| `items[].type` | string / null | Required | |
| `items[].type_source` | string / null | Required | |
| `items[].tags` | array | Required | |
| `items[].tags[].id` | string | Required | Resource identifier returned by the operation. |
| `items[].tags[].name` | string | Required | |
| `items[].tags[].color` | string | Required | |
| `items[].disavow` | string / null | Required | |

[Download input schema](/schemas/tag_links.input.json) · [Download output schema](/schemas/tag_links.output.json)

## Errors and retries

This write is annotated idempotent without a caller-supplied idempotency key. Reconcile saved state after an uncertain response, then use the same inputs for the same intended operation. Do not add an unsupported key.

See [error recovery](/reference/errors) for status, scope, cooldown, cursor and retry handling. Unknown observations are result data and do not establish loss.

## HTTP resource routes

These existing resource routes share the operation’s domain behavior. Their parameter placement, status and response envelope can differ from generic invocation. See [HTTP route details](/reference/http/routes).

| Method and route | Success | Details |
| - | - | - |
| `POST /v1/watches/bulk-labels` | 200 | The JSON body uses the shared tag\_links input. Updates saved labels on up to 100 monitored links; it starts no verification job. |
| `POST /v1/watches/{watchId}/tags` | 200 | Send JSON tagId. The adapter sets watchIds to the URL watchId and addTagIds to that one tag; it does not accept a bulk command body. |
| `DELETE /v1/watches/{watchId}/tags/{tagId}` | 200 | The URL selects the one watch and tag to remove. The adapter sets watchIds and removeTagIds; it reads no JSON body. |
| `DELETE /v1/watches/{watchId}/tags` | 200 | Send JSON tagId. The adapter sets watchIds to the URL watchId and removeTagIds to that one tag. |

## Continue

[list\_link\_tags](/reference/commands/list_link_tags) · [list\_link\_watches](/reference/commands/list_link_watches)

Follow the [related workflow](/guides/monitor-changes), inspect [capability status](/capability-status), or return to the [command index](/reference/index).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.