curl --request POST \
--url https://api.wppfy.com/message/edit \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "3A12345678901234567890123456789012",
"text": "Edited message text"
}
'import requests
url = "https://api.wppfy.com/message/edit"
payload = {
"id": "3A12345678901234567890123456789012",
"text": "Edited message text"
}
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: 'Edited message text'})
};
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' => 'Edited message text'
]),
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\": \"Edited message text\"\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\": \"Edited message text\"\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\": \"Edited message text\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5511999999999:3A12345678901234567890123456789012",
"messageid": "3A12345678901234567890123456789012",
"content": "Edited message text",
"messageTimestamp": 1704067200000,
"messageType": "text",
"status": "Pending",
"owner": "5511999999999"
}{
"error": "Invalid payload"
}{
"error": "No session"
}{
"error": "Message not found"
}{
"error": "Error fetching message from database"
}Edit a sent message
Edits the content of an already sent message using WhatsApp’s native functionality.
Use this operation to correct the text of a message sent by the instance itself. The response returns the updated message and the change also appears in the configured events.
Important:
- Only messages sent by the instance itself can be edited
- The message must be available in the instance’s history
- The ID can be provided in the full format returned by the API or just as
messageid - The message must be within the time window allowed by WhatsApp for editing
- For newsletters/channels, use
POST /newsletter/messages/edit
curl --request POST \
--url https://api.wppfy.com/message/edit \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "3A12345678901234567890123456789012",
"text": "Edited message text"
}
'import requests
url = "https://api.wppfy.com/message/edit"
payload = {
"id": "3A12345678901234567890123456789012",
"text": "Edited message text"
}
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: 'Edited message text'})
};
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' => 'Edited message text'
]),
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\": \"Edited message text\"\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\": \"Edited message text\"\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\": \"Edited message text\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5511999999999:3A12345678901234567890123456789012",
"messageid": "3A12345678901234567890123456789012",
"content": "Edited message text",
"messageTimestamp": 1704067200000,
"messageType": "text",
"status": "Pending",
"owner": "5511999999999"
}{
"error": "Invalid payload"
}{
"error": "No session"
}{
"error": "Message not found"
}{
"error": "Error fetching message from database"
}Authorizations
Body
Full ID returned by the API or just the messageid
"3A12345678901234567890123456789012"
New text content of the message
"Edited message text"
Response
Message edited successfully
Full message ID returned by the API
"5511999999999:3A12345678901234567890123456789012"
Message ID on WhatsApp
"3A12345678901234567890123456789012"
Content of the edited message
"Edited message text"
Message timestamp (Unix timestamp in milliseconds)
1704067200000
Message type
"text"
Message status
"Pending"
Instance owner
"5511999999999"
