Before the advanced brief loop
Use an authenticated account with eligible paid-plan API access, owner/media-buyer permission for mutation, and enough AutoAdy creative allowance or credits for generation. Choose the intended assigned client workspace; pass itsclient_workspace_id explicitly when the account has more than one assignment. You need an evidence-backed brief version created by create-creative-brief or edit-creative-brief, with accessible source observations and already-approved offer/claim records. The ordinary Studio saved draft is a different object and cannot supply this version_id.
The public API does not currently discover or bootstrap all required approved records and the prepared approved-context hash. A fresh workspace cannot complete that preparation from these calls alone. The reference lists the creation fields; use real records from an already prepared reviewed workflow, or ask support about the missing preparation.
The create/edit response identifies the saved version. This is an illustrative partial response, not a live account result:
Brief version response
data.brief.id as version_id. briefId identifies the family, and version is a number; neither replaces the immutable version UUID. Editing returns a new version ID requiring its own review.
Make and inspect calls
These connected snippets assume you have retainedsavedCreateOrEditResponse and prepared preparedPlan as described above. This server-side JavaScript helper keeps HTTP and operation failures visible. Set AUTOADY_API_KEY securely and replace the account/workspace placeholders with authorized IDs. Avoid putting keys in browser code.
Read, approve, and generate
Read the saved version before approving it. Run the approval and generation calls only after the reviewer accepts its actual source, claims, and direction.Check or resume the original run
status.run is the normalized status; status.result.run is the durable record. A queued/running state needs another status read, rather than another generation. An uncertain provider outcome needs the original run’s recovery. Keep failed/cancelled states and errors for review; a resume call is not a guarantee of success.
Confirm pack.briefVersionId matches the version you reviewed, and the returned scope matches your account/workspace. The saved brief carries sourceSnapshotIds, observationIds, facts, and approved offer/claim version IDs for checking provenance.
The package returns artifactIds and artifactSpecs, whose entries include id, kind, and payload. For an image artifact, open its payload.url for human inspection. For a storyboard/fallback, read the package’s script, scenes, assets, and artifact payload. Check product details, text, claims, and source lineage before approval.
reviewedArtifactId is the ID of the artifact the human actually inspected. A package ID or run ID is not an artifact ID. Approval records review; these calls do not publish Meta ads.
Preview and approve a test plan
This separate example uses your prepared plan object,preparedPlan. It must supply the preview-meta-test-plan fields, including matching account/campaign/ad-set/audience/placement scope, an approved brief reference, at least two distinct approved generated-artifact references, allocation totaling 100, dates/window, compatible success/kill rules, budget, and matching evidence lineage.
These provenance references are caller-prepared inputs; setting an approved flag is not a way to create a real approval record. The endpoint validates the submitted plan contract rather than discovering those records for you.
previewHash and confirmationToken belong to that exact preview. Copy them from it; do not recalculate, invent, or reuse them after changing the plan. A valid HTTP 200 preview may instead be draft, with issues and a null confirmation token. Fix those inputs and preview again.
Both preview and approval retain launched: false, providerWrite: false, and spendAuthorized: false. Approved to prepare is not a launch or a spending authorization.
Recognize success, partial work, and refusal
These are illustrative response excerpts; the real response also contains the source wrapper and operation-specific fields.
A provider write can return HTTP 207 with partial results. The advanced preparation calls above are not those writes. Representative partial write excerpt:
operation_id and any receipt_id, check provider state for unresolved items, and follow the original request’s recovery. Replaying the whole batch with a new request ID can duplicate completed work. See error and retry rules.