Excluir webhook de linha
⚠️ Efeito colateral real — isto NÃO é uma simulação, inclusive pelo playground. Exclui o webhook e o log de entregas dele, e responde { "ok": true }. As entregas pendentes dele são descartadas — nada mais é enviado para aquela URL. O segredo morre com ele. Uma segunda chamada responde 404 WEBHOOK_NOT_FOUND.
Permissões: com um token OAuth / MCP, o usuário precisa ser Proprietário ou Administrador (phone_lines:webhooks) — caso contrário, 403 PERMISSION_DENIED.
Todo endpoint /v1/phone-lines aceita só uma chave com escopo de tenant: os webhooks das linhas pertencem ao workspace, não a um número de WhatsApp, então uma chave com escopo de número (ou uma concessão OAuth por número) recebe 403 NUMBER_SCOPE_NOT_ALLOWED antes de qualquer verificação de papel. Um 403 PERMISSION_DENIED / WORKSPACE_MEMBERSHIP_REQUIRED é enviado com Cache-Control: no-store.
Estes são os webhooks das linhas — um cadastro separado de /v1/webhooks: recebem só eventos phone_line.*, e um webhook de número nunca recebe um deles.
Requer uma chave com escopo de tenant.
curl --request DELETE \
--url https://pilotstatus.com.br/v1/phone-lines/webhooks/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/phone-lines/webhooks/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/phone-lines/webhooks/{id}', 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/phone-lines/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/phone-lines/webhooks/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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/phone-lines/webhooks/{id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/phone-lines/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ok": true
}Esta página foi útil?
curl --request DELETE \
--url https://pilotstatus.com.br/v1/phone-lines/webhooks/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/phone-lines/webhooks/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/phone-lines/webhooks/{id}', 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/phone-lines/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/phone-lines/webhooks/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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/phone-lines/webhooks/{id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/phone-lines/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ok": true
}