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

# Editar Mensagem

> Edita uma mensagem de texto enviada

Edita o conteúdo de uma mensagem de texto que você enviou anteriormente.

## Request Body

<ParamField body="sessionId" type="string" required>
  ID da sessão WhatsApp.
</ParamField>

<ParamField body="remoteJid" type="string" required>
  JID do chat (contato ou grupo).
</ParamField>

<ParamField body="messageId" type="string" required>
  ID da mensagem a ser editada.
</ParamField>

<ParamField body="newText" type="string" required>
  Novo texto da mensagem.
</ParamField>

## Resposta

<ResponseField name="success" type="boolean">
  Se a mensagem foi editada.
</ResponseField>

<ResponseField name="messageId" type="string">
  ID da mensagem editada.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X POST "https://api.oxenty.api.br/api/messages/edit" \
    -H "X-API-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "sessionId": "550e8400-e29b-41d4-a716-446655440000",
      "remoteJid": "5511999999999@s.whatsapp.net",
      "messageId": "3EB0A1B2C3D4E5F6",
      "newText": "Texto corrigido da mensagem"
    }'
  ```

  ```typescript TypeScript theme={"system"}
  await client.messages.edit({
    sessionId: '550e8400-e29b-41d4-a716-446655440000',
    remoteJid: '5511999999999@s.whatsapp.net',
    messageId: '3EB0A1B2C3D4E5F6',
    newText: 'Texto corrigido da mensagem',
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={"system"}
  {
    "success": true,
    "messageId": "3EB0A1B2C3D4E5F6",
    "editedAt": "2024-01-15T10:35:00.000Z"
  }
  ```
</ResponseExample>

<Warning>
  * Apenas mensagens de **texto** podem ser editadas
  * Apenas mensagens enviadas por você (`fromMe: true`) podem ser editadas
  * A edição é visível para todos os participantes do chat
</Warning>
