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

# Set An Account's Tags

> Replace the tags on one account

Sets which tags an account carries.

<Warning>
  **This REPLACES the account's tags.** It is not an add. Send every tag the
  account should end up with — including the ones it already has — or the ones
  you leave out are removed.

  Send `{"tag_ids": []}` to clear them all.
</Warning>

A replace rather than add/remove verbs because the picker that drives it already
holds the account's full set, which makes one request idempotent: the same body
sent twice leaves the same tags. Add/remove would make every caller diff, and a
dropped request would leave a set nobody intended.

## Path Parameters

<ParamField path="companyId" type="string" required>
  The account's `company_id` — the company UUID — from
  [List Accounts](/api-reference/list-accounts).

  Not the account's `id`, which is its LinkedIn numeric id. Both ship on every
  account row; this endpoint takes the UUID, because a tag assignment is keyed
  the same way the account's workflow state is.
</ParamField>

## Body

<ParamField body="tag_ids" type="string[]" required>
  The complete set of tag ids the account should carry, from
  [List Account Tags](/api-reference/list-account-tags). An id belonging to
  another workspace is rejected.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT "https://api.clustr-ai.com/api/public/account-tags/account/9c4d5e6f-.../" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"tag_ids": ["7f3e1a22-...", "8a4f2b33-..."]}'
  ```

  ```bash cURL (clear them) theme={null}
  curl -X PUT "https://api.clustr-ai.com/api/public/account-tags/account/9c4d5e6f-.../" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"tag_ids": []}'
  ```

  ```python Python theme={null}
  import requests

  # Read the current set first, or you will drop what you did not send.
  current = requests.get(
      f"https://api.clustr-ai.com/api/public/account-tags/account/{company_id}",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
  ).json()["data"]["tags"]

  requests.put(
      f"https://api.clustr-ai.com/api/public/account-tags/account/{company_id}",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={"tag_ids": [t["id"] for t in current] + [new_tag_id]},
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "tag_ids": ["7f3e1a22-...", "8a4f2b33-..."]
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": {
      "message": "unknown tag: 00000000-0000-0000-0000-000000000000",
      "code": "BAD_REQUEST"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": {
      "message": "Invalid or missing API key",
      "code": "UNAUTHORIZED"
    }
  }
  ```
</ResponseExample>
