Skip to content

    Content drafts and editorial generation

    Approve a draft

    Approve the exact copy the reviewer saw. Include the content checksum and expected revision to identify that copy.

    PATCH /v2/brands/{brand_id}/drafts/{draft_id}

    • Body transition is approve.

    Authentication and access

    Authentication
    Bearer API key
    Scopes
    optimizations:write
    Roles
    approver, editor, owner, publisher, service
    Plans
    Optimizer
    Credits
    No credit charge.
    • Action approve. Scope analytics:read. Roles approver, owner.

    Parameters

    Request parameters
    NameWhereTypeRequiredDescription
    brand_idpathstring (uuid)Yes
    draft_idpathstring (uuid)Yes

    Request body

    {
      "content_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "expected_revision": 1,
      "transition": "approve"
    }
    Request body fields 1
    NameTypeRequiredDescription
    content_sha256stringYes
    expected_revisionintegerYes
    transition"approve"Yes

    Request examples

    Set AEO_API_BASE_URL to https://api.aeoapi.dev and AEO_API_KEY to your server-side API key. Set the other environment variables to the values for your request.

    Save the JSON request body as request.json. Replace sample IDs, revisions and other values with your own.

    curl --fail-with-body -X PATCH "$AEO_API_BASE_URL/v2/brands/$BRAND_ID/drafts/$DRAFT_ID" \
      -H "Authorization: Bearer $AEO_API_KEY" \
      -H "Content-Type: application/json" \
      --data-binary @request.json
    import json
    from pathlib import Path
    from os import environ
    from aeo_sdk import AeoClient
    
    body = json.loads(Path("request.json").read_text())
    
    with AeoClient(environ["AEO_API_KEY"], base_url=environ["AEO_API_BASE_URL"]) as client:
        response = client.v2_patch_brands_brand_id_drafts_draft_id(
            brand_id=environ["BRAND_ID"],
            draft_id=environ["DRAFT_ID"],
            body=body,
        )
        print(response.body)
    import { AeoClient } from "@aeoapi/aeo-sdk";
    import { readFile } from "node:fs/promises";
    
    const client = new AeoClient(process.env.AEO_API_KEY!, {
      baseUrl: process.env.AEO_API_BASE_URL!,
    });
    const body = JSON.parse(await readFile("request.json", "utf8"));
    const response = await client.v2PatchBrandsBrandIdDraftsDraftId(
      process.env.BRAND_ID!,
      process.env.DRAFT_ID!,
      body,
    );
    console.log(response.body);

    Responses

    HTTP 200

    Successful Response

    application/json

    Response fields are listed below.

    HTTP 200 response fields 1
    NameTypeRequiredDescription
    dataobjectYesThe requested result. See the fields below for its contents.
    data.approved_content_sha256string | nullYesSHA-256 hash of the content approved for delivery.
    data.citation_lift_benchmarkobject | nullNo
    data.citation_lift_benchmark.benchmarkobject | nullConditional
    data.citation_lift_benchmark.benchmark.action_channelstringConditional
    data.citation_lift_benchmark.benchmark.after_answer_target_pairsintegerConditional
    data.citation_lift_benchmark.benchmark.after_citing_target_pairsintegerConditional
    data.citation_lift_benchmark.benchmark.before_answer_target_pairsintegerConditional
    data.citation_lift_benchmark.benchmark.before_citing_target_pairsintegerConditional
    data.citation_lift_benchmark.benchmark.eligible_targetsintegerConditional
    data.citation_lift_benchmark.benchmark.matched_target_cohortsintegerConditional
    data.citation_lift_benchmark.benchmark.mean_after_citation_ratenumberConditional
    data.citation_lift_benchmark.benchmark.mean_before_citation_ratenumberConditional
    data.citation_lift_benchmark.benchmark.mean_citation_rate_change_percentage_pointsnumberConditional
    data.citation_lift_benchmark.benchmark.median_citation_rate_change_percentage_pointsnumberConditional
    data.citation_lift_benchmark.benchmark.method"equal_weighted_targets_and_matched_cohorts"Conditional
    data.citation_lift_benchmark.benchmark.observationaltrueConditional
    data.citation_lift_benchmark.benchmark.report_generated_atstringConditional
    data.citation_lift_benchmark.benchmark.report_idstringConditional
    data.citation_lift_benchmark.benchmark.window_daysintegerConditional
    data.citation_lift_benchmark.reason"insufficient_access" | "no_saved_report" | "insufficient_eligible_targets" | "scan_limit_exceeded" | nullConditional
    data.claim_supportarray of objectYes
    data.claim_support[].claim_textstringYes
    data.claim_support[].passage_idstring (uuid)Yes
    data.claim_support[].source_excerptstringYes
    data.contentobject | nullYes
    data.content.bodystringConditional
    data.content.titlestringConditional
    data.content_method"customer_owned_passage_assembly" | "agency_edited"Yes
    data.content_sha256string | nullYesSHA-256 hash identifying this version of the content.
    data.created_atstring (date-time)Yes
    data.draft_idstring (uuid)YesIdentifies the draft associated with this result.
    data.format"blog" | "social" | "linkedin_article"Yes
    data.generation_guidancestring | nullYes
    data.handoffobject | nullYes
    data.handoff.content_sha256stringConditional
    data.handoff.created_atstring (date-time)Conditional
    data.handoff.delivery_claim_idstring (uuid) | nullNo
    data.handoff.destinationobjectConditional
    data.handoff.destination.destination_referencestringConditional
    data.handoff.destination.platform"cms" | "linkedin" | "reddit" | "youtube" | "other"Conditional
    data.handoff.handoff_idstring (uuid)Conditional
    data.item_idstring (uuid)Yes
    data.keywordsarray of objectYes
    data.keywords[].countrystringYes
    data.keywords[].difficulty_methodstring | nullNo
    data.keywords[].difficulty_scorenumber | nullNo
    data.keywords[].estimated_monthly_searchesinteger | nullNo
    data.keywords[].keywordstringYes
    data.keywords[].languagestringYes
    data.keywords[].measured_onstring (date)Yes
    data.keywords[].sourcestringYes
    data.keywords[].source_referencestringYes
    data.keywords[].volume_period_endstring (date) | nullNo
    data.keywords[].volume_period_startstring (date) | nullNo
    data.primary_keywordstringYes
    data.publication_failurestring | nullYes
    data.receiptobject | nullYes
    data.receipt.evidence_basis"publisher_reported"No
    data.receipt.published_atstring (date-time)Conditional
    data.receipt.published_urlstringConditional
    data.receipt.publisher_referencestringConditional
    data.receipt.reported_atstring (date-time)Conditional
    data.review_notestring | nullYes
    data.revisionintegerYes
    data.source_availability"current" | "missing"Yes
    data.source_passagesarray of objectYes
    data.source_passages[].content_revisionstring (uuid)Yes
    data.source_passages[].headingstringYes
    data.source_passages[].passage_idstring (uuid)Yes
    data.source_passages[].source_urlstringYes
    data.status"draft" | "in_review" | "changes_requested" | "approved" | "handed_off" | "publication_failed" | "published" | "archived"Yes
    data.updated_atstring (date-time)Yes
    data.voiceobjectYes
    data.voice.audiencestringYes
    data.voice.avoided_termsarray of stringNo
    data.voice.call_to_actionstring | nullNo
    data.voice.editorial_guidelinesstring | nullNo
    data.voice.languagestringYes
    data.voice.openingstring | nullNo
    data.voice.preferred_termsarray of stringNo
    data.voice.tonestringYes
    data.voice.writing_samplesarray of stringNo
    data.voice_checksobject | nullYes
    data.voice_checks.avoided_terms_presentarray of stringConditional
    data.voice_checks.copy_uses_primary_keywordbooleanConditional
    data.voice_checks.languagestringConditional
    data.voice_checks.preferred_terms_absentarray of stringConditional
    data.voice_checks.title_uses_primary_keywordbooleanConditional
    data.voice_revisionintegerYes
    metaobjectYesInformation about this response, including any warnings or pagination details.
    HTTP 200 response fields 2
    NameTypeRequiredDescription
    dataobjectYesThe requested result. See the fields below for its contents.
    data.created_atstring (date-time)Yes
    data.draft_idstring (uuid)YesIdentifies the draft associated with this result.
    data.format"product_fact_patch"Yes
    data.item_idstring (uuid)Yes
    data.patchobject | nullYes
    data.patch.approved_content_sha256string | nullNo
    data.patch.automatic_policyobject | nullNo
    data.patch.automatic_policy.artifact_typesarray of "llms_txt" | "json_ld" | "canonical_summary"Conditional
    data.patch.automatic_policy.domainsarray of stringConditional
    data.patch.automatic_policy.fact_sourcesarray of stringConditional
    data.patch.automatic_policy.max_changed_bytesintegerConditional
    data.patch.automatic_policy.max_targetsintegerConditional
    data.patch.automatic_policy.pathsarray of stringConditional
    data.patch.automatic_policy.versionstringConditional
    data.patch.content_sha256stringConditional
    data.patch.pause_reason"destination_drift" | "destination_unresolved" | nullNo
    data.patch.policy_approved_bystring (uuid) | nullNo
    data.patch.policy_versionstringConditional
    data.patch.source_content_revisionstring (uuid)Conditional
    data.patch.source_factobjectConditional
    data.patch.source_fact.amountstringConditional
    data.patch.source_fact.currencystringConditional
    data.patch.source_fact.depends_onarray of string (uuid)No
    data.patch.source_fact.effective_fromstring (date)Conditional
    data.patch.source_fact.event_idstring (uuid)Conditional
    data.patch.source_fact.marketstringConditional
    data.patch.source_fact.period"month" | "year" | "one_time"Conditional
    data.patch.source_fact.productstringConditional
    data.patch.source_fact.resolves_conflictbooleanNo
    data.patch.source_fact.sequenceintegerConditional
    data.patch.source_fact.sourcestringConditional
    data.patch.source_factsarray of objectConditional
    data.patch.source_facts[].amountstringConditional
    data.patch.source_facts[].currencystringConditional
    data.patch.source_facts[].depends_onarray of string (uuid)No
    data.patch.source_facts[].effective_fromstring (date)Conditional
    data.patch.source_facts[].event_idstring (uuid)Conditional
    data.patch.source_facts[].marketstringConditional
    data.patch.source_facts[].period"month" | "year" | "one_time"Conditional
    data.patch.source_facts[].productstringConditional
    data.patch.source_facts[].resolves_conflictbooleanNo
    data.patch.source_facts[].sequenceintegerConditional
    data.patch.source_facts[].sourcestringConditional
    data.patch.source_urlstringConditional
    data.patch.targetsarray of objectConditional
    data.patch.targets[].baseline_revisionstringConditional
    data.patch.targets[].connector"cms" | "edge"Conditional
    data.patch.targets[].contentstringConditional
    data.patch.targets[].content_sha256stringConditional
    data.patch.targets[].diffstringConditional
    data.patch.targets[].domainstringConditional
    data.patch.targets[].kind"llms_txt" | "json_ld" | "canonical_summary"Conditional
    data.patch.targets[].pathstringConditional
    data.patch.targets[].previous_sha256stringConditional
    data.patch.targets[].publish_claimobject | nullNo
    data.patch.targets[].publish_claim.expected_revisionstringConditional
    data.patch.targets[].publish_claim.expected_sha256stringConditional
    data.patch.targets[].publish_claim.idstring (uuid)Conditional
    data.patch.targets[].publish_receiptobject | nullNo
    data.patch.targets[].publish_receipt.claim_idstring (uuid)Conditional
    data.patch.targets[].publish_receipt.content_sha256stringConditional
    data.patch.targets[].publish_receipt.revisionstringConditional
    data.patch.targets[].rollback_claimobject | nullNo
    data.patch.targets[].rollback_claim.expected_revisionstringConditional
    data.patch.targets[].rollback_claim.expected_sha256stringConditional
    data.patch.targets[].rollback_claim.idstring (uuid)Conditional
    data.patch.targets[].rollback_contentstringConditional
    data.patch.targets[].rollback_receiptobject | nullNo
    data.patch.targets[].rollback_receipt.claim_idstring (uuid)Conditional
    data.patch.targets[].rollback_receipt.content_sha256stringConditional
    data.patch.targets[].rollback_receipt.revisionstringConditional
    data.patch.targets[].target_idstring (uuid)Conditional
    data.revisionintegerYes
    data.source_availability"current" | "missing"Yes
    data.status"draft" | "in_review" | "changes_requested" | "approved" | "handed_off" | "publication_failed" | "published" | "archived" | "rolled_back"Yes
    data.updated_atstring (date-time)Yes
    metaobjectYesInformation about this response, including any warnings or pagination details.
    meta.as_ofstring (date-time)YesThe point in time that the response represents.
    meta.cohort_versionstring | nullNoIdentifies the version of the group used to calculate the results.
    meta.collected_atstring (date-time) | nullYesWhen the data was collected, if available.
    meta.metric_versionstring | nullNoThe version of the metric definition used for these results.
    meta.next_cursorstring | nullYesWhen present, pass this value as cursor to request the next page with the same filters.
    meta.next_refresh_atstring (date-time) | nullYes
    meta.request_idstring (uuid)YesKeep this ID when reporting a problem with the request.
    meta.restricted_fieldsarray of stringNoFields that your current access does not allow the API to return.
    meta.rights_filteredbooleanYesIndicates whether access rights affected the returned data.
    meta.schema_version"1.0"YesThe version of the response format.
    meta.stalebooleanYes
    meta.warningsarray of stringYesRead these notes for limitations that affect the results.
    HTTP 200 response fields 3
    NameTypeRequiredDescription
    dataobjectYesThe requested result. See the fields below for its contents.
    data.accuracy_claim_idstring (uuid)Yes
    data.accuracy_source_pagesarray of objectYes
    data.accuracy_source_pages[].ownership"brand" | "competitor" | "third_party"Yes
    data.accuracy_source_pages[].scope"answer" | "claim"Yes
    data.accuracy_source_pages[].urlstringYes
    data.approved_content_sha256string | nullYesSHA-256 hash of the content approved for delivery.
    data.citation_lift_benchmarknullNo
    data.claim_supportarray of objectYes
    data.claim_support[].claim_textstringYes
    data.claim_support[].passage_idstring (uuid)Yes
    data.claim_support[].source_excerptstringYes
    data.contentobject | nullYes
    data.content.bodystringConditional
    data.content.titlestringConditional
    data.content_method"approved_accuracy_fact" | "agency_edited"Yes
    data.content_sha256string | nullYesSHA-256 hash identifying this version of the content.
    data.created_atstring (date-time)Yes
    data.draft_idstring (uuid)YesIdentifies the draft associated with this result.
    data.format"accuracy_fix"Yes
    data.generation_guidancestring | nullYes
    data.handoffobject | nullYes
    data.handoff.content_sha256stringConditional
    data.handoff.created_atstring (date-time)Conditional
    data.handoff.delivery_claim_idstring (uuid) | nullNo
    data.handoff.destinationobjectConditional
    data.handoff.destination.destination_referencestringConditional
    data.handoff.destination.platform"cms" | "linkedin" | "reddit" | "youtube" | "other"Conditional
    data.handoff.handoff_idstring (uuid)Conditional
    data.item_idstring (uuid)Yes
    data.keywordsarray of objectYes
    data.keywords[].countrystringYes
    data.keywords[].difficulty_methodstring | nullNo
    data.keywords[].difficulty_scorenumber | nullNo
    data.keywords[].estimated_monthly_searchesinteger | nullNo
    data.keywords[].keywordstringYes
    data.keywords[].languagestringYes
    data.keywords[].measured_onstring (date)Yes
    data.keywords[].sourcestringYes
    data.keywords[].source_referencestringYes
    data.keywords[].volume_period_endstring (date) | nullNo
    data.keywords[].volume_period_startstring (date) | nullNo
    data.primary_keywordstringYes
    data.publication_failurestring | nullYes
    data.receiptobject | nullYes
    data.receipt.evidence_basis"publisher_reported"No
    data.receipt.published_atstring (date-time)Conditional
    data.receipt.published_urlstringConditional
    data.receipt.publisher_referencestringConditional
    data.receipt.reported_atstring (date-time)Conditional
    data.review_notestring | nullYes
    data.revisionintegerYes
    data.source_availability"current" | "needs_review"Yes
    data.source_passagesarray of objectYes
    data.source_passages[].content_revisionstring (uuid)Yes
    data.source_passages[].headingstringYes
    data.source_passages[].passage_idstring (uuid)Yes
    data.source_passages[].source_urlstringYes
    data.status"draft" | "in_review" | "changes_requested" | "approved" | "handed_off" | "publication_failed" | "published" | "archived"Yes
    data.updated_atstring (date-time)Yes
    data.voiceobjectYes
    data.voice.audiencestringYes
    data.voice.avoided_termsarray of stringNo
    data.voice.call_to_actionstring | nullNo
    data.voice.editorial_guidelinesstring | nullNo
    data.voice.languagestringYes
    data.voice.openingstring | nullNo
    data.voice.preferred_termsarray of stringNo
    data.voice.tonestringYes
    data.voice.writing_samplesarray of stringNo
    data.voice_checksobject | nullYes
    data.voice_checks.avoided_terms_presentarray of stringConditional
    data.voice_checks.copy_uses_primary_keywordbooleanConditional
    data.voice_checks.languagestringConditional
    data.voice_checks.preferred_terms_absentarray of stringConditional
    data.voice_checks.title_uses_primary_keywordbooleanConditional
    data.voice_revisionintegerYes
    metaobjectYesInformation about this response, including any warnings or pagination details.
    meta.as_ofstring (date-time)YesThe point in time that the response represents.
    meta.cohort_versionstring | nullNoIdentifies the version of the group used to calculate the results.
    meta.collected_atstring (date-time) | nullYesWhen the data was collected, if available.
    meta.metric_versionstring | nullNoThe version of the metric definition used for these results.
    meta.next_cursorstring | nullYesWhen present, pass this value as cursor to request the next page with the same filters.
    meta.next_refresh_atstring (date-time) | nullYes
    meta.request_idstring (uuid)YesKeep this ID when reporting a problem with the request.
    meta.restricted_fieldsarray of stringNoFields that your current access does not allow the API to return.
    meta.rights_filteredbooleanYesIndicates whether access rights affected the returned data.
    meta.schema_version"1.0"YesThe version of the response format.
    meta.stalebooleanYes
    meta.warningsarray of stringYesRead these notes for limitations that affect the results.

    Errors

    Read code and message in the error response. Keep request_id when you contact support.

    Content drafts and editorial generation reference