Skip to content

The safety model (preview, apply, review IDs and expiry)

Every change is a stored review first and runs only after a second call with its review ID and an idempotency key. Paused defaults, expiry and job recovery.

Last updated

On this page

AdMassy never lets an assistant (or API client) change Meta in one call. Every write is preview, then apply, and the result is a background job.

Step 1: preview

The assistant asks for a change. Nothing changes in Meta. The response is a stored review with:

  • a review ID (previewId),
  • the exact changes that would be sent to Meta, with before/after values for edits,
  • warnings (budget, objective, missing fields …),
  • expiresAt, the time the review stops being valid,
  • for deletions and other risky actions, a confirmation text such as DELETE 2 CAMPAIGNS.

A good assistant shows you this summary and waits for your OK.

Step 2: apply

After your OK, the assistant submits the review with its previewId, a new idempotencyKey, and confirm when the review asked for it. The job runs exactly what was reviewed, not a new interpretation of your request. There are two shapes:

Preview/apply pairs: two different tools.

Review withSubmit with
preview (or preview_draft)launch (or launch_draft)
preview_duplicateduplicate
preview_hierarchy_copycopy_hierarchy
preview_status_changeapply_status_change
preview_ad_editapply_ad_edit
preview_ad_edit_batchapply_ad_edit_batch
preview_bulk_manageapply_bulk_manage
preview_bulk_deleteapply_bulk_delete
preview_campaign_budgetapply_campaign_budget

Short-name tools: the same tool is called twice. The first call returns the review; the second passes only accountId, previewId and idempotencyKey (plus confirm). Examples: launch_ads, update_status, update_budget, update_bidding, edit_ads, duplicate_campaign, duplicate_adset, duplicate_ad, create_campaign, create_adset, delete_entities, launch_meta_post_ids, reply_to_comment, hide_comment. meta_write_review re-reads such a review.

The submission returns a tool result with the job (over the REST API: HTTP 202).

Step 3: follow the job

Call get_batch_status every 10–30 seconds until it returns stopPolling: true. A waitingForRateLimit flag means Meta asked AdMassy to slow down; the job resumes on its own. Then use get_batch_delivery or get_delivery_diagnostics to see what Meta created and whether ads deliver.

How long a review is valid

ReviewValid for
Launch previews, duplication, hierarchy copies, status changes, campaign budgets, ad edits (single and batch), bulk manage, bulk delete, review of the remaining launch10 minutes
Meta-write reviews from short-name tools such as create_campaign, create_adset, update_bidding, delete_entities, comment moderation and organic posts15 minutes

Every review shows its exact expiresAt. Once submitted, a job completes even if it later waits for a Meta rate limit.

Review expired ("… review expired; preview again"): ask for a new preview. Object changed since review ("Status changed since review", "Ad or destination changed since review"): someone changed the object in the meantime; reload it and preview again. A review ID is never reused for a different change.

Rules that keep it safe

  • Paused by default: new campaigns, ad sets and ads are created paused. ACTIVE only when you ask for it, and the review says so.
  • Typed confirmation: deletes and other irreversible actions need the exact text from the review in confirm.
  • Idempotency: the key is 8–200 characters. If the outcome is unknown (timeout, dropped connection), resend the same key with the same payload; you get the same job, not a second launch.
  • Re-check before writing: the worker reads the target again and stops if it changed since the review.
  • Close unused reviews: close_ad_edit_review, close_bulk_manage_review, close_bulk_delete_review and close_ad_edit_batch end a review; they never cancel a submitted job.

When a job does not finish cleanly

  • retry_job retries failed items of a job.
  • review_remaining_launch creates a new review for the ads a launch did not create.
  • reconcile_job links an item marked Needs check to the real Meta object instead of creating a duplicate.
  • cancel_job stops queued or scheduled work.
  • set_upload_quota_resume lets an upload job resume automatically after a Meta upload quota.

The same flow in the UI and API

The in-app Review buttons, the REST API (Idempotency-Key header) and the CLI use this exact mechanism.

Was this article helpful?