Obtener enlace de vista previa del Flow
Pide a Meta el enlace de vista previa web del Flow. El cuerpo es opcional: sin cuerpo, un string vacío y {} se aceptan; invalidate es el único campo, y true hace caducar el enlace anterior y genera uno nuevo. expiresAt es el valor de Meta tal cual, o null cuando Meta no envía ninguno. Permiso flows:manage. La respuesta es Cache-Control: no-store.
⛔ El enlace es público: cualquiera que tenga la URL abre el Flow sin iniciar sesión (requiresLogin: false), así que reenviarlo comparte el formulario. Y la vista previa no es un sandbox: en un Flow data_exchange, Meta llama a tu endpoint de verdad. La respuesta lo repite en warning / warningEN.
invalidate debe ser un booleano real: "true" es 400 FLOW_PREVIEW_INVALIDATE_INVALID, nunca se convierte. Un cuerpo que no es JSON, o no es un objeto, es 400 FLOW_BODY_INVALID; whatsappNumberId / wabaId son 400 FLOW_NUMBER_FROM_KEY; cualquier otro campo es 400 FLOW_UNKNOWN_FIELDS. Un Flow que no llegó a Meta es 404 FLOW_NOT_FOUND; cuando Meta no devuelve enlace, la respuesta es 502 FLOW_PREVIEW_UNAVAILABLE.
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 POST \
--url https://pilotstatus.com.br/v1/flows/{id}/preview \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"invalidate": false
}
'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/preview"
payload = { "invalidate": False }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({invalidate: false})
};
fetch('https://pilotstatus.com.br/v1/flows/{id}/preview', 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}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invalidate' => 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}/preview"
payload := strings.NewReader("{\n \"invalidate\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://pilotstatus.com.br/v1/flows/{id}/preview")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invalidate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/flows/{id}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invalidate\": false\n}"
response = http.request(request)
puts response.read_body{
"flowId": "cmf1a2b3c4d5e6f7g8h9i0j1",
"previewUrl": "https://business.facebook.com/wa/manage/flows/1122334455/preview/?token=b9d6b0c8-1c2f-4f0e-9b1a-3c4d5e6f7a8b",
"expiresAt": "2026-09-08T12:00:00+0000",
"invalidated": false,
"requiresLogin": false,
"warning": "Este link é público: quem tiver a URL abre o Flow sem nenhum login, então encaminhá-lo é compartilhar o formulário. E o preview não é sandbox: num Flow data_exchange a Meta chama o seu endpoint de verdade, e o que ele gravar fica gravado.",
"warningEN": "This link is public: anyone holding the URL opens the Flow with no login at all, so forwarding it shares the form. And the preview is not a sandbox: on a data_exchange Flow, Meta calls your endpoint for real, and whatever it writes stays written."
}{
"error": "invalidate precisa ser um booleano (true ou false) e é recusado como texto: `\"true\"` seria lido como \"não invalide\" e deixaria vivo um link que você acredita ter expirado, e `\"false\"` é truthy e expiraria um link em circulação. Nos dois casos a resposta pareceria sucesso.",
"errorEN": "invalidate must be a boolean (true or false); a string is refused: `\"true\"` would read as \"do not invalidate\" and leave alive a link you believe expired, and `\"false\"` is truthy and would expire a link still in circulation. Either way the answer would look like success.",
"code": "FLOW_PREVIEW_INVALIDATE_INVALID"
}{
"error": "Unauthorized"
}{
"error": "This endpoint acts on a single WhatsApp number: send the x-whatsapp-number-id header naming the number to act on (its id or instance id from GET /v1/numbers) | Este endpoint atua sobre um único número de WhatsApp: envie o header x-whatsapp-number-id indicando o número desejado (o id dele ou o id da instância, obtidos em GET /v1/numbers)",
"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": "Erro interno do servidor.",
"errorEN": "Internal server error.",
"code": "INTERNAL_ERROR"
}{
"error": "A Meta não devolveu link de preview para este Flow. Tente de novo.",
"errorEN": "Meta returned no preview link for this Flow. Try again.",
"code": "FLOW_PREVIEW_UNAVAILABLE"
}Parámetros de ruta
Cuerpo
Respuesta
Un enlace público de vista previa
¿Esta página le ayudó?
curl --request POST \
--url https://pilotstatus.com.br/v1/flows/{id}/preview \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"invalidate": false
}
'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/preview"
payload = { "invalidate": False }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({invalidate: false})
};
fetch('https://pilotstatus.com.br/v1/flows/{id}/preview', 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}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invalidate' => 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}/preview"
payload := strings.NewReader("{\n \"invalidate\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://pilotstatus.com.br/v1/flows/{id}/preview")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invalidate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/flows/{id}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invalidate\": false\n}"
response = http.request(request)
puts response.read_body{
"flowId": "cmf1a2b3c4d5e6f7g8h9i0j1",
"previewUrl": "https://business.facebook.com/wa/manage/flows/1122334455/preview/?token=b9d6b0c8-1c2f-4f0e-9b1a-3c4d5e6f7a8b",
"expiresAt": "2026-09-08T12:00:00+0000",
"invalidated": false,
"requiresLogin": false,
"warning": "Este link é público: quem tiver a URL abre o Flow sem nenhum login, então encaminhá-lo é compartilhar o formulário. E o preview não é sandbox: num Flow data_exchange a Meta chama o seu endpoint de verdade, e o que ele gravar fica gravado.",
"warningEN": "This link is public: anyone holding the URL opens the Flow with no login at all, so forwarding it shares the form. And the preview is not a sandbox: on a data_exchange Flow, Meta calls your endpoint for real, and whatever it writes stays written."
}{
"error": "invalidate precisa ser um booleano (true ou false) e é recusado como texto: `\"true\"` seria lido como \"não invalide\" e deixaria vivo um link que você acredita ter expirado, e `\"false\"` é truthy e expiraria um link em circulação. Nos dois casos a resposta pareceria sucesso.",
"errorEN": "invalidate must be a boolean (true or false); a string is refused: `\"true\"` would read as \"do not invalidate\" and leave alive a link you believe expired, and `\"false\"` is truthy and would expire a link still in circulation. Either way the answer would look like success.",
"code": "FLOW_PREVIEW_INVALIDATE_INVALID"
}{
"error": "Unauthorized"
}{
"error": "This endpoint acts on a single WhatsApp number: send the x-whatsapp-number-id header naming the number to act on (its id or instance id from GET /v1/numbers) | Este endpoint atua sobre um único número de WhatsApp: envie o header x-whatsapp-number-id indicando o número desejado (o id dele ou o id da instância, obtidos em GET /v1/numbers)",
"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": "Erro interno do servidor.",
"errorEN": "Internal server error.",
"code": "INTERNAL_ERROR"
}{
"error": "A Meta não devolveu link de preview para este Flow. Tente de novo.",
"errorEN": "Meta returned no preview link for this Flow. Try again.",
"code": "FLOW_PREVIEW_UNAVAILABLE"
}