# LGPD

## Objetivo

Receber solicitações para a exclusão de dados de um determinado CPF em uma instância do Zenvia NLU através de dois métodos:<br>

1. Solicitar a exclusão
2. Consultar o status da solicitação

A exclusão será realizada de forma assíncrona, dentro de um a dois dias, a partir da solicitação.

### Request

Método para solicitar a exclusão de dados de um determinado CPF

**Endpoint:** POST `https://api.altubots.com/lgpd/<instancia>/request`

**Header:** `x-api-key: <token>` (Para configurar o token acesse o menu APIs no Zenvia NLU e selecione "LGPD")

**Body template:**

```javascript
{
    "cpf": "12345678909"
}
```

### Response

### Status 200 (OK - Request received)

**Body:**

```javascript
{
    "status": "pending",
    "message": "Request received. Please use the status method to check progress"
}
```

###

### Status 400 (Bad request)

**Body:**

```javascript
{
    "status": "error",
    "message": "Invalid CPF"
}
```

###

### Status 401 (Unauthorized)

**Body:**

```javascript
{
    "status": "error",
    "message": "Unauthorized"
}
```

###

### Status code 500

**Body:**

```javascript
{
    "status": "error",
    "message": "Unexpected error"
}
```

## Status

Método para consultar o status de uma solicitação de exclusão de dados

**Endpoint: GET** `https://api.altubots.com/lgpd/<instancia>/status/<cpf>`

**Header:** `x-api-key: <token>`

### Response

### Status 200

**Body:**

```javascript
{
    "message": "Request found",
    "status": "pending / not_found / done / error",
    "details": {
        ...
    }
}
```

**Relação de status:**

* **pending:** solicitação não processada
* **not\_found:** solicitação processada, porém o CPF não foi encontrado na instância.
* **done:** solicitação processada e dados excluídos. No atributo details você vê um sumário do que foi excluído.
* **error:** erro de processamento da solicitação.

###

### Status 404

**Body:**

```javascript
{
    "status": "error",
    "message": "Request not found"
}
```

###

### Status 400 (Bad request)

**Body:**

```javascript
{
    "status": "error",
    "message": "Invalid CPF"
}
```

####

### Status 401 (Unauthorized)

**Body:**

```javascript
{
    "status": "error",
    "message": "Unauthorized"
}
```


---

# 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.altu.d1.cx/connect/apis/lgpd.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.
