Upload Flow JSON
Uploads the Flow JSON of a Flow still in DRAFT.
Meta answers 200 with its refusals listed inside the body — this endpoint does not. POST /flows/{id}/assets returns HTTP 200 carrying validation_errors when it rejects the document, and a client reading only the status concludes the upload was accepted: the editor shows “saved”, the Flow keeps the PREVIOUS JSON, and the divergence surfaces when a customer opens the old form in production. This handler therefore ignores the Graph’s status and reads the list: a non-empty list is 422 FLOW_JSON_INVALID with validationErrors attached. A 200 from us always carries validationErrors: [], and the field is emitted explicitly on success so the client that branches on the status and the one that branches on the list reach the same conclusion.
flowJson is a string, never a nested object: Meta compiles the exact bytes, and re-serialising would move the positions its errors point at. The list is returned verbatim, untranslated — its shape is Meta’s. Body accepts only flowJson. Permission flows:manage.
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 POST \
--url https://pilotstatus.com.br/v1/flows/{id}/json \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"flowJson": "{\"version\":\"7.1\",\"screens\":[]}"
}
'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/json"
payload = { "flowJson": "{\"version\":\"7.1\",\"screens\":[]}" }
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({flowJson: '{"version":"7.1","screens":[]}'})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'flowJson' => '{"version":"7.1","screens":[]}'
]),
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}/json"
payload := strings.NewReader("{\n \"flowJson\": \"{\\\"version\\\":\\\"7.1\\\",\\\"screens\\\":[]}\"\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}/json")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flowJson\": \"{\\\"version\\\":\\\"7.1\\\",\\\"screens\\\":[]}\"\n}")
.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::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flowJson\": \"{\\\"version\\\":\\\"7.1\\\",\\\"screens\\\":[]}\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cmf1a2b3c4d5e6f7g8h9i0j1",
"validationErrors": []
}Authorizations
Your ps_ API key
Path Parameters
The local id of the Flow — the id field GET /v1/flows returns, never metaFlowId.
Body
The complete Flow JSON, as a STRING.
"{\"version\":\"7.1\",\"screens\":[]}"
Response
Accepted. validationErrors is always present and always empty here
Was this page helpful?
curl --request POST \
--url https://pilotstatus.com.br/v1/flows/{id}/json \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"flowJson": "{\"version\":\"7.1\",\"screens\":[]}"
}
'import requests
url = "https://pilotstatus.com.br/v1/flows/{id}/json"
payload = { "flowJson": "{\"version\":\"7.1\",\"screens\":[]}" }
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({flowJson: '{"version":"7.1","screens":[]}'})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'flowJson' => '{"version":"7.1","screens":[]}'
]),
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}/json"
payload := strings.NewReader("{\n \"flowJson\": \"{\\\"version\\\":\\\"7.1\\\",\\\"screens\\\":[]}\"\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}/json")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flowJson\": \"{\\\"version\\\":\\\"7.1\\\",\\\"screens\\\":[]}\"\n}")
.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::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flowJson\": \"{\\\"version\\\":\\\"7.1\\\",\\\"screens\\\":[]}\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cmf1a2b3c4d5e6f7g8h9i0j1",
"validationErrors": []
}