# Alteração Tipo Usuário Varejo

**A autenticação deve ser feita via** [**external client credentials**](/workspace/wings/autenticacao/credenciais-de-cliente-externo.md)

## Alteração Tipo Usuário Varejo

<mark style="color:green;">`PATCH`</mark> `/user-retail/{username}`&#x20;

#### Parâmetro da URL

* **Nome**: \``username`\`&#x20;
* **Tipo**: String
* **Descrição**: CPF do usuário
* **Exemplo**: Para atualizar informações do usuário com CPF "123.456.789-00", a URL deve ser `PATCH /user-retail/21890128643`

Alterar tipo usuário varejo

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name        | Type   | Description                          |
| ----------- | ------ | ------------------------------------ |
| userType \* | string | Tipo de usuário \[`normal`\|`trial`] |

&#x20;\* Campo obrigatório

**Response**

{% tabs %}
{% tab title="201" %}

```json
```

{% endtab %}

{% tab title="401" %}

```json
{    
    "title": "Unauthorized", 
    "status": 401,
    "detail": "User auth error."
}
```

{% endtab %}

{% tab title="400" %}

```json
{    
    "title": "Bad Request", 
    "status": 400,
    "detail": "User retail not found."
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "title": "Bad Request", 
    "status": 400,
    "detail": "User Type is invalid."
}
```

{% endtab %}
{% endtabs %}

**Exemplo**

```bash
curl --location --request PATCH 'localhost:89/user-retail/21890128643' \
    --header 'Authorization: Bearer bc0d305a769d9ab768ebf4d09bcf9013710d37ce' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "userType": "normal"
    }'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vaultid.com.br/workspace/wings/usuario-varejo/alteracao-tipo-usuario-varejo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
