Skip to Content
Actions

Propose: clone ad group

POST
/api/v1/accounts/{projectId}/actions/clone-ad-group

Proposes a clone_ad_group action. Returns 201 with an actionId and a mode of auto_applied or queued. mode is a decision snapshot, not an outcome: the apply worker re-runs the safe-apply policy before mutating and can still demote an auto-approved action back to proposed. Poll the Location header or the ledger for terminal state. A queued result is a success, not a failure — the org kill switch, an inactive account, or the 24-hour auto-apply cap all force review rather than erroring.

Composite action: this sequences several Apple calls and is not atomic. A mid-sequence failure rolls back on a best-effort basis and reports the step that broke, so a failed action can still have left partial state behind.

Required scope: write.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An API key from Workspace → Settings → API keys, sent as Authorization: Bearer tsk_….

Authorization has two independent axes.

The scope is ranked — a key satisfies any requirement at or below its own tier:

  • read — see state. Never changes anything.
  • write — propose changes (the actions/* endpoints), trigger audits and reports.
  • admin — connection, account import, sync, targets and brief.

There is no approve scope. It was a rung once; it is not one now, and a key requested with it is rejected.

The approval grant (can_approve) is a separate boolean, not a rung. Deciding a queued proposal — approve, reject, revert — needs write and the grant. Keeping them on separate axes is what makes the review gate a control rather than a convention: a key that may propose is not automatically a key that may approve its own proposal.

A key is either org-scoped (reaches every account, optionally limited to a subset) or bound to a single account.

Path Parameters

projectId*string

The account's project UUID — from GET /accounts, NOT the Apple asaOrgId. Pass the literal current with an account-scoped key to use its bound account.

Header Parameters

Idempotency-Key?string

Send a unique value per logical change. A retry with the same key replays the original proposal (200, Idempotency-Replay: true) instead of creating a second money-moving action.

Lengthlength <= 255

Request Body

application/json
  1. body
sourceAdGroupId*string
Match^\d+$
targetCampaignId*string
Match^\d+$
name?string

Defaults to the source ad group's name.

Length1 <= length <= 255
defaultBidMicros?integer

Defaults to the source ad group's default bid.

Range0 < value <= 9007199254740991
activeKeywordsOnly?boolean

Carry only ACTIVE keywords — Apple's keyword enum is ACTIVE|PAUSED. Default true (leave the paused losers behind).

Defaulttrue
includeAd?boolean

Link the source's live creative as the clone's ad. Without an ad the clone can't serve. Default true.

Defaulttrue
portNegatives?boolean

Also propose the source campaign's missing campaign-level negatives on the target. Default true.

Defaulttrue
startPaused?boolean

Set true to stage the clone PAUSED for QA instead of serving on apply. Default false: approving the proposal launches it.

Defaultfalse
reason*string

Why this change is right, in the operator's terms. Stored on the action row.

Length10 <= length <= 1500

Response Body

Idempotency replay: the original proposal for this key.

application/json
  1. response
actionId*string

The asa_agent_actions row this created.

Formatuuid
kind*string

The action kind, e.g. budget_change.

mode*string

auto_applied = the safe-apply policy cleared it and an apply job is enqueued. queued = it's waiting in the approval queue. NOT terminal: the apply worker re-runs the policy and can demote an auto-approved action back to pending. Poll the ledger for the outcome.

Value in"auto_applied""queued"
decision*string

What the approval policy decided (ADR 0010). not-applicable = no prompt needed; user-approval = parked for a person. Was riskTier.

Value in"not-applicable""user-approval""approved""denied"
policyReasons*array<string>

Why the policy reached that decision — the kill switch, the CPA band, the daily auto-apply cap, or the per-kind rule.

summary?string

One-line human description of the change, stored on the row.

payload?

The full kind-typed payload as stored, including the prior* snapshot that makes the change revertible. Apple has no change history, so this snapshot IS the revert plan.

currency?|

The account's currency.

note?string|null
replayed?boolean

Only on an Idempotency-Key replay: this is the original proposal, not a new one.

Example Request
curl -X POST 'https://tapandscale.com/api/v1/accounts/current/actions/clone-ad-group' \  -H 'Content-Type: application/json' \  -d '{  "sourceAdGroupId": "string",  "targetCampaignId": "string",  "reason": "stringstri"}'
Example Response
{  "actionId": "4a2794ff-94cb-4bac-8d36-d5fb36c563a0",  "kind": "string",  "mode": "auto_applied",  "decision": "not-applicable",  "policyReasons": [    "string"  ],  "summary": "Set \"Brand US\" daily budget → $150.00 (+20%)",  "payload": {},  "currency": "string",  "note": "string",  "replayed": true}