Turn on an ad account kill switch with POST /api/v1/ads/accounts/{accountId}/kill-switch. Requires an API key with the ads_manage scope or a signed-in workspace member.
Request
Stores every active, activating, and pending-review campaign, ad group, and ad as paused and queues a retryable provider pause for each (one per campaign; an ad group or ad only when its campaign is not paused). providerPauses.unsupported counts entities the provider cannot pause here; pause those in the provider’s ads manager. While the switch is on, a sync cannot restore an active status and queues another pause for anything the provider still reports as spending, and no activation, resume, or budget increase passes. Turning it on only stops spend, so members and ads_manage keys may; clearing it is the owner-only ads.clearKillSwitch. Repeating the current state is idempotent.
| Parameter | In | Type | Required |
|---|---|---|---|
accountId |
path | UUID | Yes |
workspaceId |
query | UUID | Yes |
| Body field | Type | Required |
|---|---|---|
reason |
string | No |
Response
- HTTP 200:
AdKillSwitchResultwithpolicy,changed,paused,providerPauses,nextAction.
The OpenAPI document has each field’s type.
Examples
const result = await workspace.ads.enableKillSwitch(accountId, {
reason: "Creative review",
});result = workspace.ads.enable_kill_switch(account_id, reason="Creative review")curl -X POST "https://pubnio.com/api/v1/ads/accounts/$ACCOUNT_ID/kill-switch?workspaceId=$WORKSPACE_ID" \
-H "Authorization: Bearer $PUBNIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason":"Creative review"}'pnio ads enable-kill-switch "$ACCOUNT_ID" --reason "Creative review"async () => {
const accountId = "<accountId>";
const response = await codemode.request({
method: "POST",
path: `/api/v1/ads/accounts/${accountId}/kill-switch`,
query: { workspaceId: codemode.workspaceId },
body: { reason: "Creative review" },
});
return response.data;
};Errors
It declares no problem of its own.
It declares the problems every Ads operation and most operations declare.
Idempotency
No key, so a retried POST is not deduplicated. Read the current state before you retry.
Limits
- Field lengths and ranges are in the OpenAPI document.