VOOZH about

URL: https://developers.openai.com/ads/api-reference/ad-groups

⇱ Ad Groups – Ads | OpenAI Developers


Search the ChatGPT docs

Primary navigation

List ad groups

List ad groups for a campaign.

GET /ad_groups

ParameterTypeRequiredNotes
campaign_idstringYesParent campaign ID.
limitintegerNoBetween 1 and 500. Default 20.
afterstringNoCursor for the next page.
beforestringNoCursor for the previous page.
orderstringNoasc or desc.
curl -X GET "https://api.ads.openai.com/v1/ad_groups?campaign_id=cmpn_101&limit=10" \
 -H "Authorization: Bearer $OPENAI_ADS_API_KEY"
{
 "object": "list",
 "data": [
 {
 "id": "adgrp_301",
 "created_at": 1735689700,
 "updated_at": 1735776100,
 "name": "US English",
 "description": "Primary English-speaking audience.",
 "context_hints": ["productivity", "team collaboration"],
 "status": "active",
 "bidding_config": {
 "billing_event_type": "impression",
 "max_bid_micros": 60000
 }
 }
 ],
 "first_id": "adgrp_301",
 "last_id": "adgrp_301",
 "has_more": false
}

Create an ad group

Create an ad group for a campaign.

POST /ad_groups

FieldTypeRequiredNotes
campaign_idstringYesParent campaign ID.
namestringYes3 to 1000 chars and must include a non-space character.
descriptionstringNoAd group description.
context_hintsstring[]NoFree-form audience or placement hints.
statusstringYesactive or paused.
bidding_config.billing_event_typestringYesCurrently impression.
bidding_config.max_bid_microsintegerYesBetween 1 and 100000000.
product_setobjectFor product-feed campaignsSelects a linked feed and optional product filters. See Product feeds.
product_set.product_feed_idstringFor product-feed campaignsFeed ID linked to the current ad account.
product_set.filtersobject[]NoProduct filters. Don’t repeat the same field within one product set.
product_set.filters[].fieldstringYes, in each filterFeed attribute to filter.
product_set.filters[].operatorstringYes, in each filterin, gt, gte, lt, or lte.
product_set.filters[].valuesstring[]Yes, in each filterMatch values. Send numeric comparison values as strings, such as "4.5".

Field notes

Product-set filters support title, body, item_id, offer_id, price, target_url, image_url, product_category, brand, seller_name, external_seller_id, star_rating, condition, and age_group. Use gt, gte, lt, and lte only with price or star_rating.

Context hints provide extra information on when you think your ads might be useful, and help guide when they appear. Provide a list of descriptions or keywords for when the product or service might be useful to show.

Micros are millionths of the main currency unit (e.g., Dollars). The max_bid field is per event, so a $60CPM ($0.06 per impression) is passed as 60,000 to the API. Note that currency fields respect your ad account’s default currency.

curl -X POST "https://api.ads.openai.com/v1/ad_groups" \
 -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{
 "campaign_id": "cmpn_101",
 "name": "US English",
 "description": "Primary English-speaking audience.",
 "context_hints": ["productivity", "team collaboration"],
 "status": "active",
 "bidding_config": {
 "billing_event_type": "impression",
 "max_bid_micros": 60000
 }
 }'

Retrieve an ad group

Fetch one ad group by ID.

GET /ad_groups/{ad_group_id}

curl -X GET "https://api.ads.openai.com/v1/ad_groups/adgrp_301" \
 -H "Authorization: Bearer $OPENAI_ADS_API_KEY"

Update an ad group

Update an ad group with POST.

POST /ad_groups/{ad_group_id}

All fields are optional on update. description can be set to null to clear it. If you include bidding_config, send the full object. status accepts active, paused, or archived. For a product-feed campaign, include the full product_set object to change the feed or its filters. Retrieve the ad group after the update if you need the resulting product_set; the immediate update response can omit it.

curl -X POST "https://api.ads.openai.com/v1/ad_groups/adgrp_301" \
 -H "Authorization: Bearer $OPENAI_ADS_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{
 "context_hints": ["productivity", "workflow automation"],
 "status": "paused",
 "bidding_config": {
 "billing_event_type": "impression",
 "max_bid_micros": 75000
 }
 }'

Change state with dedicated actions

The Ads API also exposes explicit state transitions. Paused ad groups won’t deliver ads to customers. Only archive objects you have no further use for, as archiving isn’t reversible.

  • POST /ad_groups/{ad_group_id}/activate
  • POST /ad_groups/{ad_group_id}/pause
  • POST /ad_groups/{ad_group_id}/archive
curl -X POST "https://api.ads.openai.com/v1/ad_groups/adgrp_301/archive" \
 -H "Authorization: Bearer $OPENAI_ADS_API_KEY"
{
 "id": "adgrp_301",
 "created_at": 1735689700,
 "updated_at": 1735948800,
 "name": "US English",
 "description": "Primary English-speaking audience.",
 "context_hints": ["productivity", "team collaboration"],
 "status": "archived",
 "bidding_config": {
 "billing_event_type": "impression",
 "max_bid_micros": 60000
 }
}

Loading docs agent...