# Assign a tag

`POST https://api.cademi.com.br/api/v3/users/{user_id}/tags/{tag_id}`

Operation ID: `users.tags.create` · API v3

Assigns a tag to the user. The operation is idempotent: the response status indicates whether the tag was newly assigned or was already assigned.

Required permissions: `users.update`.

## Parameters

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

## Responses

### 200

The tag was already assigned to the user.

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

### 201

The tag was assigned to the user.

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 user or tag was not found or is not accessible with the current credentials.

Body: Error.

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