openapi: 3.0.1 info: title: ADSP Audiences version: "3.0" servers: - url: / paths: /dsp/audiences: post: tags: - Audiences summary: Creates an audience. description: |- Creates a targeting audience based on an audience definition. **Requires one of these permissions**: ["advertiser_campaign_edit","advertiser_campaign_view","audiences_edit"] operationId: dspCreateAudiencesPost parameters: - name: Amazon-Advertising-API-ClientId in: header description: The identifier of a client associated with a "Login with Amazon" account. required: true style: simple explode: false schema: type: string - name: Amazon-Advertising-API-Scope in: header description: The identifier of a profile associated with the advertiser account. Use `GET` method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header and choose profile id `profileId` from the response to pass it as input. required: true style: simple explode: false schema: type: string - name: advertiserId in: query description: The advertiser to create audience for. required: true style: form explode: true schema: type: string requestBody: description: "An array of audience objects. For each object, specify required\ \ fields and their values. Maximum length of the array is 1." content: application/vnd.dspaudiences.v1+json: schema: maxItems: 1 minItems: 1 type: array items: $ref: '#/components/schemas/DspAudienceCreateRequestItem' responses: "207": description: This holds an object representing an array of success items and an arrray of error (failed) items corresponding to the index in the request body. content: application/vnd.dspaudiencesresponse.v1+json: schema: $ref: '#/components/schemas/DspAudienceResponse' "400": description: Bad request or request body is not matching with input model. content: application/vnd.dspaudienceserror.v1+json: schema: $ref: '#/components/schemas/DspAudienceError' example: message: Malformed JSON "403": description: Forbidden - request failed because user is not authorized to access a resource. content: application/vnd.dspaudienceserror.v1+json: schema: $ref: '#/components/schemas/DspAudienceError' example: message: Unauthorized Access components: schemas: DspAudienceCreateRequestItem: required: - audienceType - description - idempotencyKey - lookback - name - rules type: object properties: audienceType: type: string description: Type of audience to create. enum: - PRODUCT_PURCHASES - PRODUCT_SEARCH - PRODUCT_SIMS - PRODUCT_VIEWS - WHOLE_FOODS_MARKET_PURCHASES country: maxLength: 2 minLength: 2 type: string description: "The ISO Alpha-2 code for the country in which the audience\ \ will be available during audience discovery and targeting setup.\n\n\ **Notes:** \n- If you are using a Global Advertising account, this field\ \ is required.\n- If you are not using a Global Advertising account, this\ \ field is optional. If used, it must be same as the advertiser's country.\n" example: US enum: - AE - AU - BR - CA - DE - ES - FR - GB - IN - IT - JP - MX - NL - SA - SE - TR - US description: maxLength: 1000 minLength: 1 type: string description: The audience description. idempotencyKey: type: string description: The unique UUID for this requested audience. format: uuid lookback: maximum: 365 minimum: 1 type: integer description: | The specified time period (in days) to include those who performed the action in the audience. Lookback Constraints Table: Provides available valid values of lookback allowed for given audienceType | audienceType | lookback range | |------------------------------|-------| | PRODUCT_PURCHASES | 1-365 | | PRODUCT_VIEWS | 1-90 | | PRODUCT_SEARCH | 1-90 | | PRODUCT_SIMS | 1-90 | | WHOLE_FOODS_MARKET_PURCHASES | 1-365 | name: maxLength: 128 minLength: 1 type: string description: The audience name. rules: maxItems: 1 minItems: 1 type: array description: The set of rules defining an audience; these rules will be ORed. items: $ref: '#/components/schemas/DspAudienceRule' description: Complete audience model to be used for creation of the audience. DspAudienceError: required: - message type: object properties: message: type: string description: The error object. DspAudienceErrorItem: required: - errors - idempotencyKey - index - message properties: errors: maxItems: 7 minItems: 0 type: array items: $ref: '#/components/schemas/DspAudienceErrorItemError' idempotencyKey: type: string description: The UUID provided in the request for creation of this audience. index: type: integer description: "The index of the DspAudienceCreateRequestItem from the request,\ \ e.g. 1st item in the batch request will correspond to index 0 in the\ \ response." message: type: string description: A human-readable description of the response. description: The error response object. example: idempotencyKey: idempotencyKey index: 0 message: message errors: - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message DspAudienceErrorItemError: required: - errorType - message type: object properties: errorType: type: string enum: - OTHER - VALUE_INVALID - VALUE_OUT_OF_RANGE fieldName: type: string message: type: string description: The error object. example: fieldName: fieldName errorType: OTHER message: message DspAudienceResponse: required: - error - success type: object properties: error: maxItems: 1 minItems: 0 type: array description: The items in this array represent items in the request that failed. items: $ref: '#/components/schemas/DspAudienceErrorItem' success: maxItems: 1 minItems: 0 type: array description: The items in this array represent items in the request that were successful. items: $ref: '#/components/schemas/DspAudienceSuccessItem' description: This holds an array of successful items and an array of error items from the request. example: success: - idempotencyKey: idempotencyKey index: 6 audienceId: audienceId error: - idempotencyKey: idempotencyKey index: 0 message: message errors: - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message - fieldName: fieldName errorType: OTHER message: message DspAudienceRule: required: - attributeType - attributeValues - clause - operator type: object properties: attributeType: type: string description: "For a given audienceType, the type of the attributes being\ \ supplied." enum: - ASIN attributeValues: maxItems: 1000 minItems: 1 type: array description: "For a given audienceType and attributeType combination, the\ \ attribute values being supplied." items: type: string clause: type: string description: This parameter is used to include or exclude this particular rule. Currently only include is supported. enum: - INCLUDE operator: type: string description: "For a given attributeType, the operator used for attributeValues." enum: - ONE_OF description: | A rule for defining an audience. **Rule Constraints Table**: Provides available valid combinations of parameters allowed in DspAudienceRule | audienceType | attributeType | attributeValues | max attribute values | max rules | |------------------------------|-----------|-----------------------------------------------------------------------------------------------------|------|---| | PRODUCT_PURCHASES | ASIN | product IDs (ASINs) e.g. B08V4T57R2 | 1000 | 1 | | PRODUCT_VIEWS | ASIN | product IDs (ASINs) e.g. B08V4T57R2 | 1000 | 1 | | PRODUCT_SEARCH | ASIN | product IDs (ASINs) e.g. B08V4T57R2 | 1000 | 1 | | PRODUCT_SIMS | ASIN | product IDs (ASINs) e.g. B08V4T57R2 | 1000 | 1 | | WHOLE_FOODS_MARKET_PURCHASES | ASIN | Whole Foods Market product IDs (ASINs) e.g. B01B2OVUAG | 500 | 1 | DspAudienceSuccessItem: required: - audienceId - idempotencyKey - index type: object properties: audienceId: type: string description: The audience identifier. idempotencyKey: type: string description: The UUID provided in the request for creation of this audience. index: type: integer description: "The index of the DspAudienceCreateRequestItem from the request,\ \ e.g. 1st item in the batch request will correspond to index 0 in the\ \ response." description: The success response object. example: idempotencyKey: idempotencyKey index: 6 audienceId: audienceId responses: {} parameters: {} examples: {} requestBodies: {} headers: {} securitySchemes: {} links: {} callbacks: {}