Overview
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.
Clients should inspect the errors array even when the endpoint returns 200 OK. The endpoint supports partial success by target type: if a target type is unavailable, other available target types can still be included in the response.
The Create Targets endpoint creates ManualKeyword, PageType, and Category targets for a line item. The Update Targets endpoint updates 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.
Create and Update 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
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
The endpoint supports partial success by target type. If one or more target types are available, it 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. A single request can contain targets of more than one supported target type.
Prerequisites:
- OAuth 2.0 bearer token with the
RetailMedia_Campaign_Managescope - Access to the requested line item
Request Attributes
Examples
Successful Request200 OK
Responses
Partial Success
Create requests can contain up to 100 targets and can include more than one supported target type. They can return200 OK with created targets in data and errors for target types that did not succeed. Always inspect errors and warnings before treating the response as complete.
Validation errors in partial-success responses
Create responses can include the following application-level validation errors inerrors:
Example
Partial-Success Request200 OK
Update Targets
UpdatesManualKeyword, PageType, and Category targets for the specified line item. A single request can contain targets of more than one supported target type.
The request has PATCH-like semantics. The immutable target details identify each target, and the mutable fields supplied in the request are updated. Do not use this endpoint to change a target’s targetType or target details object; identify the existing target with the same targetType and exactly one target details object.
Prerequisites:
- OAuth 2.0 bearer token with the
RetailMedia_Campaign_Managescope - Access to the requested line item
Request Attributes
Fields by target type
To update a target, provide its existingtargetType and matching target details. Those fields identify the target and cannot be changed by this endpoint.
Example
Successful Request200 OK
Responses
Partial Success
Update requests can contain up to 100 targets and can include more than one supported target type. They can return200 OK with updated targets in data and errors for target types that did not succeed. Always inspect errors and warnings before treating the response as complete.
Validation errors in partial-success responses
Update responses can include the following application-level validation errors inerrors: