Skip to content

    AI answer collection and runs

    Start a batch of checks

    Starts up to 20 managed checks in one request under a total credit cap.

    POST /v2/runs

    • Body workflow is managed_batch.
    • Body estimate is false. Default is false.

    Authentication and access

    Authentication
    Bearer API key
    Scopes
    collections:write
    Roles
    editor, owner, service
    Plans
    Optimizer, Analyzer
    Credits
    This operation can use credits.
    Billing access
    Required

    Estimate a batch of checks before you start the run.

    Parameters

    Request parameters
    NameWhereTypeRequiredDescription
    Idempotency-KeyheaderstringYes

    Request body

    {
      "estimate": false,
      "items": [
        {
          "idempotency_key": "example-run-0001",
          "request": {
            "brand_id": "00000000-0000-4000-8000-000000000001",
            "estimate_fingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "prompt_set_revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
          }
        }
      ],
      "max_total_credits": 100,
      "workflow": "managed_batch"
    }
    Request body fields 1
    NameTypeRequiredDescription
    estimatefalseNo
    itemsarray of objectYes
    items[].idempotency_keystringYes
    items[].requestobjectYes
    items[].request.brand_idstring (uuid)Yes
    items[].request.estimate_fingerprintstringYes
    items[].request.prompt_set_revisionstringYes
    max_total_creditsintegerYes
    workflow"managed_batch"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 POST "$AEO_API_BASE_URL/v2/runs" \
      -H "Authorization: Bearer $AEO_API_KEY" \
      -H "Idempotency-Key: $IDEMPOTENCY_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_post_runs(
            body=body,
            idempotency_key=environ["IDEMPOTENCY_KEY"],
        )
        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.v2PostRuns(
      body,
      {
        idempotencyKey: process.env.IDEMPOTENCY_KEY!,
      },
    );
    console.log(response.body);

    Responses

    HTTP 200

    Successful Response

    application/json

    Response fields are listed below.

    HTTP 200 response fields 1
    NameTypeRequiredDescription
    dataarray of object | objectYesThe requested result. See the fields below for its contents.
    data[].brand_idstring (uuid)Yes
    data[].dataobjectConditional
    data[].data.brand_idstringConditional
    data[].data.charged_creditsintegerConditional
    data[].data.check_idstring | nullConditional
    data[].data.check_urlstring | nullConditional
    data[].data.citation_status"in_progress" | "completed"NoCitation preparation status for this run, when applicable.
    data[].data.created_atstringConditional
    data[].data.estimated_creditsintegerConditional
    data[].data.failure_reasonsarray of "access_restricted" | "limit_reached" | "input_missing" | "approval_expired" | "cancelled" | "check_failed" | "check_incomplete"Conditional
    data[].data.hold_reasonsarray of "retry_pending" | "under_review"Conditional
    data[].data.idstringNo
    data[].data.phasestring | nullConditional
    data[].data.progressobjectConditional
    data[].data.progress.by_locationarray of objectNo
    data[].data.progress.by_location[].by_sourcearray of objectConditional
    data[].data.progress.by_location[].completed_stepsintegerConditional
    data[].data.progress.by_location[].expected_stepsintegerConditional
    data[].data.progress.by_location[].location_idstring (uuid)Conditional
    data[].data.progress.by_sourcearray of objectConditional
    data[].data.progress.completed_stepsintegerConditional
    data[].data.progress.expected_stepsintegerConditional
    data[].data.prompt_set_revisionstringConditional
    data[].data.released_creditsintegerConditional
    data[].data.report_idstring | nullConditional
    data[].data.report_status"pending" | "ready" | "not_available"Conditional
    data[].data.report_urlstring | nullConditional
    data[].data.reserved_creditsintegerConditional
    data[].data.run_idstringConditional
    data[].data.statusstringConditional
    data[].data.updated_atstringConditional
    data[].data.v2_run_idstringNo
    data[].data.websitestring | nullConditional
    data[].idempotency_keystringYes
    data[].status202 | integerYes
    data[].errorobjectConditional
    data[].error.codestringConditional
    data[].error.field_errorsarray of objectNo
    data[].error.field_errors[].fieldstring | nullConditional
    data[].error.field_errors[].messagestringConditional
    data[].error.messagestringConditional
    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.

    AI answer collection and runs reference