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.

Prerequisites

  • A Scrunch workspace with Optimize and Deploy access enabled
  • An API key with Configure access
  • A brand ID for the brand you want to optimize
  • (Optional) A site ID if you want to deploy to AXP

Run your first pipeline

1

Set your credentials

export SCRUNCH_API_KEY="your-api-key-here"
export SCRUNCH_BRAND_ID="your-brand-id"
2

Submit URLs for audit and optimization

This example submits two URLs for audit and content optimization:
curl -X POST "https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/$SCRUNCH_BRAND_ID" \
  -H "Authorization: Bearer $SCRUNCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.com/page-a",
      "https://example.com/page-b"
    ],
    "optimize": true
  }'
Example response:
{
  "pipeline_id": null,
  "tokens": [
    {
      "token": "01JABC00000000000000001",
      "url": "https://example.com/page-a",
      "status": "pending",
      "orchestration_status": "audit"
    },
    {
      "token": "01JABC00000000000000002",
      "url": "https://example.com/page-b",
      "status": "pending",
      "orchestration_status": "audit"
    }
  ],
  "status": "pending"
}
3

Poll for status

Use a token from the response to check progress:
curl "https://api.scrunchai.com/v2/orchestration/optimize-and-deploy/$SCRUNCH_BRAND_ID/01JABC00000000000000001" \
  -H "Authorization: Bearer $SCRUNCH_API_KEY"
Example response (completed):
{
  "token": "01JABC00000000000000001",
  "url": "https://example.com/page-a",
  "status": "completed",
  "orchestration_status": "completed",
  "optimization_run_id": "01JOPTRUN0000000000000",
  "axp_version_id": null,
  "result": {
    "checks": [],
    "access_controls_score": 100,
    "content_delivery_score": 90,
    "content_quality_score": 85
  },
  "created_at": "2025-02-06T10:00:00Z",
  "updated_at": "2025-02-06T10:02:30Z"
}

Next steps

Orchestration overview

Learn about pipeline stages, error codes, and request patterns.

Pipeline lifecycle guide

Walk through the full lifecycle from submission to completion.

Set up webhooks

Get notified in real time instead of polling.