For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Overview Agent Access Ads ChatGPT + Codex user docs Use cases

API Reference

Update Campaign

POST
/campaigns/{campaign_id}

Update a campaign.

All fields are optional on update. If you include budget, send the full budget object. Set description, start_time, or end_time to null to clear that field. For non-Hotel campaigns, setting targeting to null resets targeting; these campaigns can receive the account's default country. For Hotel campaigns, targeting: null resets only included locations; excluded locations, custom-audience inclusion/exclusion criteria, and platform targeting are preserved. Inspect the saved targeting before activating delivery. status accepts active, paused, or archived. You cannot update bidding_type. For a published conversion-optimized campaign, you also cannot update conversion_event_setting_ids. Qualified-lead and Conversations campaigns have fixed conversion goals even in drafts. Other draft campaigns can change their conversion event selection before publication.

Hotel campaigns reject platform selections that create a restriction; selecting all platforms or clearing the restriction with targeting.platforms: null is allowed. Omitting targeting.platforms preserves the existing platform selection. For non-Hotel campaigns, provide targeting.platforms.included to replace it, or set targeting.platforms to null to clear only the platform restriction. Empty platform objects and empty included arrays return HTTP 400. See Update or clear platform targeting for an example.

Audience eligibility is validated again when you save targeting. A concurrent membership update can return 409 custom_audience_mutation_conflict without applying the campaign edit. Wait for the audience operation to finish, retrieve the current settings, and retry the intended edit if it is still appropriate.

Update Campaign

curl https://api.ads.openai.com/v1/campaigns/$CAMPAIGN_ID \
    -X POST \
    -H "Authorization: Bearer $OPENAI_ADS_API_KEY"
200 — Example
{
  "id": "id",
  "bidding_type": "bidding_type",
  "budget": {
    "daily_spend_limit_micros": 0,
    "lifetime_spend_limit_micros": 0
  },
  "created_at": 0,
  "description": "description",
  "end_time": 0,
  "name": "name",
  "product_feed_id": "product_feed_id",
  "start_time": 0,
  "status": "status",
  "updated_at": 0,
  "advertiser_phone_verification_required": true,
  "agent_destination_id": "agent_destination_id",
  "billing_event_type": "billing_event_type",
  "business_agent_id": "business_agent_id",
  "conversion_event_setting_ids": [
    "string"
  ],
  "enable_dynamic_creative": true,
  "geographic_targeting_blocked": true,
  "landing_page_configuration": {
    "query_string_template": "query_string_template"
  },
  "managed_optimization_goal": "managed_optimization_goal",
  "mode": "mode",
  "objective": "objective",
  "review_resume_confirmation": {
    "episode_id": "episode_id",
    "reason": "reason",
    "required_at": 0,
    "system_paused": true
  },
  "serving_issues": [
    {
      "code": "ad_account_suspended"
    }
  ],
  "targeting": {
    "custom_audiences": {
      "ids": [
        "string"
      ]
    },
    "excluded_custom_audiences": {
      "ids": [
        "string"
      ]
    },
    "excluded_locations": {
      "countries": [
        "string"
      ],
      "include": [
        {
          "id": "id",
          "country_code": "country_code",
          "name": "name",
          "region_code": "region_code",
          "type": "type"
        }
      ]
    },
    "locations": {
      "countries": [
        "string"
      ],
      "include": [
        {
          "id": "id",
          "country_code": "country_code",
          "name": "name",
          "region_code": "region_code",
          "type": "type"
        }
      ]
    },
    "platforms": {
      "included": [
        "ios_app"
      ]
    }
  }
}
Path Parameters
campaign_id: string
Body Parameters
JSON
agent_destination_id: optional string or null
budget: optional object { daily_spend_limit_micros, lifetime_spend_limit_micros }

Send the full replacement budget object, with either a daily or lifetime limit.

daily_spend_limit_micros: optional integer

Daily campaign budget in account-currency micros. Choose either a daily or lifetime limit; account-specific minimums can also apply.

minimum1000000
lifetime_spend_limit_micros: optional integer

Lifetime campaign budget in account-currency micros (millionths of the main currency unit). Choose either a lifetime or daily limit.

minimum1000000
conversion_event_setting_ids: optional array of string
description: optional string or null

Campaign description. Omit to preserve it; null clears it.

enable_dynamic_creative: optional boolean
end_time: optional integer or null

Unix seconds. Omit to preserve the end time; null clears it.

minimum946684800
maximum4102444800
landing_page_configuration: optional object { query_string_template } or null
query_string_template: optional string
maxLength2048
name: optional string
pattern^.*\S.*$
minLength3
maxLength1000
start_time: optional integer or null

Unix seconds. Omit to preserve the start time; null clears it.

minimum946684800
maximum4102444800
status: optional "active" or "paused" or "archived"
One of the following:
"active"
"paused"
"archived"
targeting: optional object { custom_audiences, excluded_custom_audiences, excluded_locations, 2 more } or null

Location, platform and audience targeting. Verify the saved targeting before activation. See https://developers.openai.com/ads/campaign-targeting.

custom_audiences: optional object { ids }

Audiences eligible for inclusion. Check GET /custom_audiences?intended_use=inclusion; ready status alone does not establish minimum-size eligibility.

ids: optional array of string
excluded_custom_audiences: optional object { ids }

Audiences eligible for exclusion, including ready small or empty audiences. Check intended_use=exclusion. The remaining included population must still meet the minimum.

ids: optional array of string
excluded_locations: optional object { countries, include }
countries: optional array of string

Whole-country targeting using supported country codes.

include: optional array of object { id, country_code, name, 2 more }

Included location IDs. Resolve supported IDs using the targeting guide.

maxItems2500
id: string
country_code: optional string
name: optional string
region_code: optional string
type: optional string
locations: optional object { countries, include }
countries: optional array of string

Whole-country targeting using supported country codes.

include: optional array of object { id, country_code, name, 2 more }

Included location IDs. Resolve supported IDs using the targeting guide.

maxItems2500
id: string
country_code: optional string
name: optional string
region_code: optional string
type: optional string
platforms: optional object { included } or null

On creation, omit or use null for no platform restriction. On update, omission preserves the restriction and null clears it. An empty included array is invalid.

included: optional array of "ios_app" or "android_app" or "web" or 3 more
One of the following:
"ios_app"
"android_app"
"web"
"desktop_web"
"ios_web"
"android_web"
Returns
id: string
bidding_type: string
budget: object { daily_spend_limit_micros, lifetime_spend_limit_micros }
daily_spend_limit_micros: optional integer
lifetime_spend_limit_micros: optional integer
created_at: integer
formatunixtime
description: string or null
end_time: integer or null
formatunixtime
name: string
product_feed_id: string or null
start_time: integer or null
formatunixtime
status: string
updated_at: integer
formatunixtime
advertiser_phone_verification_required: optional boolean
agent_destination_id: optional string or null
billing_event_type: optional string
business_agent_id: optional string or null
conversion_event_setting_ids: optional array of string
enable_dynamic_creative: optional boolean
geographic_targeting_blocked: optional boolean
landing_page_configuration: optional object { query_string_template } or null
query_string_template: string or null
managed_optimization_goal: optional string or null
mode: optional string or null
objective: optional string
review_resume_confirmation: optional object { episode_id, reason, required_at, system_paused } or null
episode_id: string
reason: string
required_at: integer
formatunixtime
system_paused: boolean
serving_issues: optional array of object { code }
code: "ad_account_suspended" or "ad_account_brand_review_missing_favicon" or "ad_account_brand_review_escalated_review" or 23 more
One of the following:
"ad_account_suspended"
"ad_account_brand_review_missing_favicon"
"ad_account_brand_review_escalated_review"
"ad_account_brand_review_rejected"
"ad_account_brand_review_in_progress"
"ad_account_payment_method_missing_or_unauthorized"
"ad_account_threshold_payment_failed"
"ad_account_persona_verification_not_approved"
"ad_account_persona_verification_step_up_required"
"campaign_not_active"
"campaign_not_started"
"campaign_ended"
"campaign_has_no_ad_groups"
"campaign_has_no_serving_ready_ad_groups"
"product_feed_country_targeting_blocked"
"product_feed_country_targeting_limited"
"ad_group_not_active"
"ad_group_has_no_ads"
"campaign_budget_exhausted"
"ad_account_budget_exhausted"
"review_not_approved"
"landing_page_crawl_issue"
"ad_in_review"
"partial_serving_review_not_approved"
"partial_serving_landing_page_crawl_issue"
"partial_serving_ad_in_review"
targeting: optional object { custom_audiences, excluded_custom_audiences, excluded_locations, 2 more }
custom_audiences: optional object { ids }
ids: array of string
excluded_custom_audiences: optional object { ids }
ids: array of string
excluded_locations: optional object { countries, include }
countries: optional array of string
include: optional array of object { id, country_code, name, 2 more }
id: string
country_code: string
name: string
region_code: string or null
type: string
locations: optional object { countries, include }
countries: optional array of string
include: optional array of object { id, country_code, name, 2 more }
id: string
country_code: string
name: string
region_code: string or null
type: string
platforms: optional object { included }
included: optional array of "ios_app" or "android_app" or "web" or 3 more
One of the following:
"ios_app"
"android_app"
"web"
"desktop_web"
"ios_web"
"android_web"
Returns Examples
200 — Example
{
  "id": "id",
  "bidding_type": "bidding_type",
  "budget": {
    "daily_spend_limit_micros": 0,
    "lifetime_spend_limit_micros": 0
  },
  "created_at": 0,
  "description": "description",
  "end_time": 0,
  "name": "name",
  "product_feed_id": "product_feed_id",
  "start_time": 0,
  "status": "status",
  "updated_at": 0,
  "advertiser_phone_verification_required": true,
  "agent_destination_id": "agent_destination_id",
  "billing_event_type": "billing_event_type",
  "business_agent_id": "business_agent_id",
  "conversion_event_setting_ids": [
    "string"
  ],
  "enable_dynamic_creative": true,
  "geographic_targeting_blocked": true,
  "landing_page_configuration": {
    "query_string_template": "query_string_template"
  },
  "managed_optimization_goal": "managed_optimization_goal",
  "mode": "mode",
  "objective": "objective",
  "review_resume_confirmation": {
    "episode_id": "episode_id",
    "reason": "reason",
    "required_at": 0,
    "system_paused": true
  },
  "serving_issues": [
    {
      "code": "ad_account_suspended"
    }
  ],
  "targeting": {
    "custom_audiences": {
      "ids": [
        "string"
      ]
    },
    "excluded_custom_audiences": {
      "ids": [
        "string"
      ]
    },
    "excluded_locations": {
      "countries": [
        "string"
      ],
      "include": [
        {
          "id": "id",
          "country_code": "country_code",
          "name": "name",
          "region_code": "region_code",
          "type": "type"
        }
      ]
    },
    "locations": {
      "countries": [
        "string"
      ],
      "include": [
        {
          "id": "id",
          "country_code": "country_code",
          "name": "name",
          "region_code": "region_code",
          "type": "type"
        }
      ]
    },
    "platforms": {
      "included": [
        "ios_app"
      ]
    }
  }
}