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

# Rename Tag

> Rename a tag. The new name applies to all items that have this tag.

## Path Parameters

<ParamField path="id" type="string" required>
  The tag ID. Example: `tag_n5j2x`.
</ParamField>

## Body Parameters

<ParamField body="name" type="string" required>
  The new tag name.
</ParamField>

## Response

Returns the updated tag.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.getmatter.com/public/v1/tags/tag_n5j2x \
    -H "Authorization: Bearer mat_your_token_here" \
    -H "Content-Type: application/json" \
    -d '{"name": "long-reads"}'
  ```

  ```python Python theme={null}
  response = requests.patch(
      "https://api.getmatter.com/public/v1/tags/tag_n5j2x",
      headers={
          "Authorization": f"Bearer {token}",
          "Content-Type": "application/json"
      },
      json={"name": "long-reads"}
  )
  tag = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "object": "tag",
    "id": "tag_n5j2x",
    "name": "long-reads",
    "item_count": 42,
    "created_at": "2025-01-15T10:00:00Z"
  }
  ```

  ```json 409 theme={null}
  {
    "error": {
      "code": "conflict",
      "message": "A tag with this name already exists.",
      "field": "name"
    }
  }
  ```
</ResponseExample>
