{"components":{"callbacks":{},"examples":{},"headers":{},"links":{},"parameters":{},"requestBodies":{},"responses":{},"schemas":{"HistoryError":{"description":"The error response object.","properties":{"code":{"description":"The HTTP status code of the response.","type":"string"},"details":{"description":"A human-readable description of the response.","type":"string"}},"type":"object"},"HistoryEventType":{"properties":{"eventTypeIds":{"description":"max of 10 event types. IDs here belong to the EventType. For example, if requesting CAMPAGIN as the eventType, these are campaignIds.","items":{"type":"string"},"type":"array"},"filters":{"description":"| Filter | Entity Types |\n||-|\n| BUDGET_AMOUNT | CAMPAIGN |\n| IN_BUDGET | CAMPAIGN |\n| STATUS | CAMPAIGN, AD_GROUP, AD, KEYWORD, PRODUCT_TARGET, NEGATIVE_KEYWORD |\n| END_DATE | CAMPAIGN |\n| START_DATE | CAMPAIGN |\n| PLACEMENT_GROUP | CAMPAIGN|\n| SMART_BIDDING_STRATEGY | CAMPAIGN |\n| BID_AMOUNT | AD_GROUP |\n| NAME | CAMPAIGN, AD_GROUP |","items":{"enum":["BID_AMOUNT","BUDGET_AMOUNT","END_DATE","IN_BUDGET","NAME","PLACEMENT_GROUP","SMART_BIDDING_STRATEGY","START_DATE","STATUS"],"type":"string"},"type":"array"},"parents":{"description":"maximum of 10 parents","items":{"properties":{"adGroupId":{"type":"string"},"campaignId":{"type":"string"},"useProfileIdAdvertiser":{"description":"If true, retrieves events which belong to the associated advertiser","type":"boolean"}},"type":"object"},"type":"array"}},"type":"object"},"HistoryEventTypes":{"description":"Event types that can be queried. **Note:** THEME event type requires API version 1.1 or higher (Accept: application/vnd.historyresponse.v1.1+json)","properties":{"AD":{"$ref":"#/components/schemas/HistoryEventType"},"AD_GROUP":{"$ref":"#/components/schemas/HistoryEventType"},"CAMPAIGN":{"$ref":"#/components/schemas/HistoryEventType"},"KEYWORD":{"$ref":"#/components/schemas/HistoryEventType"},"NEGATIVE_KEYWORD":{"$ref":"#/components/schemas/HistoryEventType"},"PRODUCT_TARGETING":{"$ref":"#/components/schemas/HistoryEventType"},"THEME":{"allOf":[{"$ref":"#/components/schemas/HistoryEventType"},{"description":"**Requires API version 1.1+:** Use Accept header \u0027application/vnd.historyresponse.v1.1+json\u0027"}]}},"type":"object"},"HistoryResponseEvents":{"items":{"properties":{"changeType":{"description":"\nChangeTypes for EntityTypes\n| EntityType | Valid Change Types |\n||--|\n|CAMPAIGN | STATUS, IN_BUDGET, PORTFOLIO, BUDGET_AMOUNT, NAME, START_DATE, END_DATE, SMART_BIDDING_STRATEGY, PLACEMENT_GROUP, CREATED, IS_PREMIUM_BID_ENABLED, PORTFOLIO_ID, BUDGET_DOCUMENT_VERSION, IS_PROCESSING, RULE_BASED_BUDGET_VALUE, APPLICABLE_RULE_NAME, APPLICABLE_RULE_ID, CREATION_DATE, AUTO_TARGETED |\n|AD_GROUP | STATUS, NAME, DEFAULT_BID_AMOUNT|\n|AD | STATUS|\n|KEYWORD | STATUS, BID_AMOUNT|\n|PRODUCT_TARGETING | STATUS, BID_AMOUNT|\n|NEGATIVE_KEYWORD | STATUS|","enum":["BID_AMOUNT","BUDGET_AMOUNT","DEFAULT_BID_AMOUNT","END_DATE","IN_BUDGET","NAME","PLACEMENT_GROUP","PORTFOLIO","SMART_BIDDING_STRATEGY","START_DATE","STATUS"],"type":"string"},"entityId":{"type":"string"},"entityType":{"enum":["AD","AD_GROUP","CAMPAIGN","KEYWORD","NEGATIVE_KEYWORD","PRODUCT_TARGETING","THEME"],"type":"string"},"metadata":{"properties":{"adGroupId":{"type":"string"},"campaignBudgetType":{"description":"Field only for campaigns","enum":["DAILY","LIFETIME_BUDGET"],"type":"string"},"campaignId":{"type":"string"},"keyword":{"description":"Field only for keywords or negative keywords. The keyword or phrase this matches.","type":"string"},"keywordType":{"description":"Field only for keywords","enum":["KEYWORD_BROAD","KEYWORD_EXACT","KEYWORD_PHRASE"],"type":"string"},"negativeTargetingType":{"description":"Field only for negative targeting.","enum":["NEGATIVE_KEYWORD_BROAD","NEGATIVE_KEYWORD_EXACT","NEGATIVE_KEYWORD_PHRASE"],"type":"string"},"placementGroupPosition":{"description":"Field only for campaign placement group change types","enum":["DETAIL_PAGE","TOP_OF_SEARCH"],"type":"string"},"predefinedTarget":{"enum":["CLOSE-MATCH","COMPLEMENTS","LOOSE-MATCH","SUBSTITUTES"],"type":"string"},"productTargetingType":{"description":"Field only for Product Targeting","enum":["EXPRESSION","PREDEFINED"],"type":"string"},"targetingExpression":{"description":"Field only for Product Targeting where type \u003d EXPRESSION. Some examples:\ncategory\u003d\"Car Seat Canopies \u0026 Covers\" brand\u003d\"Munchkin\" price\u003c14.9 rating\u003e4.6\nasin\u003d\"B000NPPATS\"\ncategory\u003d\"Women\u0027s Handbag Accessories\"","type":"string"},"targetingType":{"description":"Field only for THEME event type","type":"string"},"theme":{"description":"Field only for THEME event type. The theme targeting value.","type":"string"}},"type":"object"},"newValue":{"description":"\n| EntityType | Change Type | Values |\n||-|--|\n| CAMPAIGN | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED|\n| CAMPAIGN | IN_BUDGET | true or false|\n| CAMPAIGN | PORTFOLIO | portfolioId|\n| CAMPAIGN | BUDGET_AMOUNT | amount in marketplace currency |\n| CAMPAIGN | NAME | campaign name string|\n| CAMPAIGN | START_DATE | unix time|\n| CAMPAIGN | END_DATE | unix time|\n| CAMPAIGN | SMART_BIDDING_STRATEGY | OPTIMIZE_FOR_SALES, LEGACY, MANUAL|\n| CAMPAIGN | PLACEMENT_GROUP | number as percent |\n| AD_GROUP | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |\n| AD_GROUP | NAME | ad group name string |\n| AD_GROUP | DEFAULT_BID_AMOUNT | amount in marketplace currency |\n| AD | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |\n| KEYWORD | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |\n| KEYWORD | BID_AMOUNT | amount in marketplace currency |\n| PRODUCT_TARGETING | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |\n| PRODUCT_TARGETING | BID_AMOUNT | amount in marketplace currency |\n| NEGATIVE_KEYWORD | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |","type":"string"},"previousValue":{"description":"\n| EntityType | Change Type | Values |\n||-|--|\n| CAMPAIGN | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED|\n| CAMPAIGN | IN_BUDGET | true or false|\n| CAMPAIGN | PORTFOLIO | portfolioId|\n| CAMPAIGN | BUDGET_AMOUNT | amount in marketplace currency |\n| CAMPAIGN | NAME | campaign name string|\n| CAMPAIGN | START_DATE | unix time|\n| CAMPAIGN | END_DATE | unix time|\n| CAMPAIGN | SMART_BIDDING_STRATEGY | OPTIMIZE_FOR_SALES, LEGACY, MANUAL|\n| CAMPAIGN | PLACEMENT_GROUP | number as percent |\n| AD_GROUP | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |\n| AD_GROUP | NAME | ad group name string |\n| AD_GROUP | DEFAULT_BID_AMOUNT | amount in marketplace currency |\n| AD | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |\n| KEYWORD | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |\n| KEYWORD | BID_AMOUNT | amount in marketplace currency |\n| PRODUCT_TARGETING | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |\n| PRODUCT_TARGETING | BID_AMOUNT | amount in marketplace currency |\n| NEGATIVE_KEYWORD | STATUS | CREATED, ENABLED, PAUSED, ARCHIVED |","type":"string"},"timestamp":{"description":"unix time","type":"integer"}},"type":"object"},"type":"array"},"HistorySortParameter":{"properties":{"direction":{"default":"DESC","enum":["ASC","DESC"],"type":"string"},"key":{"enum":["DATE"],"type":"string"}},"type":"object"}},"securitySchemes":{}},"info":{"description":"Provides information about changes made to campaigns, adgroups, ads, etc","title":"Change history","version":"3.0"},"openapi":"3.0.1","paths":{"/history":{"post":{"description":"Returns history of changes for provided event sources that match the filters and time ranges specified. Only events that belong to the authenticated Advertiser can be queried. All times will be in UTC Epoch format. This API accepts identifiers in either the alphamumeric format (default), or the numeric format. If numeric IDs are supplied, then numeric IDs will be returned otherwise, alphanumeric IDs are returned. This API only returns change history for Sponsored Products and Sponsored Brands campaigns. Changes for Sponsored Display campaigns are not returned. Also, it doesn\u0027t return information about who made the change.\n\n**API Versioning:** This API supports versioning through the Accept header. Use `Accept: application/vnd.historyresponse.v1.1+json` to access version 1.1 features. **THEME event type requires version 1.1 or higher.** Without the proper Accept header, THEME requests will return a 400 error.\n\n**Requires one of these permissions**:\n[\"advertiser_campaign_edit\",\"advertiser_campaign_view\"]","operationId":"getHistory","requestBody":{"content":{"application/json":{"schema":{"example":{"count":"200","eventTypes":{"THEME":{"filters":["STATUS"],"parents":[{"adGroupId":"501439770526954","campaignId":"350988133398470","useProfileIdAdvertiser":"false"}]}},"fromDate":"1704195640000","sort":{"direction":"DESC","key":"DATE"},"toDate":"1704295640000"},"properties":{"count":{"description":"Requested number of results. Default 100. Minimum 50. Maximum 200.","type":"integer"},"eventTypes":{"$ref":"#/components/schemas/HistoryEventTypes"},"fromDate":{"description":"Max 90 days of history.","type":"integer"},"nextToken":{"description":"token from previous response to get next set of data.","type":"string"},"pageOffset":{"description":"Mutually exclusive with \u0027nextToken\u0027. Max results with pageOffset is 10000. Use nextToken instead for more results.","type":"integer"},"sort":{"$ref":"#/components/schemas/HistorySortParameter"},"toDate":{"type":"integer"}},"required":["eventTypes","fromDate","toDate"],"type":"object"}}},"description":"HistoryQuery","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"events":{"$ref":"#/components/schemas/HistoryResponseEvents"},"nextToken":{"description":"returned if not using pageOffset. Can be used in the request to request the next set of results.","type":"string"},"totalResults":{"description":"total results matching the query. Only provided for pageOffset queries and capped at 10000.","type":"integer"}},"type":"object"}}},"description":"Successful query. Result contains historical events matching query"},"400":{"content":{"application/json":{"examples":{"theme_version_error":{"summary":"THEME requires version 1.1+","value":{"code":400,"details":"Invalid request: Error: Key in HistoryEventTypes: THEME is not supported."}}},"schema":{"$ref":"#/components/schemas/HistoryError"}}},"description":"Bad Request. Common causes:\n- Invalid event type for API version (e.g., THEME without version 1.1+)\n- Invalid request parameters\n- Malformed request body"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryError"}}},"description":"Unauthorized - Request failed because user is not authenticated or is not allowed to invoke the operation."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryError"}}},"description":"Forbidden - Request failed because user does not have access to a specified resource"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryError"}}},"description":"Too Many Requests - Request was rate-limited. Retry later."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryError"}}},"description":"Internal Server Error - Something went wrong on the server. Retry later and report an error if unresolved."}},"summary":"History of entity changes."}}}}