Edita uma mensagem enviada
curl --request POST \
--url https://api.wppfy.com/message/edit \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "3A12345678901234567890123456789012",
"text": "Texto editado da mensagem"
}
'import requests
url = "https://api.wppfy.com/message/edit"
payload = {
"id": "3A12345678901234567890123456789012",
"text": "Texto editado da mensagem"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '3A12345678901234567890123456789012', text: 'Texto editado da mensagem'})
};
fetch('https://api.wppfy.com/message/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wppfy.com/message/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3A12345678901234567890123456789012',
'text' => 'Texto editado da mensagem'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/message/edit"
payload := strings.NewReader("{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado da mensagem\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wppfy.com/message/edit")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado da mensagem\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/message/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado da mensagem\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5511999999999:3A12345678901234567890123456789012",
"messageid": "3A12345678901234567890123456789012",
"content": "Texto editado da mensagem",
"messageTimestamp": 1704067200000,
"messageType": "text",
"status": "Pending",
"owner": "5511999999999"
}{
"error": "Invalid payload"
}{
"error": "No session"
}{
"error": "Message not found"
}{
"error": "Error fetching message from database"
}Ações na mensagem e Buscar
Edita uma mensagem enviada
Edita o conteúdo de uma mensagem já enviada usando a funcionalidade nativa do WhatsApp.
O endpoint realiza:
- Busca a mensagem original no banco de dados usando o ID fornecido
- Edita o conteúdo da mensagem para o novo texto no WhatsApp
- Gera um novo ID para a mensagem editada
- Retorna objeto de mensagem completo seguindo o padrão da API
- Dispara eventos SSE/Webhook automaticamente
Importante:
- Só é possível editar mensagens enviadas pela própria instância
- A mensagem deve existir no banco de dados
- O ID pode ser fornecido no formato completo (owner:messageid) ou apenas messageid
- A mensagem deve estar dentro do prazo permitido pelo WhatsApp para edição
POST
/
message
/
edit
Edita uma mensagem enviada
curl --request POST \
--url https://api.wppfy.com/message/edit \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "3A12345678901234567890123456789012",
"text": "Texto editado da mensagem"
}
'import requests
url = "https://api.wppfy.com/message/edit"
payload = {
"id": "3A12345678901234567890123456789012",
"text": "Texto editado da mensagem"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '3A12345678901234567890123456789012', text: 'Texto editado da mensagem'})
};
fetch('https://api.wppfy.com/message/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wppfy.com/message/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3A12345678901234567890123456789012',
'text' => 'Texto editado da mensagem'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/message/edit"
payload := strings.NewReader("{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado da mensagem\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wppfy.com/message/edit")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado da mensagem\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/message/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado da mensagem\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5511999999999:3A12345678901234567890123456789012",
"messageid": "3A12345678901234567890123456789012",
"content": "Texto editado da mensagem",
"messageTimestamp": 1704067200000,
"messageType": "text",
"status": "Pending",
"owner": "5511999999999"
}{
"error": "Invalid payload"
}{
"error": "No session"
}{
"error": "Message not found"
}{
"error": "Error fetching message from database"
}Autorizações
Corpo
application/json
ID único da mensagem que será editada (formato owner:messageid ou apenas messageid)
Exemplo:
"3A12345678901234567890123456789012"
Novo conteúdo de texto da mensagem
Exemplo:
"Texto editado da mensagem"
Resposta
Mensagem editada com sucesso
ID único da mensagem no formato owner:messageid
Exemplo:
"5511999999999:3A12345678901234567890123456789012"
ID da mensagem no WhatsApp
Exemplo:
"3A12345678901234567890123456789012"
Conteúdo da mensagem editada
Exemplo:
"Texto editado da mensagem"
Timestamp da mensagem (Unix timestamp em milissegundos)
Exemplo:
1704067200000
Tipo da mensagem
Exemplo:
"text"
Status da mensagem
Exemplo:
"Pending"
Proprietário da instância
Exemplo:
"5511999999999"
