Actualizar webhook del espacio de trabajo
Webhooks de workspace: el mismo registro que /v1/phone-lines/webhooks (mismas filas, secreto plwh_, firma, reintentos y entregas), con un conjunto de eventos más amplio: todos los eventos phone_line.* más wallet.topup_paid (se acreditó una recarga de la billetera). "*" significa solo todos los eventos de líneas telefónicas: wallet.topup_paid es opcional, inclúyelo por nombre (por ejemplo ["*", "wallet.topup_paid"]). Esta superficie lista todos los webhooks del workspace. Clave con alcance de tenant (o clave de cuenta con x-workspace-id); Owner o Admin (phone_lines:webhooks) con una credencial de usuario.
⚠️ Efecto real. Cambia los campos que envías y responde { "webhook": { … } }; un campo ausente se deja como está. active: false pausa el webhook (no recibe entregas: una entrega que ya está en sus reintentos se marca como fallida en su siguiente intento) y active: true lo reanuda; los eventos ocurridos mientras estaba pausado nunca se envían.
El webhook resultante se valida como en la creación. Solo una URL que cambia se vuelve a verificar contra destinos internos, así que un webhook siempre se puede pausar o editar sus eventos. Un name enviado en blanco se convierte en el host de la URL (nueva o guardada). Editar nunca cambia el secreto de firma, y el secreto no se devuelve.
Permisos: con una clave de cuenta (ps_account_) o un token OAuth / MCP, el usuario debe ser Owner o Admin (phone_lines:webhooks); de lo contrario, 403 PERMISSION_DENIED.
Todos los endpoints de /v1/workspace/webhooks aceptan solo una clave con alcance de tenant: los webhooks de workspace pertenecen al workspace, no a un número de WhatsApp, por lo que una clave con alcance de número (o una autorización OAuth por número) recibe 403 NUMBER_SCOPE_NOT_ALLOWED antes de que se evalúe cualquier rol. Un 403 PERMISSION_DENIED / WORKSPACE_MEMBERSHIP_REQUIRED se envía con Cache-Control: no-store.
Estos son los webhooks de workspace, un registro separado de /v1/webhooks: reciben los eventos phone_line.* y wallet.topup_paid, y un webhook de número nunca recibe ninguno de ellos.
Requiere una clave con alcance de tenant.
curl --request PATCH \
--url https://pilotstatus.com.br/v1/workspace/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"active": false
}
'import requests
url = "https://pilotstatus.com.br/v1/workspace/webhooks/{id}"
payload = { "active": False }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: false})
};
fetch('https://pilotstatus.com.br/v1/workspace/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/workspace/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'active' => false
]),
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/workspace/webhooks/{id}"
payload := strings.NewReader("{\n \"active\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://pilotstatus.com.br/v1/workspace/webhooks/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/workspace/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": false\n}"
response = http.request(request)
puts response.read_body{
"webhook": {
"id": "cmh1w8b2k0001wh8example3d",
"name": "hooks.example.com",
"url": "https://hooks.example.com/pilot/phone-lines",
"events": [
"*"
],
"active": false,
"lastDeliveryAt": "2026-10-27T14:11:51.000Z",
"lastStatusCode": 200,
"createdAt": "2026-10-27T13:58:02.000Z"
}
}Encabezados
Parámetros de ruta
Cuerpo
Debe ser https y apuntar a una dirección pública. Una URL que apunta a una dirección de red interna o privada (localhost, una IP de loopback o privada, un host sin punto, o un nombre que resuelve a una de ellas) → 400 WEBHOOK_URL_REFUSED.
"https://hooks.example.com/pilot/phone-lines"
Uno o más eventos de workspace, y/o "*". "*" significa todos los eventos de líneas telefónicas (incluidos los que se agreguen después); wallet.topup_paid es opcional y debe incluirse por nombre, p. ej. ["*", "wallet.topup_paid"]. Los duplicados se eliminan. Una lista vacía o un evento desconocido → 400 INVALID_WEBHOOK.
1phone_line.purchased, phone_line.audio_received, phone_line.code_received, phone_line.code_failed, phone_line.renewed, phone_line.payment_failed, phone_line.suspended, phone_line.returned, phone_line.canceled, phone_line.verification_updated, wallet.topup_paid, * ["*"]
¿Esta página le ayudó?
curl --request PATCH \
--url https://pilotstatus.com.br/v1/workspace/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"active": false
}
'import requests
url = "https://pilotstatus.com.br/v1/workspace/webhooks/{id}"
payload = { "active": False }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: false})
};
fetch('https://pilotstatus.com.br/v1/workspace/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/workspace/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'active' => false
]),
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/workspace/webhooks/{id}"
payload := strings.NewReader("{\n \"active\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://pilotstatus.com.br/v1/workspace/webhooks/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/workspace/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": false\n}"
response = http.request(request)
puts response.read_body{
"webhook": {
"id": "cmh1w8b2k0001wh8example3d",
"name": "hooks.example.com",
"url": "https://hooks.example.com/pilot/phone-lines",
"events": [
"*"
],
"active": false,
"lastDeliveryAt": "2026-10-27T14:11:51.000Z",
"lastStatusCode": 200,
"createdAt": "2026-10-27T13:58:02.000Z"
}
}