---
title: "Create Optimize And Deploy Pipeline"
method: POST
path: "/orchestration/optimize-and-deploy/{brand_id}"
tags: ["orchestration"]
---

# Create Optimize And Deploy Pipeline

`POST /orchestration/optimize-and-deploy/{brand_id}`

Create an orchestrated pipeline: audit pages, optimize content, and deploy to AXP

## Path parameters

- `brand_id` integer, required

## Request body

- OrchestrationCreateRequest — Request to create an orchestrated site audit pipeline.
  - `urls` string[], nullable — Simple list of URLs to audit (use this OR requests, not both)
  - `requests` URLRequest[], nullable — URL requests with per-URL optimization params (use this OR urls, not both)
    - `url` string, required — URL to audit
    - `target_prompts` string[], nullable — Prompts for optimization (overrides batch-level prompts)
    - `target_personas` PersonaTargetInput[], nullable — Personas for optimization (overrides batch-level personas)
      - `name` string, required
      - `description` string, nullable
    - `target_sources` string[], nullable — Source URLs for optimization (overrides batch-level sources)
    - `custom_instructions` string, nullable — Custom instructions for this optimization. Stored as-is and treated as no custom instructions if empty/None at execute time. Callers wanting brand-default fallback must resolve it at submit time.
    - `override_suggestions` boolean, nullable — Skip AI suggestions (overrides batch-level setting)
    - `retain_schema_types` string[], nullable — JSON-LD schema types to retain. None = retain all (default); [] = retain none.
  - `optimize` boolean — Run content optimization after audit
  - `deploy_axp` boolean — Deploy optimized content to AXP (requires optimize=true and site_id)
  - `stage_axp` boolean — Audit + optimize + stage content without deploying live (requires optimize=true and site_id; mutually exclusive with deploy_axp)
  - `site_id` string, nullable — RegisteredSite ID for AXP staging/deployment (required if deploy_axp or stage_axp)
  - `target_prompts` string[], nullable — Prompts for optimization (optional - if omitted, we infer from page content)
  - `target_personas` PersonaTargetInput[], nullable — Personas for optimization (optional - if omitted, we use defaults)
    - `name` string, required
    - `description` string, nullable
  - `target_sources` string[], nullable — Source URLs for optimization (optional)
  - `override_suggestions` boolean — Skip AI suggestions, use only provided prompts/sources
  - `webhook_url_override` string, uri, nullable — Webhook URL override for this pipeline (uses brand default if not set)

## Response `200`

Successful Response

- OrchestrationCreateResponse — Response when creating an orchestration pipeline.
  - `pipeline_id` string, nullable — Pipeline ID for batched AXP deployment (only set if deploy_axp=true)
  - `tokens` OrchestrationRecord[], required — Individual audit tokens
    - `token` string, required
    - `url` string, required
    - `status` string, required
    - `orchestration_status` 'audit' | 'optimizing' | 'deploying' | 'completed' | 'failed', nullable
  - `status` string — Pipeline status

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/scrunch/apis/scrunch-data-api.md) · [All operations](https://skmtc.net/scrunch/apis/scrunch-data-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/scrunch/scrunch-data-api/revisions/3e09c2a06458/schema)
