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

Create Campaign

POST
/campaigns

Create a campaign for an ad account.

Ads can serve only within the campaign’s scheduled times and targeted locations.

For location, platform, and custom audience targeting, see Campaign Targeting.

For the limited Hotel beta, follow Create Hotel ads for feed selection, supported countries, account eligibility, and current restrictions. Verify the saved countries before activating the campaign.

Defaults

If you omit start_time, the campaign has no delayed start. Delivery still requires active objects and the usual eligibility checks. For location defaults and supported countries, see the campaign targeting guide. Verify the saved targeting before activating the campaign.

Omitting targeting.platforms or setting it to null adds no platform restriction.

Note that time and currency fields will respect your account-set timezone and currency defaults.

See Custom Audiences for audience matching, exclusions, and minimum-size requirements.

Check audiences with GET /custom_audiences?intended_use=inclusion or intended_use=exclusion before using them. A ready small or empty audience can be excluded, but it isn't automatically eligible for inclusion. If you include and exclude audiences, the remaining population must still meet the minimum. For an exclusion-only campaign, omit targeting.custom_audiences.

Create a conversion-optimized campaign

To use oCPC, set bidding_type to conversions and pass exactly one active standard conversion event setting from the current ad account. The event setting must connect to one or more active conversion sources. Custom event settings cannot be optimization goals.

Conversion bidding must be enabled for the ad account. Product-feed campaigns can use oCPC during the open beta. Use the same endpoint, set mode to product_feed, and include the linked product_feed_id. You cannot change the campaign objective after creation, or the selected conversion event after publication. Qualified-lead and Conversations campaigns have fixed conversion goals even in drafts. For the complete setup flow, including the required ad-group bid configuration, see Conversion-Optimized Campaigns, Product Feeds, and API Partner Setup.

Create Campaign

curl https://api.ads.openai.com/v1/campaigns \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
    -d '{
          "budget": {
            "lifetime_spend_limit_micros": 25000000
          },
          "name": "Spring launch",
          "status": "paused",
          "description": "Promote the new productivity bundle."
        }'
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"
      ]
    }
  }
}
Header Parameters
"Idempotency-Key": optional string
pattern.*\S.*
minLength1
maxLength255
Body Parameters
JSON
budget: object { daily_spend_limit_micros, lifetime_spend_limit_micros }
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
name: string

Campaign name for organizing ads; must contain a non-whitespace character.

pattern^.*\S.*$
minLength3
maxLength1000
status: "active" or "paused"
One of the following:
"active"
"paused"
bidding_type: optional "impressions" or "clicks" or "conversions"
One of the following:
"impressions"
"clicks"
"conversions"
billing_event_type: optional "impression" or "click"
One of the following:
"impression"
"click"
business_agent_id: optional string
conversion_event_setting_ids: optional array of string

For conversion optimization, exactly one active standard event setting from this account. Custom event settings cannot be campaign conversion goals.

description: optional string
enable_dynamic_creative: optional boolean
end_time: optional integer

Campaign end time as Unix seconds.

minimum946684800
maximum4102444800
landing_page_configuration: optional object { query_string_template }
query_string_template: optional string
maxLength2048
mode: optional "product_feed" or "business_agent" or "qualified_leads"
One of the following:
"product_feed"
"business_agent"
"qualified_leads"
objective: optional "reach" or "clicks" or "conversions"

For conversion campaigns, select conversions and specify the goal in conversion_event_setting_ids. Set the bid for each ad group in its bidding_config.

One of the following:
"reach"
"clicks"
"conversions"
product_feed_id: optional string

Feed owned by this account for a product-feed campaign. See https://developers.openai.com/ads/product-feeds.

start_time: optional integer

Earliest delivery time as Unix seconds. Omit for no delayed start; delivery still requires active objects and eligibility.

minimum946684800
maximum4102444800
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"
      ]
    }
  }
}