Mensajes
Cancelar mensajes programados
Cancela mensajes programados (estado QUEUED con un deliverAt futuro) del número de la clave, por id interno del mensaje (1–100). Las filas permanecen, con estado CANCELED. Siempre 200: lo que no se pudo cancelar se lista en failed con un motivo.
Auth: una clave con alcance de número, o una clave de toda la cuenta con el encabezado x-whatsapp-number-id (si no, 403 TENANT_SCOPE_NOT_ALLOWED). Los tokens OAuth/MCP y las claves de cuenta también necesitan messages:cancel_scheduled (AGENT, ADMIN u OWNER).
DELETE
/
v1
/
messages
/
cancel
Cancelar mensajes programados
curl --request DELETE \
--url https://pilotstatus.com.br/v1/messages/cancel \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"messageIds": [
"msg_01HZX...",
"msg_02HZX..."
]
}
'import requests
url = "https://pilotstatus.com.br/v1/messages/cancel"
payload = { "messageIds": ["msg_01HZX...", "msg_02HZX..."] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({messageIds: ['msg_01HZX...', 'msg_02HZX...']})
};
fetch('https://pilotstatus.com.br/v1/messages/cancel', 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://pilotstatus.com.br/v1/messages/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'messageIds' => [
'msg_01HZX...',
'msg_02HZX...'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://pilotstatus.com.br/v1/messages/cancel"
payload := strings.NewReader("{\n \"messageIds\": [\n \"msg_01HZX...\",\n \"msg_02HZX...\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("x-api-key", "<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.delete("https://pilotstatus.com.br/v1/messages/cancel")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messageIds\": [\n \"msg_01HZX...\",\n \"msg_02HZX...\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/messages/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messageIds\": [\n \"msg_01HZX...\",\n \"msg_02HZX...\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"cancelled": [
"msg_01HZX..."
],
"failed": [
{
"id": "msg_02HZX...",
"reason": "Not queued"
}
]
}Cuerpo
application/json
¿Esta página le ayudó?
⌘I
Cancelar mensajes programados
curl --request DELETE \
--url https://pilotstatus.com.br/v1/messages/cancel \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"messageIds": [
"msg_01HZX...",
"msg_02HZX..."
]
}
'import requests
url = "https://pilotstatus.com.br/v1/messages/cancel"
payload = { "messageIds": ["msg_01HZX...", "msg_02HZX..."] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({messageIds: ['msg_01HZX...', 'msg_02HZX...']})
};
fetch('https://pilotstatus.com.br/v1/messages/cancel', 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://pilotstatus.com.br/v1/messages/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'messageIds' => [
'msg_01HZX...',
'msg_02HZX...'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://pilotstatus.com.br/v1/messages/cancel"
payload := strings.NewReader("{\n \"messageIds\": [\n \"msg_01HZX...\",\n \"msg_02HZX...\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("x-api-key", "<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.delete("https://pilotstatus.com.br/v1/messages/cancel")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messageIds\": [\n \"msg_01HZX...\",\n \"msg_02HZX...\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/messages/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messageIds\": [\n \"msg_01HZX...\",\n \"msg_02HZX...\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"cancelled": [
"msg_01HZX..."
],
"failed": [
{
"id": "msg_02HZX...",
"reason": "Not queued"
}
]
}