Create New Ad Group
URL: POST/api/v1/adGroups
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
, anddeliverySpeed
parameters at same level i.e. either at campaign level or ad group level
Request Parameters
Parameters | Notes | Type | Required | Possible Values |
---|---|---|---|---|
campaignId | ID of the campaign this ad group belongs to | integer | Y | Unique numeric identifier |
advertiserId | ID of advertiser for whom the ad group(s) should be created | integer | Y | Unique numeric identifier |
name | The name of the ad group | string | Y | Relevant string value representing the ad group |
startDate | date on which the ad group is set to go live Note: startDate must be set either at campaign or ad group level | date. ISO 8601 timezone | Conditional. This field is required only if it is not set at campaign level. Cannot be changed to campaign level later | Date should be in format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX Note: All date and time values are internally converted to Eastern Time (ET) for processing. All timestamps must be provided in ISO 8601 format. Timestamps are normalized to the start of the hour in Eastern Time (ET)โthis means any minutes and seconds will be truncated. Please account for this when scheduling start and end dates. |
endDate | The date when ad group ends Note: endDate must be set either at campaign or ad group level | date. ISO 8601 timezone | Conditional. This field is required only if it is not set at campaign level. Cannot be changed to campaign level later | Date should be in format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX To run campaign indefinitely, set its value as "9999-12-30T00:00:00Z" Note: All date and time values are internally converted to Eastern Time (ET) for processing. All timestamps must be provided in ISO 8601 format. Timestamps are normalized to the start of the hour in Eastern Time (ET)โthis means any minutes and seconds will be truncated. Additionally, the end date must be set to a time after 12:00 PM ET Please account for this when scheduling start and end dates. |
rateType | rate type refers to the pricing structure | string | N | cpm |
budgetType | The type of budget allocation you want to choose for the ad group Note: it must be set either at campaign or ad group level Ad groups scheduled to run indefinitely must use a daily budget | string | Conditional. This field is required only if it is not set at campaign level. Cannot be changed to campaign level later | Values: - daily - total |
dailyBudget | Daily budget of ad group _Note: โข Daily budget cannot exceed your total budget amount โข Unspent budget will be rolled over to the next day โข Up to 20% of the unspent budget will be rolled over to the following day โข It must be set either at Campaign or ad group level โข Ad groups scheduled to run indefinitely must use a daily budget | double | Conditional. This field is required only if: -It is not set at campaign level. Cannot be changed to campaign level later -budgetType is set to be daily | The value of daily budget should at least be $0.01 |
totalBudget | Total budget of ad group Note: it must be set either at campaign or ad group level | double | Conditional.This field is required only if: -It is not set at campaign level. Cannot be changed to campaign level later -budgetType is set to be total | The value of total budget should at least be $0.01 |
deliverySpeed | Determines pacing of ad delivery Note: it must be set either at campaign or ad group level | string | Conditional.This field is required only if it is not set at campaign level. Cannot be changed to campaign level later | Values: โข frontloaded โข evenly Note: frontloaded pacing is not supported if budgetType is daily |
creativeRotationMode | Specifies the rotation strategy for creatives within an ad group during delivery. Creatives can either be automatically rotated and prioritized based on performance (OPTIMIZE_PERFORMANCE), or distributed evenly with equal weight (ROTATE_EVENLY) | string | N | Enum Values: โขOPTIMIZE_PERFORMANCE (Default value) โขROTATE_EVENLY |
frequencyCapDay | The number of times the ad from specific ad group should be shown to the same user in a day | integer | N | Integer values between 1 and 511 |
frequencyCapWeek | The number of times the ad from specific ad group should be shown to the same user in a week | integer | N | Integer values between 3 and 511 |
frequencyCapMonth | The number of times the ad from specific ad group should be shown to the same user in a month | integer | N | Integer values between 5 and 511 |
baseBid | Starting bid for the ad group | double | N | Value of base bid |
maxBid | Max bid value for the ad group | double | N | Value of max bid |
targeting | A nested array element with following elements:
Note: only Exact
Note: This is how tiers
Note: 1. In an ad group, geo targeting can be set to one of:
2. You cannot combine different geo-targeting types within a single ad group 3. If Geo targeting is not specified, the default Country (US) level targeting will be applied 4. IDs with isDisabled = true from POST/api/v1/targeting/list cannot be used for targeting | N |
Notes:
- startDate >= todayโs date
- startDate <= endDate
- total and daily budget should be >= max bid
- 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
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. This key can be repurposed for SP API access as well. |
WM_CONSUMER.ID | 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 further explanation on this |
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_CONSUMER.intimestamp | Timestamp for which the auth signature is generated.โฏUse Unix epoch format for the timestamp | Y | Use the signature generator code (Getting Started Guide) to generate this value |
WM_SEC.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 |
Sample Request: Create Ad Group with Keyword Targeting
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": name1,
"startDate": "2023-12-01T12:00:00Z", "endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "daily",
"dailyBudget": 500, "totalBudget": 5000, "deliverySpeed" : "evenly", "creativeRotationMode":โฏ"OPTIMIZE_PERFORMANCE", "frequencyCapDay" : 0, "frequencyCapWeek" : 0, "frequencyCapMonth" : 0,
"baseBid" : 0.0,
"maxBid" : 0.0, "targeting" : { "and": [ { "keywords": [ { "keywordText": "test-keyword-1", "matchType": "broad" }, { "keywordText": "test-keyword-2", "matchType": "exact" } ], "not": [ { "keywords": [ { "keywordText": "test-keyword-negative", "matchType": "exact" } ] } ] }, { "geoTargets": [ { "id": 123 }, { "id": 234 }, { "id": 235 } ] } ] } }
]'
Sample Request: Create Ad Group with Contextual Targeting
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": name1,
"startDate": "2023-12-01T12:00:00Z", "endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "daily",
"dailyBudget": 500,
"totalBudget": 5000,
"deliverySpeed" : "evenly",
"creativeRotationMode":"OPTIMIZE_PERFORMANCE", "frequencyCapDay" : 0, "frequencyCapWeek" : 0, "frequencyCapMonth" : 0,
"baseBid" : 0.0,
"maxBid" : 0.0, "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 Behavioral Targeting
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": name1,
"startDate": "2023-12-01T12:00:00Z", "endDate": "2023-12-09T12:00:00Z", "rateType" : "cpm",
"budgetType" : "daily",
"dailyBudget": 500,
"totalBudget": 5000,
"deliverySpeed" : "evenly",
"creativeRotationMode":โฏOPTIMIZE_PERFORMANCE", "frequencyCapDay" : 0,
"frequencyCapWeek" : 0,
"frequencyCapMonth" : 0,
"baseBid" : 0.0,
"maxBid" : 0.0, "targeting" : { "and": [ { "behavioral": [ { "audienceType": "retail", "attribute": "historical", "id": 134 }, { "audienceType": "retail", "attribute": "historical", "id": 243234 } ]
}, { "geoTargets": [ { "id": 123 }, { "id": 134 }, { "id": 1233 } ] } ] } }
]'
Sample Request: Create Ad Group with ROS
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": name1,
"startDate": "2023-12-01T12:00:00Z", "endDate": "2023-12-09T12:00:00Z",
"rateType" : "cpm",
"budgetType" : "daily",
"dailyBudget": 500,
"totalBudget": 5000,
"deliverySpeed" : "evenly",
"creativeRotationMode":โฏOPTIMIZE_PERFORMANCE", "frequencyCapDay" : 0, "frequencyCapWeek" : 0, "frequencyCapMonth" : 0,
"baseBid" : 0.0,
"maxBid" : 0.0, "targeting" : { "and": [ { "runOfSite": true }, { "geoTargets": [ { "zipCode":"35004" } ] } ] } }
]'
Sample Request (Batch Operation)
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": "string",
"startDate": "string",
"endDate": "string",
"rateType" : "string",
"budgetType" : "string",
"dailyBudget": 0.0, "totalBudget": 0.0, "deliverySpeed" : "string", "deliverySpeed" : "string", "creativeRotationMode": "OPTIMIZE_PERFORMANCE", "frequencyCapDay" : 0,
"frequencyCapWeek" : 0,
"frequencyCapMonth" : 0,
"baseBid" : 0.0,
"maxBid" : 0.0, "targeting" : { "and": [ { "keywords": [ { "keywordText": "test-keyword-1", "matchType": "broad" }, { "keywordText": "test-keyword-2", "matchType": "exact" } ], "not": [ { "keywords": [ { "keywordText": "test-keyword-negative", "matchType": "broad" } ] } ] }, { "geoTargets": [ { "id": 123 }, { "id": 234 }, { "id": 235 } ] } ] } }, { "campaignId": 1,
"advertiserId": 1,
"name": string1,
"startDate": "string", "endDate": "string",
"rateType" : "string",
"budgetType" : "string",
"dailyBudget": 0.0,
"totalBudget": 0.0,
"deliverySpeed" : "string",
"creativeRotationMode":โฏ"string", "frequencyCapDay" : 0, "frequencyCapWeek" : 0, "frequencyCapMonth" : 0,
"baseBid" : 0.0,
"maxBid" : 0.0, "targeting" : { "and": [ { "contextual": [ { "id": 3452, "reach": "tier_2" }, { "id": 2343, "reach": "tier_3" } ] }, { "geoTargets": [ { "zipCode":"35004" } ] } ] } } ]'
Response
Element | Description | Type |
---|---|---|
code | The response code can have following values:
Click here 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 |
Sample Response
[ { "code": "success", "details": "string", "name": "string1", "campaignId": 1, "adGroupId": 1234 }
]
Sample Response (Batch Operation)
[ { "code": "success", "details": "string", "name": "string1", "campaignId": 1, "adGroupId": 1234 }, { "code": "failure", "details": ["string"], "name": "string1", "campaignId": 1 } ]
Updated about 8 hours ago