Definir destino del endpoint de Flow
Guarda el webhook PROPIO del cliente: el destino al que reenviamos cada intercambio de Flow descifrado. Esto NO toca Meta. Registrar endpoint_uri en el Flow es un acto aparte contra un sistema aparte (POST sobre este mismo recurso); hacerlo aquí reapuntaría en silencio el Flow de un tenant que ya opera su propio endpoint, en una solicitud que parecía un cambio de nombre. Lo que esta ruta responde en cambio es hacia dónde ESTÁ apuntando Meta: metaEndpointUri, drift y warnings.
⛔ url debe ser https://. El cuerpo que se le reenvía son las respuestas del formulario del USUARIO FINAL, descifradas por nosotros del sobre de Meta un salto antes; sobre http:// eso es PII en texto claro, y no hay ninguna opción que lo permita (400 FLOW_ENDPOINT_URL_NOT_HTTPS). La URL rechazada no se devuelve: puede llevar un token en su query string.
⚠️ url es OBLIGATORIO y puede ser null EXPLÍCITAMENTE, nunca por omisión. Un campo ausente y uno null significan cosas opuestas (“te envié un cuerpo parcial” y “elimina el destino”), así que un url omitido es 400 FLOW_ENDPOINT_URL_REQUIRED en lugar de borrar una configuración que funciona. "url": null BORRA el destino y CONSERVA el secreto; rotateSecret: true es la salida para un secreto filtrado.
⚠️ secret vuelve en exactamente UNA respuesta en la vida de un secreto: la solicitud que lo generó. Se guarda cifrado y no hay forma de leerlo de vuelta, así que secret: null significa “ya existía uno y se conservó”, no “no hay ninguno”; hasSecret responde eso.
Un cuerpo truncado no se lee como vacío: {"url": "https://x" (falta una llave) es 400 FLOW_BODY_INVALID. Solo se aceptan url y rotateSecret; el número viene de la CLAVE, así que indicarlo en el cuerpo es 400 FLOW_NUMBER_FROM_KEY. Permiso flows:manage.
🔐 Con un token OAuth, cada secreto que genera esta ruta se registra en una auditoría (usuario, cliente OAuth, workspace, Flow, IP, user agent; nunca el secreto), bajo la regla de rol propia de la ruta (flows:manage: ADMIN y OWNER). rotateSecret: true se registra ANTES de rotar: si no se puede escribir la fila de auditoría no se rota nada y la respuesta es 500 OAUTH_SECRET_AUDIT_UNAVAILABLE. Un secreto generado por el primer guardado se registra DESPUÉS del guardado: si no se puede escribir la fila, el destino queda guardado pero el secreto se retiene: secret: null más secretWithheld: true, secretWithheldReason y secretWithheldCode: "OAUTH_SECRET_AUDIT_UNAVAILABLE"; rota para obtener uno nuevo. Las API keys nunca pasan por esta auditoría.
Requiere una clave con alcance de número. Una clave con alcance de tenant debe indicar el número con el header x-whatsapp-number-id, o recibe 403 TENANT_SCOPE_NOT_ALLOWED.
curl --request PUT \
--url https://pilotstatus.com.br/v1/flows/{id}/endpoint \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "https://hooks.acme.com/flows/data-exchange",
"rotateSecret": false
}
'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/endpoint"
payload = {
"url": "https://hooks.acme.com/flows/data-exchange",
"rotateSecret": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://hooks.acme.com/flows/data-exchange', rotateSecret: false})
};
fetch('https://pilotstatus.com.br/v1/flows/{id}/endpoint', 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/flows/{id}/endpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://hooks.acme.com/flows/data-exchange',
'rotateSecret' => 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/flows/{id}/endpoint"
payload := strings.NewReader("{\n \"url\": \"https://hooks.acme.com/flows/data-exchange\",\n \"rotateSecret\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://pilotstatus.com.br/v1/flows/{id}/endpoint")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://hooks.acme.com/flows/data-exchange\",\n \"rotateSecret\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/flows/{id}/endpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://hooks.acme.com/flows/data-exchange\",\n \"rotateSecret\": false\n}"
response = http.request(request)
puts response.read_body{
"flowId": "cmf1a2b3c4d5e6f7g8h9i0j1",
"url": "https://hooks.acme.com/flows/data-exchange",
"hasSecret": true,
"endpointUri": "https://pilotstatus.com.br/api/flows/endpoint/AbC123.../1122334455",
"metaEndpointUri": "https://pilotstatus.com.br/api/flows/endpoint/AbC123.../1122334455",
"drift": false,
"numberHasKey": true,
"numberKeyUploadedAt": "2026-09-01T18:04:00.000Z",
"warnings": [],
"secret": "9f8a1c0e7b6d5a4c3e2f1b0a9d8c7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d"
}Parámetros de ruta
Cuerpo
Respuesta
Destino guardado. secret está presente SOLO cuando esta solicitud generó uno: una rotación, o el primer guardado en este Flow. Con OAuth, cuando el secreto generado no se pudo registrar en la auditoría: secret: null más secretWithheld: true, secretWithheldReason y secretWithheldCode
¿Esta página le ayudó?
curl --request PUT \
--url https://pilotstatus.com.br/v1/flows/{id}/endpoint \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "https://hooks.acme.com/flows/data-exchange",
"rotateSecret": false
}
'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/endpoint"
payload = {
"url": "https://hooks.acme.com/flows/data-exchange",
"rotateSecret": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://hooks.acme.com/flows/data-exchange', rotateSecret: false})
};
fetch('https://pilotstatus.com.br/v1/flows/{id}/endpoint', 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/flows/{id}/endpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://hooks.acme.com/flows/data-exchange',
'rotateSecret' => 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/flows/{id}/endpoint"
payload := strings.NewReader("{\n \"url\": \"https://hooks.acme.com/flows/data-exchange\",\n \"rotateSecret\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://pilotstatus.com.br/v1/flows/{id}/endpoint")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://hooks.acme.com/flows/data-exchange\",\n \"rotateSecret\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/flows/{id}/endpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://hooks.acme.com/flows/data-exchange\",\n \"rotateSecret\": false\n}"
response = http.request(request)
puts response.read_body{
"flowId": "cmf1a2b3c4d5e6f7g8h9i0j1",
"url": "https://hooks.acme.com/flows/data-exchange",
"hasSecret": true,
"endpointUri": "https://pilotstatus.com.br/api/flows/endpoint/AbC123.../1122334455",
"metaEndpointUri": "https://pilotstatus.com.br/api/flows/endpoint/AbC123.../1122334455",
"drift": false,
"numberHasKey": true,
"numberKeyUploadedAt": "2026-09-01T18:04:00.000Z",
"warnings": [],
"secret": "9f8a1c0e7b6d5a4c3e2f1b0a9d8c7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d"
}