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 stages or deploys the results to AXP β all from a single API call. One endpoint to bind your audit, optimization, staging, 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.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, andoverride_suggestionsat the batch level or per-URL - AXP β requires a
site_id(the RegisteredSite ULID). All URLs must belong to the siteβs domain. Usestage_axp: trueto stage content for review without going live, ordeploy_axp: trueto publish a new live version. The two flags are mutually exclusive.
Pipeline stages
Every URL you submit moves through these stages in order: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. Set stage_axp: true instead of deploy_axp: true when you want optimized content staged on AXP for review without going live.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:
Stage to AXP without going live
Usestage_axp: true to run audit + optimize + stage content to AXP without publishing a live version. This is useful when you want to review optimized content in the Scrunch dashboard before manually deploying it.
orchestration_status: completed once content is staged. The response includes an optimization_run_id, but axp_version_id stays null because no live version is published.
stage_axp and deploy_axp are mutually exclusive β passing both returns a 422 validation error. stage_axp: true also requires optimize: true and a valid site_id whose AXP integration is active.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:
Each error includes a human-readable message and a short
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