> ## 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 Mensagem

<Card title="Webhook relacionado: Deletada" icon="bolt" href="/webhook-reference/events/deletado" horizontal>
  Apagar para todos dispara o evento **Deletada** no seu webhook.
</Card>

## Descrição

Este endpoint permite apagar uma mensagem específica, utilizando o ID da mensagem a ser apagada.

### Parâmetros

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

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

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

<ParamField body="to" type="string" required>
  Número de telefone no formato internacional ou ID do grupo do destinatário da mensagem.
</ParamField>

<ParamField body="deleteID" type="string" required>
  ID único da mensagem a ser apagada.
</ParamField>

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

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

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

  response = requests.post(
      'https://chatbot.menuia.com/api/create-message',
      json={
          'appkey': 'SUA_APPKEY_AQUI',
          'authkey': 'SUA_AUTHKEY_AQUI',
          'message': 'false',
          'to': '+5511999999999',
          'deleteID': '3F49AC7097B295B8FC09'
      }
  )
  ```

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

<ResponseExample>
  ```json 200 - Sucesso theme={null}
  {
    "status": 200,
    "message": "Mensagem apagada 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>
