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

# Update Tag

> Update an existing tag

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="tagId" type="string" required>
  Tag ID
</ParamField>

## Request Body

<ParamField body="name" type="string">
  Updated display name (slug will be regenerated)
</ParamField>

<ParamField body="description" type="string">
  Updated description
</ParamField>

### Example Request

```json theme={null}
{
  "description": "Updated description for technology content"
}
```

## Response

Returns the updated Tag object.

```json theme={null}
{
  "id": "tag123",
  "name": "Technology",
  "slug": "technology",
  "description": "Updated description for technology content",
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-22T10:00:00Z"
}
```

## Error Responses

### Tag Not Found

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Tag not found"
  }
}
```

### Tag Name Already Exists

```json theme={null}
{
  "error": {
    "code": "TAG_NAME_ALREADY_EXISTS",
    "message": "A tag with this name already exists"
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/tags/tag123" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{
      "description": "Updated description"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/tags/tag123',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        description: 'Updated description'
      })
    }
  );

  const tag = await response.json();
  console.log(`Updated tag: ${tag.name}`);
  ```
</CodeGroup>
