One endpoint to rule them all
The Optimize and Deploy API lets you run a multi-stage pipeline that audits your pages, optimizes their content for AI search visibility, and optionally deploys the results to AXP β all from a single API call. One endpoint to bind your audit, optimization, and deployment workflows together. Each pipeline is asynchronous. You submit URLs, receive tracking tokens, and then poll for status or receive webhook callbacks as each stage completes.How it works
The pipeline chains three Scrunch products together. Each stage is optional β use only what you need.| Product | Pipeline stage | What it does | Required? |
|---|---|---|---|
| Site Audit | audit | Evaluates AI discoverability: robots.txt, bot access, content quality, content delivery | Always runs |
| Content Optimizer | optimizing | Rewrites page content to improve AI visibility for target prompts and personas | Set optimize: true |
| AXP (stage) | optimizing | Stages optimized content to AXP for review without publishing live | Set stage_axp: true + site_id |
| AXP (deploy) | deploying | Publishes optimized content to your AXP site as a new version | Set deploy_axp: true + site_id |
Configuration per product
Each product in the pipeline has its own configuration:- Site Audit β runs automatically on each URL, no extra config needed
- Content Optimizer β optionally configure
target_prompts,target_personas,target_sources,override_suggestions, and per-URLcustom_instructions - AXP β requires a
site_id(the RegisteredSite ULID). All URLs must belong to the siteβs domain. Per-URLretain_schema_typescontrols which JSON-LD schema types are kept (omit to retain all)
Pipeline stages
Every URL you submit moves through these stages in order:| Stage | orchestration_status | What happens |
|---|---|---|
| Audit | audit | Page is fetched and evaluated for AI discoverability (robots.txt, content quality, bot access) |
| Optimize | optimizing | Content is analyzed and rewritten to improve AI visibility for your target prompts and personas |
| Deploy | deploying | Optimized content is published to AXP as a new version |
| Done | completed | All stages finished successfully |
| Error | failed | Pipeline stopped at the failing stage |
The optimize and deploy stages only run if you set
optimize: true and deploy_axp: true in the request. With defaults, only the audit stage runs. To stage content for review without publishing live, set stage_axp: true instead of deploy_axp β see the orchestration lifecycle guide for the stage-only flow.When to use it
- You want to audit, optimize, and deploy pages without multiple API calls
- You need batch processing across many URLs
- You want webhook notifications when stages complete
- Youβre building automated content optimization pipelines
When not to use it
- You only need audit results β use the Site Audit API directly
- You want to query existing visibility data β use the Query API
- You need manual control over each optimization β use the Scrunch dashboard
Request patterns
Simple: list of URLs
Passurls when every URL should use the same optimization configuration:
Detailed: per-URL overrides
Passrequests when individual URLs need different prompts, personas, or sources:
Tracking progress
Each URL gets its own tracking token. Use it to poll for status:orchestration_status, timestamps, and result data as it becomes available.
For real-time updates without polling, configure webhooks to receive callbacks at each stage transition.
Set up webhooks
Get notified when audits, optimizations, and deployments complete.
Error codes
When a pipeline fails, the response includes a structured error code. Use these to identify what went wrong and where:| Prefix | Stage | Example codes |
|---|---|---|
ORCH-INIT | Initialization | Invalid URL, missing site_id, domain mismatch, quota exceeded |
ORCH-AUDIT | Audit | Fetch failed, timeout, page not found |
ORCH-OPT | Optimization | No content to optimize, LLM failure, source fetch failed |
ORCH-DEPLOY | Deployment | Site not found, AXP publish failed |
ORCH-HOOK | Webhook delivery | Delivery failed, SSRF blocked, timeout |
error_hash you can reference when contacting support.
Relationship to other Scrunch products
The Optimize and Deploy API is a composition layer that chains together three standalone Scrunch products:- Site Audit is always the first stage. It runs the same checks as
POST /{brand_id}/page-audits. - Content Optimizer uses audit results plus your target prompts and personas to generate optimized content.
- AXP deploys the optimized content as a new version to your registered site.
Dashboard visibility
Everything the pipeline does is fully visible in the Scrunch dashboard β audit results, optimization runs, and AXP deployments all appear in their respective pages exactly as if they had been performed manually. AXP deployments are tracked in the Version History with full change tracking, and you can compare original vs. optimized content side by side.Run your first pipeline
Go to the Optimize and Deploy Quickstart