curl --request POST \
--url https://api.vellaro.io/api/v1/admin/cms/ai/compose \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instruction": "<string>",
"current_blocks": [
{}
],
"page_type": "standard",
"scope": "page",
"brand": {
"name": "<string>",
"voice": "<string>",
"sector": "<string>"
},
"locales": [
"<string>"
],
"default_locale": "<string>",
"max_retries": 2,
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locale": "<string>"
}
'import requests
url = "https://api.vellaro.io/api/v1/admin/cms/ai/compose"
payload = {
"instruction": "<string>",
"current_blocks": [{}],
"page_type": "standard",
"scope": "page",
"brand": {
"name": "<string>",
"voice": "<string>",
"sector": "<string>"
},
"locales": ["<string>"],
"default_locale": "<string>",
"max_retries": 2,
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locale": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
instruction: '<string>',
current_blocks: [{}],
page_type: 'standard',
scope: 'page',
brand: {name: '<string>', voice: '<string>', sector: '<string>'},
locales: ['<string>'],
default_locale: '<string>',
max_retries: 2,
page_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
locale: '<string>'
})
};
fetch('https://api.vellaro.io/api/v1/admin/cms/ai/compose', 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://api.vellaro.io/api/v1/admin/cms/ai/compose",
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([
'instruction' => '<string>',
'current_blocks' => [
[
]
],
'page_type' => 'standard',
'scope' => 'page',
'brand' => [
'name' => '<string>',
'voice' => '<string>',
'sector' => '<string>'
],
'locales' => [
'<string>'
],
'default_locale' => '<string>',
'max_retries' => 2,
'page_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'locale' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.vellaro.io/api/v1/admin/cms/ai/compose"
payload := strings.NewReader("{\n \"instruction\": \"<string>\",\n \"current_blocks\": [\n {}\n ],\n \"page_type\": \"standard\",\n \"scope\": \"page\",\n \"brand\": {\n \"name\": \"<string>\",\n \"voice\": \"<string>\",\n \"sector\": \"<string>\"\n },\n \"locales\": [\n \"<string>\"\n ],\n \"default_locale\": \"<string>\",\n \"max_retries\": 2,\n \"page_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locale\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.vellaro.io/api/v1/admin/cms/ai/compose")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instruction\": \"<string>\",\n \"current_blocks\": [\n {}\n ],\n \"page_type\": \"standard\",\n \"scope\": \"page\",\n \"brand\": {\n \"name\": \"<string>\",\n \"voice\": \"<string>\",\n \"sector\": \"<string>\"\n },\n \"locales\": [\n \"<string>\"\n ],\n \"default_locale\": \"<string>\",\n \"max_retries\": 2,\n \"page_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locale\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/cms/ai/compose")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instruction\": \"<string>\",\n \"current_blocks\": [\n {}\n ],\n \"page_type\": \"standard\",\n \"scope\": \"page\",\n \"brand\": {\n \"name\": \"<string>\",\n \"voice\": \"<string>\",\n \"sector\": \"<string>\"\n },\n \"locales\": [\n \"<string>\"\n ],\n \"default_locale\": \"<string>\",\n \"max_retries\": 2,\n \"page_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locale\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"blocks": [
{}
],
"status": "ok",
"explanation": "",
"attempts": 0,
"errors": [
"<string>"
],
"warnings": [
"<string>"
],
"requires_human_review": false,
"provider": "<string>",
"model": "<string>"
},
"meta": {
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
},
"error": "<string>",
"error_code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Compose
Compose/modify a page’s block-tree from an NL instruction (draft-only).
curl --request POST \
--url https://api.vellaro.io/api/v1/admin/cms/ai/compose \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instruction": "<string>",
"current_blocks": [
{}
],
"page_type": "standard",
"scope": "page",
"brand": {
"name": "<string>",
"voice": "<string>",
"sector": "<string>"
},
"locales": [
"<string>"
],
"default_locale": "<string>",
"max_retries": 2,
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locale": "<string>"
}
'import requests
url = "https://api.vellaro.io/api/v1/admin/cms/ai/compose"
payload = {
"instruction": "<string>",
"current_blocks": [{}],
"page_type": "standard",
"scope": "page",
"brand": {
"name": "<string>",
"voice": "<string>",
"sector": "<string>"
},
"locales": ["<string>"],
"default_locale": "<string>",
"max_retries": 2,
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locale": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
instruction: '<string>',
current_blocks: [{}],
page_type: 'standard',
scope: 'page',
brand: {name: '<string>', voice: '<string>', sector: '<string>'},
locales: ['<string>'],
default_locale: '<string>',
max_retries: 2,
page_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
locale: '<string>'
})
};
fetch('https://api.vellaro.io/api/v1/admin/cms/ai/compose', 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://api.vellaro.io/api/v1/admin/cms/ai/compose",
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([
'instruction' => '<string>',
'current_blocks' => [
[
]
],
'page_type' => 'standard',
'scope' => 'page',
'brand' => [
'name' => '<string>',
'voice' => '<string>',
'sector' => '<string>'
],
'locales' => [
'<string>'
],
'default_locale' => '<string>',
'max_retries' => 2,
'page_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'locale' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.vellaro.io/api/v1/admin/cms/ai/compose"
payload := strings.NewReader("{\n \"instruction\": \"<string>\",\n \"current_blocks\": [\n {}\n ],\n \"page_type\": \"standard\",\n \"scope\": \"page\",\n \"brand\": {\n \"name\": \"<string>\",\n \"voice\": \"<string>\",\n \"sector\": \"<string>\"\n },\n \"locales\": [\n \"<string>\"\n ],\n \"default_locale\": \"<string>\",\n \"max_retries\": 2,\n \"page_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locale\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.vellaro.io/api/v1/admin/cms/ai/compose")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instruction\": \"<string>\",\n \"current_blocks\": [\n {}\n ],\n \"page_type\": \"standard\",\n \"scope\": \"page\",\n \"brand\": {\n \"name\": \"<string>\",\n \"voice\": \"<string>\",\n \"sector\": \"<string>\"\n },\n \"locales\": [\n \"<string>\"\n ],\n \"default_locale\": \"<string>\",\n \"max_retries\": 2,\n \"page_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locale\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/cms/ai/compose")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instruction\": \"<string>\",\n \"current_blocks\": [\n {}\n ],\n \"page_type\": \"standard\",\n \"scope\": \"page\",\n \"brand\": {\n \"name\": \"<string>\",\n \"voice\": \"<string>\",\n \"sector\": \"<string>\"\n },\n \"locales\": [\n \"<string>\"\n ],\n \"default_locale\": \"<string>\",\n \"max_retries\": 2,\n \"page_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locale\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"blocks": [
{}
],
"status": "ok",
"explanation": "",
"attempts": 0,
"errors": [
"<string>"
],
"warnings": [
"<string>"
],
"requires_human_review": false,
"provider": "<string>",
"model": "<string>"
},
"meta": {
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
},
"error": "<string>",
"error_code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Autorizzazioni
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corpo
DTO for the admin HTTP layer (cms_ai/router.py).
The engine itself takes explicit keyword arguments (DB-agnostic); this model
only shapes the request envelope the router validates and translates into a
compose_blocks(...) call.
ANTI-INJECTION: brand, locales, default_locale and page_type
are resolved SERVER-SIDE from the tenant (active languages, store name/voice,
the page's slug). They stay on the model for the engine's own re-use, but the
router ignores any client-sent value for them — a caller can never steer
the brand voice, spoof the active locales, or downgrade a legal page's review
gate. Only instruction, current_blocks, scope, page_id and
max_retries are honoured from the request body.
1 - 8000page, block Brand signals that steer CONTENT and VOICE only — never styling.
The F0 schema exposes no colour/style props, so brand can never leak into the design by construction; this only shapes the words the model writes.
Show child attributes
Show child attributes
0 <= x <= 510