# Update a user avatar

`PUT https://api.cademi.com.br/api/v3/users/{user_id}/avatar`

Operation ID: `users.avatar.update` · API v3

Sets the user's avatar to a file previously uploaded to the account, identified by `file_id`.

Required permissions: `users.update`.

## Parameters

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

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `file_id` | string | yes |  |

## Responses

### 200

Returns the user with the updated avatar.

Body: `data`: User.

Fields of User:

| Field | Type | Required | Description |
|---|---|---|---|
| `access` | string, one of `granted`, `none` | yes |  |
| `created_at` | string (date-time) | yes |  |
| `deleted` | boolean | yes |  |
| `document` | string or null | no |  |
| `email` | string (email) | yes |  |
| `external_id` | string or null | no |  |
| `id` | string | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `user` | yes |  |
| `phone` | string or null | no |  |
| `revision` | string | yes |  |
| `status` | string, one of `active`, `inactive` | yes |  |
| `tags` | array of string | yes |  |
| `updated_at` | string (date-time) | 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 file was not found or is not accessible with the current credentials.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

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