# Update a tag

`PATCH https://api.cademi.com.br/api/v3/tags/{tag_id}`

Operation ID: `tags.update` · API v3

Renames a tag. The new name must be unique within the account.

To avoid overwriting a newer version, send the `ETag` returned by the retrieve operation in the `If-Match` header. If the header is omitted, the update is applied to the current revision.

Replicated tags are read-only. Attempts to update them return `403 Forbidden` with the `replica_readonly` error code.

Required permissions: `tags.update`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `tag_id` | path | string | yes |  |

## Request body

Content type: `application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | no |  |

## Responses

### 200

Returns the updated tag.

Body: `data`: Tag.

Fields of Tag:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string (date-time) | yes |  |
| `id` | string | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `tag` | yes |  |
| `revision` | string | yes |  |
| `updated_at` | string (date-time) | yes |  |
| `users_count` | integer | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The tag was not found or is not accessible with the current credentials.

Body: Error.

### 409

Another tag in the account already uses this name. Returns the already_exists error code.

Body: Error.

### 412

The resource has changed since the supplied revision was retrieved.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
