> ## 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.

# Add Tag to Item

> Add a tag to an item. Creates the tag if it doesn't exist.

## Path Parameters

<ParamField path="item_id" type="string" required>
  The item ID. Example: `itm_r9f3a`.
</ParamField>

## Body Parameters

<ParamField body="name" type="string" required>
  The tag name. Case-insensitive. If a tag with this name already exists, it will be reused.
</ParamField>

## Response

Returns the tag with status `201` if newly created, or `200` if the tag was already on this item.

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

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

<ResponseExample>
  ```json 201 theme={null}
  {
    "object": "tag",
    "id": "tag_n5j2x",
    "name": "essays",
    "item_count": 43,
    "created_at": "2025-01-15T10:00:00Z"
  }
  ```
</ResponseExample>
