Overview
Availability: Available Targeting defines where and how a line item can serve. Each target has a target type and type-specific details. The Get Targets endpoint retrieves theManualKeyword, PageType, and Category targets configured for a line item.
The Create Targets endpoint creates ManualKeyword, PageType, and Category targets for a line item. The Update Targets and Delete Targets endpoints modify or remove those targets in bulk.
Geography targets are supported by the API but not yet documented here.Targeting Types
All endpoints use Target resources. A target’stargetType determines the one target details object it contains. A target must contain exactly one details object that matches its targetType.
Bid multipliers are supported only on non-negative targets. For ManualKeyword targets, bid multipliers are matched using the retailer’s default language.
Create, Update, and Delete requests can contain up to 100 targets, may mix target types, and cannot contain the same target more than once.
Shared Target Attributes
Target Type Details
Target Request Attributes
Create, Update, and Delete use the same request shape:Partial Success Across Target Types
All target endpoints support partial success by target type. An endpoint can return200 OK even when one target type fails; inspect both errors and warnings before treating the response as complete.
Identifying Targets for Update and Delete
To update or delete targets, copy the target resources fromdata in a Get Targets response into the request’s data array. An Update request can change the mutable fields listed below. A Delete request can use the fetched target resources without changes.
The response-only approvalStatus field can remain in a copied resource; it does not change approval status.
The identity fields cannot be changed with Update. To change one, delete the existing target and create a new one.
Endpoints
Get Targets
Retrieves theManualKeyword, PageType, and Category targets configured for the specified line item. Use offset and limit to page through the targets retrieved successfully.
Prerequisites:
- OAuth 2.0 bearer token with the
RetailMedia_Campaign_Readscope - Access to the requested line item
Request Attributes
Response Attributes
Each resource in
data is a Target. See Targeting types for its shared attributes and the details object for each target type.
Sample Request
200 OK
Responses
Partial Success
If one or more target types are available, Get returns200 OK with those targets in data and describes any unavailable target types in errors. If retrieval fails for every supported target type, it returns a non-200 response with no target data.
The metadata.count value is the total number of targets retrieved successfully before pagination. If offset is greater than or equal to metadata.count, data is empty. The errors and warnings arrays apply to the full response and are not affected by pagination.
The following example shows a successful response when ManualKeyword targets are unavailable. The response still includes the available PageType and Category targets. Clients should process those targets and inspect errors before treating the response as complete.
ManualKeyword targets unavailable — 200 OK
Create Targets
CreatesManualKeyword, PageType, and Category targets for the specified line item.
Prerequisites:
- OAuth 2.0 bearer token with the
RetailMedia_Campaign_Managescope - Access to the requested line item
Examples
Successful Request200 OK
Responses
Validation Errors
Create responses can include the following application-level validation errors inerrors:
Partial Success Example
Partial-Success Request200 OK
Update Targets
UpdatesManualKeyword, PageType, and Category targets for the specified line item.
The request has PATCH-like semantics: only mutable fields supplied in the request are updated. See Identifying targets for Update and Delete for the fields that identify each target and the fields that can be updated.
Prerequisites:
- OAuth 2.0 bearer token with the
RetailMedia_Campaign_Managescope - Access to the requested line item
Example
Successful Request200 OK
Responses
Validation Errors
Update responses can include the following application-level validation errors inerrors:
Delete Targets
DeletesManualKeyword, PageType, and Category targets from the specified line item. See Identifying targets for Update and Delete for how to select targets to delete.
Prerequisites:
- OAuth 2.0 bearer token with the
RetailMedia_Campaign_Managescope - Access to the requested line item
Example
Successful Request200 OK
data array. Use Get Targets to retrieve the targets remaining on the line item.
Responses
Deleting a PageType target can also remove Category targets associated only with that page type. The response then includes a
category-targets-removed-with-page-type warning.
Validation Errors
Delete responses can include the following application-level validation errors inerrors: