---
updatedAt: 2026-10-08T06:50:34.000Z
---

# Create New Ad Group

<Callout icon="📘" theme="info">
  ### URL: POST /api/v1/adGroups
</Callout>

Note:

* This API supports batch operations with a max batch size of 10. For bulk operation, the advertiserId must be the same across all requests in the payload
* Creating multiple ad groups with different targeting types is supported in Bulk. For example: A single bulk payload can include one ad group Create request with keyword targeting and another ad group create request with contextual targeting
* You must set all of: `budgetType`, `dailyBudget`, `totalBudget`, `startDate`, `endDate`, and `deliverySpeed` parameters at same level i.e. either at `campaign `level or `ad group level`
* Supports both expression-based and flattened targeting structure. Only one of expression based or flattened structure should be used in a request. More details [here](https://developer.walmart.com/advertising-partners/docs/targeting-object)

# Request Body

## Core Parameters

| Parameter            | Description                                                                                                                                                                                                                                   | Required    | Data Type   | Possible Values / Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| advertiserId         | ID of the advertiser for whom the ad group(s) should be created.                                                                                                                                                                              | Y           | Integer     | A valid advertiser ID<ul><li>wert</li><li>fggsd</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| campaignId           | ID of the campaign this ad group belongs to.                                                                                                                                                                                                  | Y           | Integer     | A valid campaign ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| name                 | Name of the ad group. Maximum length: 255 characters.                                                                                                                                                                                         | Y           | String      | Valid name of the ad group                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| startDate            | Date on which the ad group is set to go live.                                                                                                                                                                                                 | Conditional | String      | <ul><li>Required if not set at the ad group level</li><li>Must be ISO 8601 format: <code>yyyy-MM-dd'T'HH:mm:ss.SSSXXX</code></li><li>Campaigns must start on the hour</li><li>Minutes and seconds are truncated (e.g., 23:45 → 23:00)</li></ul>                                                                                                                                                                                                                                                                                                                   |
| endDate              | Date when the ad group ends.                                                                                                                                                                                                                  | Conditional | String      | <ul><li>Required if not set at the ad group level</li><li>Must be ISO 8601 format: <code>yyyy-MM-dd'T'HH:mm:ss.SSSXXX</code></li><li>Use <code>9999-12-30T00:00:00Z</code> for indefinite run</li><li>Campaigns must end on the hour</li><li>Minutes and seconds are truncated (e.g., 23:45 → 23:00)</li><li>Campaigns cannot end before 12:00 PM ET, except:</li><li>If <code>endDate</code> is set to 00:00 (e.g., <code>2025-07-20T00:00:00-05:00</code>), it is interpreted as the end of the previous day (<code>2025-07-19T23:59:00-05:00</code>)</li></ul> |
| rateType             | Pricing structure for the ad group.                                                                                                                                                                                                           | N           | String      | cpm                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| budgetType           | Type of budget allocation.                                                                                                                                                                                                                    | Conditional | String      | <ul><li>daily</li><li>total</li><li>Required if not set at the campaign level</li><li>Ad groups scheduled to run indefinitely must use a daily budget</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                   |
| dailyBudget          | Daily budget of the ad group.                                                                                                                                                                                                                 | Conditional | Double      | <ul><li>Required if <code>budgetType</code> is <code>daily</code></li><li>Minimum value: $0.01</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| totalBudget          | Total budget of the ad group.                                                                                                                                                                                                                 | Conditional | Double      | <ul><li>Required if <code>budgetType</code> is <code>total</code></li><li>Minimum value: $0.01</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| deliverySpeed        | Determines pacing of ad delivery.                                                                                                                                                                                                             | Conditional | String      | <ul><li>frontloaded</li><li>evenly</li><li>Required if not set at the campaign level</li><li>Frontloaded pacing is not supported when <code>budgetType</code> is <code>daily</code></li></ul>                                                                                                                                                                                                                                                                                                                                                                     |
| creativeRotationMode | Rotation strategy for creatives during delivery.                                                                                                                                                                                              | N           | String      | <ul><li>OPTIMIZE\_PERFORMANCE (default)</li><li>ROTATE\_EVENLY</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| frequencyCapDay      | Max impressions per user per day.                                                                                                                                                                                                             | N           | Integer     | Valid range: 1–511                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| frequencyCapWeek     | Max impressions per user per week.                                                                                                                                                                                                            | N           | Integer     | Valid range: 3–511                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| frequencyCapMonth    | Max impressions per user per month.                                                                                                                                                                                                           | N           | Integer     | Valid range: 5–511                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| maxBid               | Maximum bid for the ad group.                                                                                                                                                                                                                 | N           | Double      | Minimum value: $0.01                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| outOfStockProtection | To optIn/optOut of out of stock protection at an AdGroup level                                                                                                                                                                                | N           | boolean     | Allowed values: true/false<br />Default value: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| targeting            | JSON object that defines the audience, contextual, keyword, and geographic targeting criteria for an ad group.<br />***Note:*** You must choose one structure; mixing flat and expression-based schemas in a single payload is not supported. | N           | JSON object | Contains targeting parameters, see **Targeting Object** section below for more details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

##

***

## Targeting Object

The targeting object can either be replaced fully or can be incrementally updated using add and remove arrays.

### For Ad Groups with Keywords and Negative Keywords Targeting

| Parameter   | Parameter 	Description             | Type   | Required | Possible Values                                                              |
| :---------- | :--------------------------------- | :----- | :------- | :--------------------------------------------------------------------------- |
| keywordText | Text that defines the keyword      | string | Y        | Advertiser ID for which the campaign needs to be updated for delivery status |
| matchType   | Matching criteria for the keywords | string | Y        | broad, exact<br />For negative keywords only exact matchType is allowed      |

### For Ad Groups with Contextual Targeting

| Parameter | Parameter 	Description                                                                                                                                                                                                                                                | Type    | Required | Possible Values                                                                                                               |
| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ | :------- | :---------------------------------------------------------------------------------------------------------------------------- |
| id        | ID of the contextual node                                                                                                                                                                                                                                             | integer | Y        |                                                                                                                               |
| reach     | Determines contextual reach.This is how tiers in API call map to the representation on ad center UI:<br /> <strong>Tier mapping:</strong><ul><li>low = \[tier\_1, tier\_2 ]</li><li>mid = \[tier\_3, tier\_4 ]</li><li>high = \[tier\_5, tier\_6, tier\_7 ]</li></ul> | string  | Y        | <ul><li>tier\_1</li><li>tier2</li></li><li>tier\_3</li><li> tier\_4</li><li>tier\_5</li><li>tier\_6</li><li>tier\_7</li></ul> |

### For Ad Groups with Behavioral Targeting

| Parameter    | Parameter 	Description                                   | Type    | Required | Possible Values                                                                                                                                                                                                                                                                                                                                                                                |
| :----------- | :------------------------------------------------------- | :------ | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id           | ID of the audience obtained from List targeting endpoint | integer | Y        |                                                                                                                                                                                                                                                                                                                                                                                                |
| audienceType | Type of audience                                         | string  | Y        | <ul><li>retail</li><li>brand</li><li>persona</li><li>custom</li><li>demographic</li></ul>                                                                                                                                                                                                                                                                                                      |
| attribute    | Attribute of the audience                                | string  | Y        | <ul><li>For category:<ul><li>historical</li><li>predictive</li></ul></li><li>For brand:<ul><li>historical</li><li>predictive</li><li>lapsed\_buyers</li></ul></li><li>For persona:<ul><li>lifestyle</li><li>lifestage</li><li>auto</li><li>shopping\_habits</li><li>food\_beverages</li></ul></li><li>For demographic:<ul><li>age</li><li>gender</li><li>household\_income</li></ul></li></ul> |

### For Ad Groups with ROS Targeting

| Parameter | Parameter 	Description                             | Type    | Required | Possible Values                      |
| :-------- | :------------------------------------------------- | :------ | :------- | :----------------------------------- |
| runOfSite | Indicates whether run‑of‑site targeting is enabled | boolean | Y        | <ul><li>true</li><li>false</li></ul> |

### Geo targeting 

Can be set to one of: 

<ul><li>Country</li><li>State,City</li><li>DMA</li><li>Zip code</li></ul>

If omitted will be default set to country (US). You cannot combine different geo-targeting types within a single ad group

| Parameter | Parameter 	Description                                                            | Type    | Required | Possible Values |
| :-------- | :-------------------------------------------------------------------------------- | :------ | :------- | :-------------- |
| id        | is used for `Country,` `State`, `City `or `DMA `targets                           | integer | Y        |                 |
| zipCode   | is used for zip code targeting.We only support ZIP codes within the USA currently | string  | Y        |                 |

<br />

***

<Callout icon="📌" theme="default">
  ### Rules
</Callout>

* [ ] startDate >= today’s date
* [ ] startDate <= endDate
* [ ] total and daily budget should be >= max bid
* [ ] You can only set either dailyBudget or totalBudget.
* [ ] To set daily budget, you must choose value of budgetType as “daily” and then define dailyBudget.
* [ ] To set total budget, you must choose value of budgetType as “total” and then define totalBudget.
* [ ] Budget, Schedule and Delivery speed must be set either at campaign or ad group level.
* [ ] You must set all of budgetType, dailyBudget, totalBudget, startDate, endDate, and deliverySpeed parameters at same level i.e. either at campaign level or ad group level, not both.
* [ ] IDs with isDisabled = true from POST /api/v2/targeting/list cannot be used for targeting.
* [ ] Campaigns must be homogeneous: if mediaType is VIDEO, all ad groups will be VIDEO; if mediaType is BANNER, all ad groups will be BANNER. Mixing VIDEO and BANNER ad groups within the same campaign is not allowed.
* [ ] mediaType, if included in the request payload, is ignored and has no effect on processing.
* [ ] Ad groups created to run definitely can be updated later to include an end date.
* [ ] outOfStockProtection enforcement works only with Item Page/PDP, Brand Shelf, or Brand Shop landing pages; unsupported pages serve normally.

<br />

<Callout icon="📌" theme="default">
  ### Targeting Rules
</Callout>

<ul><li>Only one of keywords, contextual, behavioral, or runOfSite is allowed.</li><li>geoTargets can be combined via an AND relation with that tactic.</li><li>All targeting combinations must use the and array format, as shown in the sample requests.</li><li>For geo targeting (Refer to the sample requests for creating an Ad Group with ROS to see how zip codes are used in geo-targeting):<ul><li>In an ad group, geo targeting can be set to one of:<ul><li>Country</li><li>State, City</li><li>DMA</li><li>Zip code</li></ul></li><li>You cannot combine different geo-targeting types within a single ad group</li><li>If geo targeting is not specified, the default Country (US) level targeting will be applied</li></ul></li><li>When setting up targeting for Video Ad Groups, the following restrictions apply:<ul><li>Keywords targeting is not supported for ad groups in campaigns with mediaType = VIDEO.</li><li>Ad groups with runOfSite targeting will not serve on Item Page placement.</li><li>Ad groups with contextual targeting will not serve on Homepage Feature_4</li></ul></li></ul>

***

# Headers

| Header Name               | Description                                                                                                                                    | Required | Values                                                                                                                                           |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Authorization`           | The token will provide you the access to the API. It is same for all advertisers you access through the API.                                   | Y        | Please utilize the generated `auth_token` shared with you at the time of partner onboarding from the Getting Started Guide                       |
| `Content-Type`            | Format of the message body                                                                                                                     | Y        | application/json                                                                                                                                 |
| `WM_CONSUMER.ID`          | Unique ID for consumer. We will provide you the consumer ID to access the API. It is same for all advertisers you access   through the API.    | Y        | Please use the generated `ConsumerId` shared with you at the time of partner onboarding. Refer to the Getting Started Guide for more information |
| `WM_SEC.AUTH_SIGNATURE`   | Auth signature as an API key.                                                                                                                  | Y        | Use the signature generator code from Getting Started Guide to generate this value                                                               |
| `WM_SEC.KEY_VERSION`      | Key version. We will provide you with the KEY VERSION to access the API. It is same for all advertisers you access through the API.            | Y        | 1                                                                                                                                                |
| `WM_CONSUMER.intimestamp` | Timestamp for  which the auth signature is generated. Use Unix epoch format for the timestamp.                                                 | Y        | Use the signature generator code from Getting Started Guide to generate this value                                                               |

<br />

## Sample Request: Create Ad Group with Keyword Targeting (using Expression Targeting Structure)

```curl
curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
 
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
 --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
 
--data '[    {
    "campaignId": 1,
    "advertiserId": 1,
    "name": "Ad group 1" ,
    "startDate": "2023-12-01T12:00:00Z",
    "endDate": "2023-12-09T12:00:00Z",
    "rateType": "cpm",
    "budgetType": "daily",
    "dailyBudget": 500,
    "deliverySpeed": "evenly",
    "creativeRotationMode": "OPTIMIZE_PERFORMANCE",
    "frequencyCapDay": 1,
    "frequencyCapWeek": 3,
    "frequencyCapMonth": 5,
    "maxBid": 0.5,
    "outOfStockProtection": true,
    "targeting": {
      "and": [
        {
          "and": [
            {
              "keywords": [
                {
                  "keywordText": "test-keyword-1",
                  "matchType": "broad"
                },
                {
                  "keywordText": "test-keyword-2",
                  "matchType": "broad"
                }
              ]
            },
            {
              "not": [
                {
                  "keywords": [
                    {
                      "keywordText": "test-keyword-3",
                      "matchType": "exact"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "geoTargets": [
            {
              "id": 123
            },
            {
              "id": 234
            },
            {
              "id": 235
            }
          ]
        }
      ]
    }
  } ]'
```

<br />

## Sample Request - Create Ad Group with Keyword Targeting (using Flattened Targeting Structure)

```curl
curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
 
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
 --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
 
--data '[    {
    "campaignId": 1,
    "advertiserId": 1,
    "name": "Ad group 1" ,
    "startDate": "2023-12-01T12:00:00Z",
    "endDate": "2023-12-09T12:00:00Z",
    "rateType": "cpm",
    "budgetType": "daily",
    "dailyBudget": 500,
    "deliverySpeed": "evenly",
    "creativeRotationMode": "OPTIMIZE_PERFORMANCE",
    "frequencyCapDay": 1,
    "frequencyCapWeek": 3,
    "frequencyCapMonth": 5,
    "maxBid": 0.5, 
    "outOfStockProtection": false,     
    "targeting": {
    "keywords": {
      "include": [
            { "matchType": "BROAD", "keywordText": "running shoes" },
            { "matchType": "PHRASE", "keywordText": "trail sneakers" }
      ],
      "exclude": [
            { "matchType": "EXACT", "keywordText": "free shoes" },
            { "matchType": "EXACT", "keywordText": "cheap shoes" }       
      ]
     },
    "geoTargets": {
        "include": [{
              "id": 123
            },
            {
              "id": 234
            }
        ]
    }
    }    
} ]'
```

## Sample Request: Create Ad Group with Contextual Targeting (using Expression Targeting Structure)

```curl
curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
 
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
 --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
 
--data ' [
          {
"campaignId": 1,
"advertiserId": 1,
"name": "Ad group 1" ,
"startDate": "2023-12-01T12:00:00Z",
"endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "daily",
"dailyBudget": 500,
"deliverySpeed" : "evenly",
"creativeRotationMode":"OPTIMIZE_PERFORMANCE",
"frequencyCapDay" : 1,
"frequencyCapWeek" : 3,
"frequencyCapMonth" : 5,
"maxBid" : 0.5,
"outOfStockProtection": true,
 
 "targeting" : {
    "and": [
      {
        "contextual": [
          {
             "id": 3452,
            "reach": "tier_2"    
           },
          {
            "id": 2343,
            "reach": "tier_3"    
          }
        ]
       },
      {
        "geoTargets": [
          {
            "id": 123
          },
          {           
            "id": 234         
          },
          {           
            "id": 235
          }
        ]
      }
    ]
  }
 }
]'
```

## Sample Request: Create Ad Group with Contextual Targeting (using Flattened Targeting Structure)

```curl
curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
 
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
 --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
 
--data ' [
          {
"campaignId": 1,
"advertiserId": 1,
"name": "Ad group 1" ,
"startDate": "2023-12-01T12:00:00Z",
"endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "daily",
"dailyBudget": 500,
"deliverySpeed" : "evenly",
"creativeRotationMode":"OPTIMIZE_PERFORMANCE",
"frequencyCapDay" : 1,
"frequencyCapWeek" : 3,
"frequencyCapMonth" : 5,
"outOfStockProtection": false,
"maxBid" : 0.5, 
"targeting": {
    "contextual": {
        "include": [
         {
             "id": 3452,
            "reach": "tier_2"    
         },
            {
             "id": 3453,
            "reach": "tier_1"    
         }        
        ]
    },
  "geoTargets": {
        "include": [{
              "id": 123
            },
            {
              "id": 234
            }
        ]
    }
}  
}
]'
```

## Sample Request: Create Ad Group with Audience Targeting (using Expression Targeting Structure)

```curl
curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
 
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
 --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
--data ' [
      {
"campaignId": 1,
"advertiserId": 1,
"name": "Ad group 1" ,
"startDate": "2023-12-01T12:00:00Z",
"endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "total",
"totalBudget": 5000,
"deliverySpeed" : "evenly",
"creativeRotationMode": "OPTIMIZE_PERFORMANCE"",
"frequencyCapDay" : 1,
"frequencyCapWeek" : 3,
"frequencyCapMonth" : 5,
"outOfStockProtection": true,
"maxBid" : 0.5,  
"targeting": {
   "and": [
     {
       "and": [
           {
              "behavioral": [
                 {
                    "audienceType": "retail",
                    "attribute": "historical",
                    "id": 134         
                 },
                 {
                    "audienceType": "retail",
                    "attribute": "historical",
                    "id": 243234 
                 }
              ]
            },
            {
              "not": [
                {
                   "behavioral": [
                      {
                         "audienceType": "retail",
                         "attribute": "historical",
                         "id": 134         
                      },
                      {
                         "audienceType": "retail",
                         "attribute": "historical",
                         "id": 243234 
                      }
                   ]
                }
              ]
        },
        {
          "geoTargets": [
            {
              "id": 123
            },
            {
              "id": 234
            },
            {
              "id": 235
            }
          ]
        }
      ]
    }
}
]'
```

## Sample Request: Create ad group with Audience Targeting (using Flattened Targeting Structure)

```curl
curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
 
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
 --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
--data ' [
      {
"campaignId": 1,
"advertiserId": 1,
"name": "Ad group 1" ,
"startDate": "2023-12-01T12:00:00Z",
"endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "total",
"totalBudget": 5000,
"deliverySpeed" : "evenly",
"creativeRotationMode": "OPTIMIZE_PERFORMANCE"",
"frequencyCapDay" : 1,
"frequencyCapWeek" : 3,
"frequencyCapMonth" : 5,
"outOfStockProtection": false,
"maxBid" : 0.5,   
"targeting": {
    "behavioral": {
      "include": [
          { "audienceType": "retail",
            "attribute": "historical",
            "id": 134  },
          { "audienceType": "retail",
            "attribute": "historical",
            "id": 234  }
      ],
      "exclude": [
          { "audienceType": "retail",
            "attribute": "historical",
            "id": 123  },
          { "audienceType": "retail",
            "attribute": "historical",
            "id": 111  }
      ]
    },
 "geoTargets": {
        "include": [{
              "id": 123
            },
            {
              "id": 234
            }
        ]
    }
}   
}
]'
```

## Sample Request: Create Ad Group with ROS Targeting (using Expression Targeting Structure)

```curl
curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
 
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
 --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
 
--data ' [
          {
"campaignId": 1,
"advertiserId": 1,
"name": "Ad group 1" ,
"startDate": "2023-12-01T12:00:00Z",
"endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "total",
"totalBudget": 5000,
"deliverySpeed" : "evenly",
"creativeRotationMode": "OPTIMIZE_PERFORMANCE"", 
"frequencyCapDay" : 1,
"frequencyCapWeek" : 3,
"frequencyCapMonth" : 5,
"outOfStockProtection": true,
"maxBid" : 0.5,
 
 "targeting" : {
  "and": [
    {
      "runOfSite": true
    },
    {
      "geoTargets": [
        {
          "zipCode": "35004"
        }
      ]
    }
  ]
}  
}
]'
```

## Sample Request: Create Ad Group with ROS Targeting (using Flattened Targeting Structure)

```curl
curl -X POST \
'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
 
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
 --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
 
--data ' [
          {
"campaignId": 1,
"advertiserId": 1,
"name": "Ad group 1" ,
"startDate": "2023-12-01T12:00:00Z",
"endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "total",
"totalBudget": 5000,
"deliverySpeed" : "evenly",
"creativeRotationMode": "OPTIMIZE_PERFORMANCE"", 
"frequencyCapDay" : 1,
"frequencyCapWeek" : 3,
"frequencyCapMonth" : 5,
"outOfStockProtection": true,
"maxBid" : 0.5,    {
  "targeting": {
    "runOfSite": true,
    "geoTargets": {
      "include": [
        {
          "zipCode": 35004
        }
      ]
    }
  }
  }
}
]'
```

## Sample Request: Create Multiple Ad Groups in a Single Call (Expression Targeting Structure)

```curl
curl -X POST \
'https: //developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
--header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
--data '[
    {
        "campaignId": 1,
        "advertiserId": 1,
        "name": "Ad group 1",
        "startDate": "2023-12-01T12:00:00Z",
        "endDate": "2023-12-09T12:00:00Z",
        "rateType": "cpm",
        "budgetType": "daily",
        "dailyBudget": 500,
        "deliverySpeed": "evenly",
        "creativeRotationMode": "OPTIMIZE_PERFORMANCE",
        "frequencyCapDay": 1,
        "frequencyCapWeek": 3,
        "frequencyCapMonth": 5,
        "outOfStockProtection": false,
        "maxBid": 0.5,         
        "targeting": {
            "and": [
                {
                    "and": [
                        {
                            "keywords": [
                                {
                                    "keywordText": "test-keyword-1",
                                    "matchType": "broad"
                                },
                                {
                                    "keywordText": "test-keyword-2",
                                    "matchType": "broad"
                                }
                            ]
                        },
                        {
                            "not": [
                                {
                                    "keywords": [
                                        {
                                            "keywordText": "test-keyword-3",
                                            "matchType": "exact"
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                {
                    "geoTargets": [
                        {
                            "id": 123
                        },
                        {
                            "id": 234
                        },
                        {
                            "id": 235
                        }
                    ]
                }
            ]
        }
    },
    {
        "campaignId": 2,
        "advertiserId": 1,
        "name": "Ad group 2",
        "startDate": "2023-12-01T12:00:00Z",
        "endDate": "2023-12-09T12:00:00Z",
        "rateType": "cpm",
        "budgetType": "daily",
        "dailyBudget": 500,
        "deliverySpeed": "evenly",
        "creativeRotationMode": "OPTIMIZE_PERFORMANCE",
        "frequencyCapDay": 1,
        "frequencyCapWeek": 3,
        "frequencyCapMonth": 5,
        "maxBid": 0.5,
        "targeting": {
            "and": [
                {
                    "contextual": [
                        {
                            "id": 3452,
                            "reach": "tier_2"
                        },
                        {
                            "id": 2343,
                            "reach": "tier_3"
                        }
                    ]
                },
                {
                    "geoTargets": [
                        {
                            "zipCode": "35004"
                        }
                    ]
                }
            ]
        }
    }
]'
```

## Sample Request: Create Multiple Ad Groups in a Single Call (Flattened Targeting Structure)

```curl
curl -X POST \
'https: //developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/adGroups'  \
--header 'Content-Type:  application/json'  \
--header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************'  \
--header 'WM_SEC.KEY_VERSION: 1'  \
--header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff'  \
--header 'WM_CONSUMER.intimestamp: 1565309779'
--data '[
    {
        "campaignId": 1,
        "advertiserId": 1,
        "name": "Ad group 1",
        "startDate": "2023-12-01T12:00:00Z",
        "endDate": "2023-12-09T12:00:00Z",
        "rateType": "cpm",
        "budgetType": "daily",
        "dailyBudget": 500,
        "deliverySpeed": "evenly",
        "creativeRotationMode": "OPTIMIZE_PERFORMANCE",
        "frequencyCapDay": 1,
        "frequencyCapWeek": 3,
        "frequencyCapMonth": 5,
        "outOfStockProtection": false,
        "maxBid": 0.5,         
        "targeting": {
            "keywords": {
                "include": [
                    { "matchType": "BROAD", "keywordText": "running shoes" },
                    { "matchType": "PHRASE", "keywordText": "trail sneakers" }
                ],
                "exclude": [
                    { "matchType": "EXACT", "keywordText": "free shoes" },
                    { "matchType": "EXACT", "keywordText": "bad shoes" }         
                ]
            },
            "geoTargets": {
                "include": [
                    {
                        "id": 123
                    },
                    {
                        "id": 234
                    }
                ]
            }
        }     
    },
    {
        "campaignId": 2,
        "advertiserId": 1,
        "name": "Ad group 2",
        "startDate": "2023-12-01T12:00:00Z",
        "endDate": "2023-12-09T12:00:00Z",
        "rateType": "cpm",
        "budgetType": "daily",
        "dailyBudget": 500,
        "deliverySpeed": "evenly",
        "creativeRotationMode": "OPTIMIZE_PERFORMANCE",
        "frequencyCapDay": 1,
        "frequencyCapWeek": 3,
        "frequencyCapMonth": 5,
        "baseBid": 0.1,
        "maxBid": 0.5,        
        "targeting": {
          "contextual": {
                "include": [
                    {
                        "id": 3452,
                        "reach": "tier_2"    
                    },
                    {
                        "id": 3452,
                        "reach": "tier_2"    
                    }          
                 ]
             }
            },
           "geoTargets": {
                "include": [
                    {
                        "id": 123
                    },
                    {
                        "id": 234
                    }
                ]
            }
        } 
    }
]'
```

## Response

| Element    | Description                                                                                                                                                                                                         | Type    |
| :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ |
| code       | The response code can have following values:<ul><li>success</li><li>failure</li></ul><br />Click [here](/advertising-partners/docs/api-status-codes-and-errors)  for more information about Status Codes and Errors | string  |
| details    | Details will populate success or error message depending upon value of code                                                                                                                                         | string  |
| name       | Name of the campaign                                                                                                                                                                                                | string  |
| adGroupId  | ID of the Ad Group. This will be returned only when code=success                                                                                                                                                    | integer |
| campaignId | ID of the campaign. This will be returned only when code=success                                                                                                                                                    | integer |

<br />

## Sample Response Success - Create ad group with Keyword targeting (using Expression Targeting Structure)

```json json
[
      {
        "code": "success",
        "details": "string",
        "name": "string",
        "campaignId": 1,
        "adGroupId": 1234
     }
]


```

## Sample Response Failure - Create ad group with Keyword targeting (using Expression Targeting Structure)

```json json
[
    {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 1
    }
]
```

<br />

## Sample Response Succes - Create ad group with Keyword targeting (using Flattened Targeting Structure)

```json json
[
      {
        "code": "success",
        "details": "string",
        "name": "string",
        "campaignId": 1,
        "adGroupId": 1234
     }
]
```

## Sample Response Failure - Create ad group with Keyword targeting (using Flattened Targeting Structure)

```json json
[
    {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 1
    }
]
```

## Sample Response Succes - Create ad group with Contextual targeting (using Expression Targeting Structure)

```json json
[
      {
        "code": "success",
        "details": "string",
        "name": "string",
        "campaignId": 1,
        "adGroupId": 1234
     }
]
```

## Sample Response Failure - Create ad group with Contextual targeting (using Expression Targeting Structure)

```json json
[
    {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 1
    }
]
```

## Sample Response Success - Create ad group with Contextual targeting (using Flattened Targeting Structure)

```json json
[
      {
        "code": "success",
        "details": "string",
        "name": "string",
        "campaignId": 1,
        "adGroupId": 1234
     }
]
```

## Sample Response Failure - Create ad group with Contextual targeting (using Flattened Targeting Structure)

```json json
[
    {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 1
    }
]
```

## Sample Response Success - Create ad group with audience targeting (using Expression Targeting Structure)

```json json
[
      {
        "code": "success",
        "details": "string",
        "name": "string",
        "campaignId": 1,
        "adGroupId": 1234
     }
]
```

## Sample Response Failure - Create ad group with audience targeting (using Expression Targeting Structure)

```json json
[
    {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 1
    }
]
```

## Sample Response Success - Create ad group with audience targeting (using Flattened Targeting Structure)

```json json
[
      {
        "code": "success",
        "details": "string",
        "name": "string",
        "campaignId": 1,
        "adGroupId": 1234
     }
]
```

## Sample Response Failure - Create ad group with audience targeting (using Flattened Targeting Structure)

```json json
[
    {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 1
    }
]
```

<br />

## Sample Response Success - Create Ad Group with ROS Targeting (using Expression Targeting Structure)

```json json
[
      {
        "code": "success",
        "details": "string",
        "name": "string",
        "campaignId": 1,
        "adGroupId": 1234
     }
]
```

## Sample Response Failure - Create Ad Group with ROS Targeting (using Expression Targeting Structure)

```json json
[
    {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 1
    }
]
```

## Sample Response Success - Create Ad Group with ROS Targeting (using Flattened Targeting Structure)

```json json
[
      {
        "code": "success",
        "details": "string",
        "name": "string",
        "campaignId": 1,
        "adGroupId": 1234
     }
]
```

## Sample Response Failure - Create Ad Group with ROS Targeting (using Flattened Targeting Structure)

```json json
[
    {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 1
    }
]
```

## Sample Response Success - Create Multiple Ad Groups in a Single Call (Expression Targeting Structure)

```json json
[
  {
    "code": "success",
    "details": "string",
    "name": "string1",
    "campaignId": 1,
    "adGroupId": 1234
  },
   {
    "code": "success",
    "details": "string",
    "name": "string1",
    "campaignId": 2,
    "adGroupId": 1234
  }
 
]
```

## Sample Response Failure - Create Multiple Ad Groups in a Single Call (Expression Targeting Structure)

```json json
[
  {
    "code": "success",
    "details": "string",
    "name": "string1",
    "campaignId": 1,
    "adGroupId": 1234
  },
   {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 2
    }
 
]
```

## Sample Response Success - Create Multiple Ad Groups in a Single Call (Flattened Targeting Structure)

```json json
[
  {
    "code": "success",
    "details": "string",
    "name": "string1",
    "campaignId": 1,
    "adGroupId": 1234
  },
   {
    "code": "success",
    "details": "string",
    "name": "string1",
    "campaignId": 2,
    "adGroupId": 1234
  }
 
]
```

## Sample Response Failure - Create Multiple Ad Groups in a Single Call (Flattened Targeting Structure)

```json json
[
  {
    "code": "success",
    "details": "string",
    "name": "string1",
    "campaignId": 1,
    "adGroupId": 1234
  },
   {
    "code": "failure",
    "details": ["string"],
    "name": "string1",
    "campaignId": 2
    }
 
]
```

<br />

##