Skip to main content
Start a workflow by discovering accessible objects and capabilities. Resolve required IDs, review the proposed change, submit it, then inspect the result.

Rank campaign performance

  1. Call ad_accounts_list.
  2. Choose the accounts, dates, conversion event, and attribution window.
  3. Use insights_rank for compact highest and lowest rankings.
  4. Read the data-through date and warnings.
Set a minimum spend or conversion count to exclude results with too little data. For cost metrics such as CPA, lower values can be better.

Import custom values

Call custom_metrics_list to find an account metric. Prepare a small set of values with custom_metrics_import_prepare. For a CSV file, use custom_metrics_upload_create and upload the bytes with its signed grant. Read the preview with custom_metrics_import_get. Commit a valid task with custom_metrics_import_commit, then poll the same task ID. A failed task can leave some values applied. See Import custom metrics and Custom metric tools.

Create a draft rule

Call rules_schema, resolve accounts, and build the full rule definition. Supply a target filter, tasks with actions and optional conditions, and a schedule with time zone. Save as a draft with dry_run: true. Read the rule back and run its current version in dry-run mode. Review decisions before activation. See Rules.

Prepare a Launcher batch

Call launcher_discover, choose an account, and inspect saved creatives and templates. Upload or import media if you need new files. Select exact saved creative versions, resolve the selection, inspect an existing target where required, and preview the launch. Submit with one stable request key. Poll the launch and operation records, including partial failures.

Create Meta objects directly

Call actions_capabilities to check whether live changes are enabled. Creation and duplication tools default to dry_run: true; creation starts campaigns, ad sets, and ads paused. For media, call media_uploads_create to open the upload picker when your client supports it. media_uploads_complete uploads one to ten selected files and returns a result for each file. Check those results before using the media. For a signed upload without the picker, provide file metadata to media_uploads_create. Upload the file bytes using the returned URL, method, and headers before the URL expires. A successful upload saves the file in the workspace library. Use media_asset_id with Launcher tools or media_id with creatives_create. Create a campaign, then an ad set, then an ad with the required parent IDs. Review dry-run results. Use a new request ID when changing the request from validation to live execution. Inspect the action result after execution.

Reuse a successful setup

Use campaigns_duplicate, adsets_duplicate, or ads_duplicate to copy an existing Meta setup. Copies stay in the source account. An ad-set copy can target an existing campaign through destination_campaign_id; omit it to keep the source campaign. Ad-set copies stay paused. An ad copy can target an existing ad set when you supply its campaign and ad-set IDs together. Ad copies default to paused; an active copy requires an explicit status choice. To use a setup in a different account, prepare a new launch with that account’s assets and compatible template settings. Check its currency, Pages, pixels, audiences, and permissions before submitting. For successful Launcher tests, choose Promote successful tests and select the source ads. See Prepare and submit a launch.

Update existing Meta objects

Use campaigns_update, adsets_update, or ads_update for supported partial changes. Read the current object, select only the fields you intend to change, and run a dry run first. Budget values use account-currency minor units. Ad content edits require creative_policy: "replace". New creative content can trigger provider review and does not preserve the existing post engagement. Inspect the returned verification state: simulation, confirmed, or reconciliation_required. Read results before retrying an uncertain write.

Set and check Guardrails

Call guardrails_capabilities for current permission grants and settings schemas. Read existing policies with guardrails_list before creating another policy. Preview a draft with guardrails_targets_preview, then use a stable command request UUID for a policy write. Read the current policy version before guardrails_update or guardrails_delete. Direct action and AutoRules execution checks enabled policies again. A denial returns a structured receipt; read it with actions_get before a new write. See Set Guardrails, Guardrails tools, and Activity.

Save a confirmed fact

Resolve the scope, then call memory_remember only after an explicit save request or focused approval. Report the returned persistence state. Use memory_recall for relevant context and memory_get for an exact record.