update_ad_status
Pause or resume a single ad on any platform with a write adapter (Google Ads, Meta Ads, Microsoft Ads, ChatGPT Ads). On apply, Adlyse writes a DecisionLogEntry automatically.
Parameters#
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ad_account_id | string | yes | The ad account id | |
ad_id | string | yes | Platform ad id (from list_ads) | |
status | string | yes | enabled | paused | |
ad_group_id | string | sometimes | Required for Google Ads and Microsoft Ads (both address ads through their ad group); ignored for Meta | |
preview | boolean | no | false | Return the intended change without calling the platform |
Returns#
json
{
"ad_account_id": "ad_acct_abc123",
"ad_id": "112233",
"platform": "meta_ads",
"preview": false,
"diff": { "status": { "after": "paused" } },
"applied": true,
"decision_id": "dlog_abc123",
"platform_response": { },
"source": "adlyse.ads_writes@v1"
}Errors#
error_type | When |
|---|---|
auth_error | Missing / invalid API key |
not_found | Ad account doesn’t belong to your org |
validation_error | Bad status, or Google/Microsoft without ad_group_id |
unsupported_for_platform | Platform has no write adapter (e.g. TikTok) |
credentials_missing | The account’s OAuth link needs reconnecting |
platform_error | The platform API rejected the mutation |