Update a campaign
Campaign-level edits. Send at least one of budget, bidStrategy, name
or platformSpecificData. An unsupported field is always an error, never a
silent drop.
| Body field | Meta | Others | |
|---|---|---|---|
bidStrategy | Yes | Yes | 501 |
bidAmount, roasAverageFloor | 400 — ad-set level | Yes | 400 |
budget (CBO; ABO returns 409) | Yes | 501 | 501 |
name | Yes | 501 | 501 |
platformSpecificData.spendCap | Yes | 400 | 400 |
accountId (empty campaigns) | Yes | - | - |
Google maps the shared enum onto its own strategies: LOWEST_COST_WITHOUT_CAP
to Maximize Clicks, LOWEST_COST_WITH_BID_CAP to Maximize Clicks with a max
CPC (bidAmount), COST_CAP to Target CPA (bidAmount),
LOWEST_COST_WITH_MIN_ROAS to Target ROAS (roasAverageFloor). A campaign on
a PORTFOLIO bidding strategy is rejected: detach it in Google Ads first, since
it is shared across campaigns.
accountId forwards the update straight to Meta for a campaign with zero ads,
which would otherwise 404; the response then carries updated: 0.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Platform campaign ID
Required: platform campaign IDs are not globally unique.
"facebook" | "instagram" | "google"Meta only. Zernio SocialAccount id owning the ad account. Needed only for an EMPTY campaign (zero ads); ignored otherwise.
"LOWEST_COST_WITHOUT_CAP" | "LOWEST_COST_WITH_BID_CAP" | "COST_CAP" | "LOWEST_COST_WITH_MIN_ROAS"Google only. Whole currency units (USD: 12 = $12.00). Max CPC for LOWEST_COST_WITH_BID_CAP, CPA target for COST_CAP; required for both.
Google only. Decimal ROAS multiplier (2.0 = 2.0x), required for LOWEST_COST_WITH_MIN_ROAS.
Meta only. The CBO budget.
Meta only. Rename the campaign.
length <= 255Meta only. Platform implied by the platform body param, same convention as POST /v1/ads/create.
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adcampaigns.updateAdCampaign({ path: { campaignId: 'campaign_abc123', }, body: { platform: 'facebook', },});console.log(data);{
"updated": 0,
"budget": {
"amount": 0,
"type": "daily"
},
"budgetLevel": "campaign",
"bidStrategy": "LOWEST_COST_WITHOUT_CAP",
"bidAmount": 0,
"roasAverageFloor": 0,
"platformSpecificData": {}
}{
"error": "Unauthorized"
}Pause or resume a campaign PUT
Updates the status of all ads in a campaign. Makes one platform API call (not per-ad) since status cascades through the campaign hierarchy. Ads in terminal statuses (rejected, completed, cancelled) are automatically skipped.
Pause or resume a single ad set PUT
Ad-set-scoped pause/resume (doesn't touch sibling ad sets). Thin wrapper over PUT /v1/ads/ad-sets/{adSetId} for callers that only want the status toggle and prefer a symmetric URL to /v1/ads/campaigns/{campaignId}/status.