Skip to content

    Review a draft before publishing

    Check which buyer questions a draft answers before you send it for editorial approval. Use a saved draft revision and question set so an editor can identify the exact inputs behind each finding.

    Before you start

    Use an Optimizer editor, owner or service key with analytics:read, audits:read and optimizations:read. Set AEO_API_KEY and BRAND_ID. You need a draft page saved as prepublish_draft and a question set saved as prepublish_prompts for that brand. Set DRAFT_REVISION and PROMPT_SET_REVISION to their revision UUIDs. For the upload requests, see save a pre-publish draft and save pre-publish questions.

    1. Review the saved draft and questions

    Generate REVIEW_KEY once with uuidgen. Send the same key and body if you need to repeat this request.

    curl --fail-with-body 'https://api.aeoapi.dev/v2/runs' \
      -H "Authorization: Bearer $AEO_API_KEY" \
      -H "Idempotency-Key: $REVIEW_KEY" \
      -H 'Content-Type: application/json' \
      --data-binary @- <<JSON
    {
      "workflow": "prepublish_review",
      "brand_id": "$BRAND_ID",
      "draft_revision": "$DRAFT_REVISION",
      "prompt_set_revision": "$PROMPT_SET_REVISION"
    }
    JSON

    Save the data.poll_url path returned with HTTP 202 in POLL_PATH. The run refers to the submitted revisions even if your working copy changes later.

    2. Inspect the passages behind the result

    curl --fail-with-body "https://api.aeoapi.dev$POLL_PATH" \
      -H "Authorization: Bearer $AEO_API_KEY"

    Use data.components.coverage to find a question the draft leaves unanswered. Read the relevant text in data.evidence.passages before editing. data.manifest identifies the inputs and data.expires_at tells you how long you can read the result. The review simulates how the page answers the saved questions. Actual citations require collected answers.

    3. Review the revision you intend to publish

    Save the edited page as a new draft revision. Repeat the first call with that revision, the same question set and a new idempotency key. Check whether the changed passage now covers the question. For a separate editorial draft awaiting approval, follow Submit and approve a draft.