# Obter dados do Usuário

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

## Dados usuário do varejo

<mark style="color:green;">`GET`</mark> `/`user-data-external/\[:username]

#### Parâmetro da URL

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

API responsável por obter os dados um usuário do varejo no billing.

**Headers**

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

**Response**

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

```json
{
    "user": {
        "id": 545,
        "status": 0,
        "username": "28877031298",
        "name": "Nome do Usuário",
        "email": "email@email.com",
        "userType": "trial",
        "serialNumber": "554455",
        "initDate": {
            "date": "2020-02-06 19: 27: 00.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        },
        "billingLimits": {
            "id": 3,
            "limitRules": {
                "dueDate": {
                    "date": "2020-04-06 00: 00: 00.000000",
                    "timezone_type": 3,
                    "timezone": "UTC"
                },
                "signature": 10,
                "login": 10
            }
        }
    },
    "detail": {
        "code": 1093,
        "status": "USER_LISTED",
        "message": "User list"
    }
}
```

{% endtab %}

{% tab title="401" %}

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

{% endtab %}

{% tab title="400" %}

```json
{
    "title": "Bad Request", 
    "status": 400, 
    "detail": 
        { 
            "code": 1126, 
            "status": "USER_NOT_FOUND", 
            "message": "User not found" 
        }
}
```

{% endtab %}
{% endtabs %}

**Exemplo**

```bash
curl --location --request GET 'http://localhost:89/user-data-external/28877031298' \
--header 'Authorization: Bearer 0f4501697743789b1d7d3a5a2df4b4aed9151cab' \
--header 'Content-Type: application/json' \
--data-raw ''
```


---

# 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/obter-dados-do-usuario.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.
