curl --request POST \
--url https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"urls": [
"<string>"
],
"requests": [
{
"url": "<string>",
"target_prompts": [
"<string>"
],
"target_personas": [
{
"name": "<string>",
"description": "<string>"
}
],
"target_sources": [
"<string>"
],
"custom_instructions": "<string>",
"override_suggestions": true,
"retain_schema_types": [
"<string>"
]
}
],
"optimize": false,
"deploy_axp": false,
"stage_axp": false,
"site_id": "<string>",
"target_prompts": [
"<string>"
],
"target_personas": [
{
"name": "<string>",
"description": "<string>"
}
],
"target_sources": [
"<string>"
],
"override_suggestions": false,
"webhook_url_override": "<string>"
}
'import requests
url = "https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}"
payload = {
"urls": ["<string>"],
"requests": [
{
"url": "<string>",
"target_prompts": ["<string>"],
"target_personas": [
{
"name": "<string>",
"description": "<string>"
}
],
"target_sources": ["<string>"],
"custom_instructions": "<string>",
"override_suggestions": True,
"retain_schema_types": ["<string>"]
}
],
"optimize": False,
"deploy_axp": False,
"stage_axp": False,
"site_id": "<string>",
"target_prompts": ["<string>"],
"target_personas": [
{
"name": "<string>",
"description": "<string>"
}
],
"target_sources": ["<string>"],
"override_suggestions": False,
"webhook_url_override": "<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({
urls: ['<string>'],
requests: [
{
url: '<string>',
target_prompts: ['<string>'],
target_personas: [{name: '<string>', description: '<string>'}],
target_sources: ['<string>'],
custom_instructions: '<string>',
override_suggestions: true,
retain_schema_types: ['<string>']
}
],
optimize: false,
deploy_axp: false,
stage_axp: false,
site_id: '<string>',
target_prompts: ['<string>'],
target_personas: [{name: '<string>', description: '<string>'}],
target_sources: ['<string>'],
override_suggestions: false,
webhook_url_override: '<string>'
})
};
fetch('https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}', 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.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}",
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([
'urls' => [
'<string>'
],
'requests' => [
[
'url' => '<string>',
'target_prompts' => [
'<string>'
],
'target_personas' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'target_sources' => [
'<string>'
],
'custom_instructions' => '<string>',
'override_suggestions' => true,
'retain_schema_types' => [
'<string>'
]
]
],
'optimize' => false,
'deploy_axp' => false,
'stage_axp' => false,
'site_id' => '<string>',
'target_prompts' => [
'<string>'
],
'target_personas' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'target_sources' => [
'<string>'
],
'override_suggestions' => false,
'webhook_url_override' => '<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.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}"
payload := strings.NewReader("{\n \"urls\": [\n \"<string>\"\n ],\n \"requests\": [\n {\n \"url\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"custom_instructions\": \"<string>\",\n \"override_suggestions\": true,\n \"retain_schema_types\": [\n \"<string>\"\n ]\n }\n ],\n \"optimize\": false,\n \"deploy_axp\": false,\n \"stage_axp\": false,\n \"site_id\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"override_suggestions\": false,\n \"webhook_url_override\": \"<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.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"<string>\"\n ],\n \"requests\": [\n {\n \"url\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"custom_instructions\": \"<string>\",\n \"override_suggestions\": true,\n \"retain_schema_types\": [\n \"<string>\"\n ]\n }\n ],\n \"optimize\": false,\n \"deploy_axp\": false,\n \"stage_axp\": false,\n \"site_id\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"override_suggestions\": false,\n \"webhook_url_override\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}")
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 \"urls\": [\n \"<string>\"\n ],\n \"requests\": [\n {\n \"url\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"custom_instructions\": \"<string>\",\n \"override_suggestions\": true,\n \"retain_schema_types\": [\n \"<string>\"\n ]\n }\n ],\n \"optimize\": false,\n \"deploy_axp\": false,\n \"stage_axp\": false,\n \"site_id\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"override_suggestions\": false,\n \"webhook_url_override\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"tokens": [
{
"token": "<string>",
"url": "<string>",
"status": "<string>"
}
],
"pipeline_id": "<string>",
"status": "pending"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Optimize And Deploy Pipeline
Create an orchestrated pipeline: audit pages, optimize content, and deploy to AXP
curl --request POST \
--url https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"urls": [
"<string>"
],
"requests": [
{
"url": "<string>",
"target_prompts": [
"<string>"
],
"target_personas": [
{
"name": "<string>",
"description": "<string>"
}
],
"target_sources": [
"<string>"
],
"custom_instructions": "<string>",
"override_suggestions": true,
"retain_schema_types": [
"<string>"
]
}
],
"optimize": false,
"deploy_axp": false,
"stage_axp": false,
"site_id": "<string>",
"target_prompts": [
"<string>"
],
"target_personas": [
{
"name": "<string>",
"description": "<string>"
}
],
"target_sources": [
"<string>"
],
"override_suggestions": false,
"webhook_url_override": "<string>"
}
'import requests
url = "https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}"
payload = {
"urls": ["<string>"],
"requests": [
{
"url": "<string>",
"target_prompts": ["<string>"],
"target_personas": [
{
"name": "<string>",
"description": "<string>"
}
],
"target_sources": ["<string>"],
"custom_instructions": "<string>",
"override_suggestions": True,
"retain_schema_types": ["<string>"]
}
],
"optimize": False,
"deploy_axp": False,
"stage_axp": False,
"site_id": "<string>",
"target_prompts": ["<string>"],
"target_personas": [
{
"name": "<string>",
"description": "<string>"
}
],
"target_sources": ["<string>"],
"override_suggestions": False,
"webhook_url_override": "<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({
urls: ['<string>'],
requests: [
{
url: '<string>',
target_prompts: ['<string>'],
target_personas: [{name: '<string>', description: '<string>'}],
target_sources: ['<string>'],
custom_instructions: '<string>',
override_suggestions: true,
retain_schema_types: ['<string>']
}
],
optimize: false,
deploy_axp: false,
stage_axp: false,
site_id: '<string>',
target_prompts: ['<string>'],
target_personas: [{name: '<string>', description: '<string>'}],
target_sources: ['<string>'],
override_suggestions: false,
webhook_url_override: '<string>'
})
};
fetch('https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}', 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.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}",
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([
'urls' => [
'<string>'
],
'requests' => [
[
'url' => '<string>',
'target_prompts' => [
'<string>'
],
'target_personas' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'target_sources' => [
'<string>'
],
'custom_instructions' => '<string>',
'override_suggestions' => true,
'retain_schema_types' => [
'<string>'
]
]
],
'optimize' => false,
'deploy_axp' => false,
'stage_axp' => false,
'site_id' => '<string>',
'target_prompts' => [
'<string>'
],
'target_personas' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'target_sources' => [
'<string>'
],
'override_suggestions' => false,
'webhook_url_override' => '<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.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}"
payload := strings.NewReader("{\n \"urls\": [\n \"<string>\"\n ],\n \"requests\": [\n {\n \"url\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"custom_instructions\": \"<string>\",\n \"override_suggestions\": true,\n \"retain_schema_types\": [\n \"<string>\"\n ]\n }\n ],\n \"optimize\": false,\n \"deploy_axp\": false,\n \"stage_axp\": false,\n \"site_id\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"override_suggestions\": false,\n \"webhook_url_override\": \"<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.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"<string>\"\n ],\n \"requests\": [\n {\n \"url\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"custom_instructions\": \"<string>\",\n \"override_suggestions\": true,\n \"retain_schema_types\": [\n \"<string>\"\n ]\n }\n ],\n \"optimize\": false,\n \"deploy_axp\": false,\n \"stage_axp\": false,\n \"site_id\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"override_suggestions\": false,\n \"webhook_url_override\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/{brand_id}")
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 \"urls\": [\n \"<string>\"\n ],\n \"requests\": [\n {\n \"url\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"custom_instructions\": \"<string>\",\n \"override_suggestions\": true,\n \"retain_schema_types\": [\n \"<string>\"\n ]\n }\n ],\n \"optimize\": false,\n \"deploy_axp\": false,\n \"stage_axp\": false,\n \"site_id\": \"<string>\",\n \"target_prompts\": [\n \"<string>\"\n ],\n \"target_personas\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"target_sources\": [\n \"<string>\"\n ],\n \"override_suggestions\": false,\n \"webhook_url_override\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"tokens": [
{
"token": "<string>",
"url": "<string>",
"status": "<string>"
}
],
"pipeline_id": "<string>",
"status": "pending"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Request to create an orchestrated site audit pipeline.
Simple list of URLs to audit (use this OR requests, not both)
URL requests with per-URL optimization params (use this OR urls, not both)
Show child attributes
Show child attributes
Run content optimization after audit
Deploy optimized content to AXP (requires optimize=true and site_id)
Audit + optimize + stage content without deploying live (requires optimize=true and site_id; mutually exclusive with deploy_axp)
RegisteredSite ID for AXP staging/deployment (required if deploy_axp or stage_axp)
Prompts for optimization (optional - if omitted, we infer from page content)
Personas for optimization (optional - if omitted, we use defaults)
Show child attributes
Show child attributes
Source URLs for optimization (optional)
Skip AI suggestions, use only provided prompts/sources
Webhook URL override for this pipeline (uses brand default if not set)
1 - 2083Response
Successful Response
Was this page helpful?