Definir destino do endpoint do Flow (alias de PUT)
Idêntico ao PUT neste recurso, e servido pelo mesmo código. O recurso tem exatamente um campo escrevível, portanto “substituir” e “fundir” descrevem a mesma operação; responder 405 à grafia que o cliente adivinhou seria uma armadilha sem nada atrás. Veja PUT /v1/flows/{id}/endpoint para o contrato completo.
curl --request PATCH \
--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"
}
'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/endpoint"
payload = { "url": "https://hooks.acme.com/flows/data-exchange" }
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({url: 'https://hooks.acme.com/flows/data-exchange'})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://hooks.acme.com/flows/data-exchange'
]),
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}")
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/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}")
.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::Patch.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}"
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"
}{
"error": "url é obrigatório: envie a URL https:// do seu webhook, ou `\"url\": null` para deixar este Flow sem destino.",
"errorEN": "url is required: send your webhook's https:// URL, or `\"url\": null` to leave this Flow with no destination.",
"code": "FLOW_ENDPOINT_URL_REQUIRED"
}{
"error": "Unauthorized"
}{
"error": "Tenant-scoped keys cannot call number endpoints",
"code": "TENANT_SCOPE_NOT_ALLOWED"
}{
"error": "Flow não encontrado para o número desta chave.",
"errorEN": "Flow not found for this key's number.",
"code": "FLOW_NOT_FOUND"
}{
"error": "Flows existem apenas em números Meta (API Oficial). O número desta chave não é Meta ou não tem uma WABA associada — use uma chave de um número Meta.",
"errorEN": "Flows only exist on Meta (Cloud API) numbers. This key's number is not a Meta number, or has no WABA behind it — use a key bound to a Meta number.",
"code": "FLOW_REQUIRES_META_NUMBER"
}{
"error": "Too many requests"
}{
"error": "Não foi possível guardar o segredo de assinatura deste endpoint: o serviço não está configurado para armazená-lo com segurança. Fale com o suporte.",
"errorEN": "Could not store this endpoint's signing secret: the service is not configured to keep it safely. Contact support.",
"code": "FLOW_ENDPOINT_SECRET_UNAVAILABLE"
}Autorizações
Sua chave de API ps_
Parâmetros de caminho
O id local do Flow — o campo id que GET /v1/flows devolve, nunca o metaFlowId.
Corpo
O webhook https:// próprio do cliente. null LIMPA o destino e mantém o segredo de assinatura. Obrigatório — omitir o campo dá 400 FLOW_ENDPOINT_URL_REQUIRED, nunca uma limpeza.
"https://hooks.acme.com/flows/data-exchange"
Cunha um novo segredo HMAC de assinatura e devolve-o uma única vez. Tem de ser um booleano de verdade — "true" é recusado, nunca convertido (400 FLOW_ENDPOINT_ROTATE_INVALID).
false
Resposta
Destino guardado. secret só vem presente quando este pedido cunhou um — uma rotação, ou a primeira gravação neste Flow
Esta página foi útil?
curl --request PATCH \
--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"
}
'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/endpoint"
payload = { "url": "https://hooks.acme.com/flows/data-exchange" }
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({url: 'https://hooks.acme.com/flows/data-exchange'})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://hooks.acme.com/flows/data-exchange'
]),
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}")
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/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}")
.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::Patch.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}"
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"
}{
"error": "url é obrigatório: envie a URL https:// do seu webhook, ou `\"url\": null` para deixar este Flow sem destino.",
"errorEN": "url is required: send your webhook's https:// URL, or `\"url\": null` to leave this Flow with no destination.",
"code": "FLOW_ENDPOINT_URL_REQUIRED"
}{
"error": "Unauthorized"
}{
"error": "Tenant-scoped keys cannot call number endpoints",
"code": "TENANT_SCOPE_NOT_ALLOWED"
}{
"error": "Flow não encontrado para o número desta chave.",
"errorEN": "Flow not found for this key's number.",
"code": "FLOW_NOT_FOUND"
}{
"error": "Flows existem apenas em números Meta (API Oficial). O número desta chave não é Meta ou não tem uma WABA associada — use uma chave de um número Meta.",
"errorEN": "Flows only exist on Meta (Cloud API) numbers. This key's number is not a Meta number, or has no WABA behind it — use a key bound to a Meta number.",
"code": "FLOW_REQUIRES_META_NUMBER"
}{
"error": "Too many requests"
}{
"error": "Não foi possível guardar o segredo de assinatura deste endpoint: o serviço não está configurado para armazená-lo com segurança. Fale com o suporte.",
"errorEN": "Could not store this endpoint's signing secret: the service is not configured to keep it safely. Contact support.",
"code": "FLOW_ENDPOINT_SECRET_UNAVAILABLE"
}