# Usuários

## Adicionar Usuário (Cache Local)

<mark style="color:green;">`POST`</mark> `http://utility-assistant.local/user`

Serviço para cadastro de novos usuários no cache local, ao consumir esse serviço deve ser enviado as credenciais do usuário (username + otp) para autenticação e autorização da aplicação local. (client credentials)&#x20;

#### Headers

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| Content-Type | string | application/x-www-form-urlencoded |
| Accept       | string | application/json                  |

#### Request Body

| Name     | Type   | Description        |
| -------- | ------ | ------------------ |
| username | string | Usuário (CPF/CNPJ) |
| password | string | Código OTP         |

{% tabs %}
{% tab title="201 Cache criado com sucesso" %}

```javascript
{
    "detail": {
		"code": 1128,
		"status": "CACHE_CREATED",
		"message": "Cache created"
	}
}
```

{% endtab %}

{% tab title="400 Falha ao criar cache, credenciais inválidas" %}

```javascript
{
	"detail": {
		"code": 1056,
		"status": "INVALID_CREDENTIALS",
		"message": "Invalid credentials"
	}
}
```

{% endtab %}
{% endtabs %}

## Listar Usuários (Cache Local)

<mark style="color:blue;">`GET`</mark> `http://utility-assistant.local/user`

Serviço para listagem de usuários armazenados no cache local

#### Headers

| Name   | Type   | Description      |
| ------ | ------ | ---------------- |
| Accept | string | application/json |

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

```javascript
{
	"users": [{
		"id": 1,
		"name": "NOME DO USUÁRIO",
		"username": "01234567890",
		"date_last_update": "2019-01-26 10:14:36",
        "photo": "Foto/Thumbnail encodada em base64, veja RFC2397"
    }],
	"detail": {
		"code": 1093,
		"status": "USER_LISTED",
		"message": "User list"
	}
}
```

{% endtab %}
{% endtabs %}

## Remover Usuário (Cache Local)

<mark style="color:red;">`DELETE`</mark> `http://utility-assistant.local/user/:id`

#### Path Parameters

| Name | Type    | Description   |
| ---- | ------- | ------------- |
| id   | integer | ID do usuário |

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

```
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
A remoção do usuário através da API não implica o bloqueio da aplicação (computador/servidor), para bloqueio de pedidos de autenticação, remoção de vinculo com aplicação ou revogação de sessões em aberto, acesse o portal do usuário.
{% endhint %}


---

# 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/middleware/assistente-utilitario/api/user.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.
