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

# Update an Existing Contact Tag via the ChatbotX API

> Use PUT /api/v1/tags/{id} to rename an existing tag in your ChatbotX workspace. Supply the tag's numeric ID and the new name in the request body.

Use this endpoint to rename an existing tag in your workspace. Supply the tag's numeric ID in the URL path and the new name in the request body. The name must remain unique within your workspace.

<Info>
  **PUT** `/api/v1/tags/{id}`
</Info>

## Path Parameters

<ParamField path="id" type="string" required>
  The numeric ID of the tag to update. Must match the pattern `\d+`.
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  The updated name for the tag. Must be between 1 and 255 characters.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request PUT \
    --url https://app.chatbotx.io/api/v1/tags/203 \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "Top-Tier Lead"
    }'
  ```

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

  url = "https://app.chatbotx.io/api/v1/tags/203"

  payload = {"name": "Top-Tier Lead"}
  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.put(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const options = {
    method: 'PUT',
    headers: {
      Authorization: 'Bearer <token>',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ name: 'Top-Tier Lead' })
  };

  fetch('https://app.chatbotx.io/api/v1/tags/203', options)
    .then(res => res.json())
    .then(res => console.log(res))
    .catch(err => console.error(err));
  ```
</CodeGroup>

## Response

Returns `200 OK` with the updated tag object.

### Response Fields

<ResponseField name="id" type="string" required>
  The unique identifier of the updated tag.
</ResponseField>

<ResponseField name="name" type="string" required>
  The updated name of the tag.
</ResponseField>

### Example Response

```json theme={null}
{
  "id": "203",
  "name": "Top-Tier Lead"
}
```
