> ## Documentation Index
> Fetch the complete documentation index at: https://docs.menuia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Apagar Conversa (Fluxo)

## Descrição

Este endpoint permite deletar conversas relacionadas a fluxos do chatbot. O endpoint aceita a exclusão de conversas específicas ou de todas as conversas relacionadas, com base nos parâmetros fornecidos.

### Parâmetros

<ParamField body="appkey" type="string" required>
  Chave da aplicação.
</ParamField>

<ParamField body="authkey" type="string" required>
  Chave de autenticação do usuário.
</ParamField>

<ParamField body="to" type="string" required>
  Número de telefone do destinatário ou o valor `"todos"` para apagar conversas de todos os usuários.
</ParamField>

<ParamField body="message" type="string" required>
  Valor obrigatório para indicar o conteúdo da mensagem. Para deletar, deve ser `"false"`.
</ParamField>

<ParamField body="deleteConversaFluxo" type="string" required>
  Deve ser `"true"` para confirmar a exclusão das conversas relacionadas ao fluxo.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://chatbot.menuia.com/api/settings \
    -H "Content-Type: application/json" \
    -d '{
      "appkey": "SUA_APPKEY_AQUI",
      "authkey": "SUA_AUTHKEY_AQUI",
      "to": "+5511999999999",
      "message": "false",
      "deleteConversaFluxo": "true"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://chatbot.menuia.com/api/settings', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      appkey: 'SUA_APPKEY_AQUI',
      authkey: 'SUA_AUTHKEY_AQUI',
      to: '+5511999999999',
      message: 'false',
      deleteConversaFluxo: 'true'
    })
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://chatbot.menuia.com/api/settings',
      json={
          'appkey': 'SUA_APPKEY_AQUI',
          'authkey': 'SUA_AUTHKEY_AQUI',
          'to': '+5511999999999',
          'message': 'false',
          'deleteConversaFluxo': 'true'
      }
  )
  ```

  ```php PHP theme={null}
  $response = Http::post('https://chatbot.menuia.com/api/settings', [
      'appkey' => 'SUA_APPKEY_AQUI',
      'authkey' => 'SUA_AUTHKEY_AQUI',
      'to' => '+5511999999999',
      'message' => 'false',
      'deleteConversaFluxo' => 'true'
  ]);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Sucesso theme={null}
  {
    "status": 200,
    "message": "Conversa deletada com sucesso."
  }
  ```

  ```json 401 - Erro de validação theme={null}
  {
    "status": 401,
    "message": "validation.required"
  }
  ```

  ```json 404 - Dispositivo não encontrado theme={null}
  {
    "status": 404,
    "message": "Nenhum dispositivo encontrado."
  }
  ```
</ResponseExample>
