Get Flow JSON
Reads the Flow JSON document Meta currently holds for this Flow, live from the Graph. flowJson is a string, returned byte for byte as Meta serves it — not parsed, not reformatted — so it can be edited and sent back to POST /v1/flows/{id}/json unchanged. Permission flows:read. The response is Cache-Control: no-store.
A Flow that has not reached Meta yet (metaFlowId: null) is 404 FLOW_NOT_FOUND. When Meta returns no document — a Flow that never received one, or a transient failure — the answer is 502 FLOW_JSON_UNAVAILABLE. Naming the number in the query (whatsappNumberId, numberId, wabaId, metaWabaId) is 400 FLOW_NUMBER_FROM_KEY; a refusal from Meta’s Graph is 400 with Meta’s reason in both languages.
Requires a number-scoped key. A tenant-scoped key must name the number with the x-whatsapp-number-id header, or it gets 403 TENANT_SCOPE_NOT_ALLOWED.
curl --request GET \
--url https://pilotstatus.com.br/v1/flows/{id}/json \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/json"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/flows/{id}/json', 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}/json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/flows/{id}/json"
req, _ := http.NewRequest("GET", 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.get("https://pilotstatus.com.br/v1/flows/{id}/json")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/flows/{id}/json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "cmf1a2b3c4d5e6f7g8h9i0j1",
"flowJson": "{\"version\":\"7.1\",\"screens\":[{\"id\":\"WELCOME_SCREEN\",\"title\":\"Welcome\",\"terminal\":true,\"layout\":{\"type\":\"SingleColumnLayout\",\"children\":[]}}]}"
}{
"error": "Esta rota não aceita whatsappNumberId na query: o número é o da própria chave de API. Use a chave do número onde o Flow vive.",
"errorEN": "This route does not accept whatsappNumberId in the query: the number is the API key's own. Use the key bound to the number the Flow lives on.",
"code": "FLOW_NUMBER_FROM_KEY"
}{
"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 o documento deste Flow. Se ele nunca recebeu um JSON, envie um; se já recebeu, tente de novo em instantes.",
"errorEN": "Meta returned no document for this Flow. If it never received a JSON, upload one; if it did, try again shortly.",
"code": "FLOW_JSON_UNAVAILABLE"
}Was this page helpful?
curl --request GET \
--url https://pilotstatus.com.br/v1/flows/{id}/json \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/json"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/flows/{id}/json', 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}/json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/flows/{id}/json"
req, _ := http.NewRequest("GET", 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.get("https://pilotstatus.com.br/v1/flows/{id}/json")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/flows/{id}/json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "cmf1a2b3c4d5e6f7g8h9i0j1",
"flowJson": "{\"version\":\"7.1\",\"screens\":[{\"id\":\"WELCOME_SCREEN\",\"title\":\"Welcome\",\"terminal\":true,\"layout\":{\"type\":\"SingleColumnLayout\",\"children\":[]}}]}"
}{
"error": "Esta rota não aceita whatsappNumberId na query: o número é o da própria chave de API. Use a chave do número onde o Flow vive.",
"errorEN": "This route does not accept whatsappNumberId in the query: the number is the API key's own. Use the key bound to the number the Flow lives on.",
"code": "FLOW_NUMBER_FROM_KEY"
}{
"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 o documento deste Flow. Se ele nunca recebeu um JSON, envie um; se já recebeu, tente de novo em instantes.",
"errorEN": "Meta returned no document for this Flow. If it never received a JSON, upload one; if it did, try again shortly.",
"code": "FLOW_JSON_UNAVAILABLE"
}