Skip to main content
POST
/
orchestration
/
optimize-and-deploy
/
{brand_id}
Create Optimize And Deploy Pipeline
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>"
}
'
{
  "tokens": [
    {
      "token": "<string>",
      "url": "<string>",
      "status": "<string>"
    }
  ],
  "pipeline_id": "<string>",
  "status": "pending"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

brand_id
integer
required

Body

application/json

Request to create an orchestrated site audit pipeline.

urls
string[] | null

Simple list of URLs to audit (use this OR requests, not both)

requests
URLRequest · object[] | null

URL requests with per-URL optimization params (use this OR urls, not both)

optimize
boolean
default:false

Run content optimization after audit

deploy_axp
boolean
default:false

Deploy optimized content to AXP (requires optimize=true and site_id)

stage_axp
boolean
default:false

Audit + optimize + stage content without deploying live (requires optimize=true and site_id; mutually exclusive with deploy_axp)

site_id
string | null

RegisteredSite ID for AXP staging/deployment (required if deploy_axp or stage_axp)

target_prompts
string[] | null

Prompts for optimization (optional - if omitted, we infer from page content)

target_personas
PersonaTargetInput · object[] | null

Personas for optimization (optional - if omitted, we use defaults)

target_sources
string[] | null

Source URLs for optimization (optional)

override_suggestions
boolean
default:false

Skip AI suggestions, use only provided prompts/sources

webhook_url_override
string<uri> | null

Webhook URL override for this pipeline (uses brand default if not set)

Required string length: 1 - 2083

Response

Successful Response

Response when creating an orchestration pipeline.

tokens
OrchestrationRecord · object[]
required

Individual audit tokens

pipeline_id
string | null

Pipeline ID for batched AXP deployment (only set if deploy_axp=true)

status
string
default:pending

Pipeline status