Skip to main content
The Optimize and Deploy API is currently in early access. Contact your Customer Success representative to get access enabled for your organization.

Overview

This guide walks through the complete lifecycle of an Optimize and Deploy pipeline — from submitting URLs to handling results. By the end, you’ll understand how to track progress, handle errors, and integrate the pipeline into your workflow.

Pipeline flow

Each URL cascades through up to three stages. At every stage transition, a webhook fires so you can react in real time. Stages are optional — the pipeline exits early when the last enabled stage completes. Regardless of which stage is the final one, you always receive:
  1. The stage-specific webhook for the last stage that ran (e.g., audit.completed if audit-only)
  2. The pipeline.completed webhook once all URLs in the batch have finished

Webhook events per configuration

pipeline.completed fires only for deploy_axp: true batches — other configurations end with the last per-URL webhook.

What gets configured at each stage


1. Submit a pipeline

Simple mode: shared configuration

Stage-only mode: review before going live

Set stage_axp: true to run the full audit and optimize pipeline and push the optimized content to AXP as a staged change — without deploying a live version. Reviewers can then approve and publish from the Scrunch dashboard.
The pipeline finishes at orchestration_status: completed after staging, and the final per-URL webhook is optimization.completed with status: "staged". stage_axp and deploy_axp are mutually exclusive.

Detailed mode: per-URL overrides

What gets returned

pipeline_id is only set when deploy_axp is true — it groups all URLs into a single AXP deployment batch.

2. Track progress

Option A: Polling

Poll every 5–10 seconds. Audits typically complete in under 30 seconds; optimization may take 1–2 minutes depending on page complexity.

Option B: Webhooks

Configure a webhook URL for your brand and receive HTTP callbacks at each stage transition.

Webhook setup guide

Configure webhooks and verify signatures.

3. Handle stage transitions

Audit → Optimizing

Optimizing → Deploying

Deploying → Completed


4. Handle errors


5. Full working example


6. Viewing results in the Scrunch dashboard

Everything the pipeline does is visible in the Scrunch dashboard — exactly as if each step had been performed manually.
  • Site Audit resultsYour Brand → Site Audits
  • Content Optimizer resultsYour Brand → Optimizer → History
  • AXP deploymentsYour Brand → AXP → [site] → Version History
To roll back a deployment, use the Redeploy option on any previous version in the AXP version history.

Best practices

  • Use webhooks for production — more efficient and lower latency than polling
  • Handle partial failures — in a batch, some URLs may succeed while others fail; check each token individually
  • Set override_suggestions: true carefully — only your explicitly provided prompts and personas are used
  • Start with audit-only — validate URLs and check audit scores before committing to optimization and deployment

Orchestration API reference

Endpoint details, error codes, and schema reference.

Webhooks reference

Event types, payload schemas, and signature verification.