Section 3 — The Advertiser API · Last verified: MAY 2026

Campaigns

Chapter 15 — Campaigns

Campaigns are the top-level container under an ad account. They define budget, scheduling, and geographic targeting.

Endpoints

MethodPathPurpose
GET/campaignsList campaigns.
POST/campaignsCreate a campaign.
GET/campaigns/{id}Retrieve one campaign.
POST/campaigns/{id}Update a campaign (note: POST, not PATCH or PUT).
POST/campaigns/{id}/activateSet status to active.
POST/campaigns/{id}/pauseSet status to paused.
POST/campaigns/{id}/archiveSet status to archived (irreversible).
GET/campaigns/{id}/insightsQuery performance at campaign scope.

Create-campaign fields

FieldTypeRequiredNotes
namestringYes3–1000 chars, must include a non-space character.
descriptionstringNo
start_timeintegerNoUnix seconds, between 946684800 and 4102444800. If omitted, campaign starts delivering immediately.
end_timeintegerNoUnix seconds, same range.
statusstringYesactive or paused on create.
budget.lifetime_spend_limit_microsintegerYesMinimum 1,000,000 (= $1.00 in USD accounts).
targeting.locations.countriesstring[]NoISO country codes to include. If omitted, all countries are targeted.
targeting.excluded_locations.countriesstring[]NoISO country codes to exclude.

Time and currency fields respect the ad account’s default timezone and currency (Chapter 14).

List parameters

ParameterTypeNotes
limitinteger1–500. Default 20.
afterstringCursor for next page.
beforestringCursor for previous page.
orderstringasc or desc.

Update behaviour

All fields are optional on update. If budget is included, send the full budget object — partial updates of budget are not supported. description, start_time, end_time, and targeting accept null to clear them. status accepts active, paused, or archived.

Example: create a US/Canada campaign

curl -X POST "https://api.ads.openai.com/v1/campaigns" 
  -H "Authorization: Bearer $OPENAI_ADS_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{
    "name": "Spring launch",
    "description": "Promote the new productivity bundle.",
    "start_time": 1735689600,
    "end_time": 1738368000,
    "status": "active",
    "budget": { "lifetime_spend_limit_micros": 25000000 },
    "targeting": { "locations": { "countries": ["US", "CA"] } }
  }'

The lifetime spend limit 25000000 micros = $25 in a USD account.

Example response

{
  "id": "cmpn_101",
  "created_at": 1735689600,
  "updated_at": 1735689600,
  "name": "Spring launch",
  "description": "Promote the new productivity bundle.",
  "status": "active",
  "start_time": 1735689600,
  "end_time": 1738368000,
  "budget": { "lifetime_spend_limit_micros": 25000000 },
  "targeting": { "locations": { "countries": ["US", "CA"] } }
}

Default behaviour worth knowing

  • No start_time → starts delivering immediately on active.
  • No targeting.locations.countries → all countries are eligible. Combined with the eligibility matrix in Chapter 3, this means the campaign reaches every supported geography.
  • No end_time → runs until the lifetime spend limit is exhausted.

For a Shopify brand running tightly scoped tests, set all three explicitly. Defaults are convenient for one-off campaigns but dangerous for budget pacing.