openapi: 3.0.3 info: version: 5.13.0 title: Pinterest Audience API description: This is the description of your API. contact: name: Pinterest, Inc. url: https://developers.pinterest.com/ license: name: MIT url: https://spdx.org/licenses/MIT termsOfService: https://developers.pinterest.com/terms/ servers: - url: https://api.pinterest.com/v5 tags: - name: Audience paths: /ad_accounts/{ad_account_id}/ad_groups/audience_sizing: post: summary: Get audience sizing description: "Get potential audience size for an ad group with given targeting criteria. \nPotential audience size estimates the number of people you may be able to reach per month with your campaign. \nIt is based on historical advertising data and the targeting criteria you select.\nIt does not guarantee results or take into account factors such as bid, budget, schedule, seasonality or product experiments." operationId: ad_groups/audience_sizing security: - pinterest_oauth2: - ads:read x-ratelimit-category: ads_read x-sandbox: enabled parameters: - $ref: '#/components/parameters/path_ad_account_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/AdGroupAudienceSizingRequest' responses: '200': content: application/json: schema: $ref: '#/components/schemas/AdGroupAudienceSizingResponse' description: Success '400': description: Invalid ad group audience sizing parameters. content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 400 message: Invalid ad group audience sizing parameters. '403': description: No access to requested audience list or product group. content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 403 message: You don't have access to the requested audience list or product group. default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error tags: - Audience /ad_accounts/{ad_account_id}/audience_insights: get: summary: Get audience insights description: 'Get Audience Insights for an ad account. The response will return insights for 3 types of audiences: the ad account''s engaged audience on Pinterest, the ad account''s total audience on Pinterest and Pinterest''s total audience.
Learn more about Audience Insights.' operationId: audience_insights/get security: - pinterest_oauth2: - ads:read x-ratelimit-category: ads_read x-sandbox: disabled parameters: - $ref: '#/components/parameters/path_ad_account_id' - $ref: '#/components/parameters/query_audience_insight_type' responses: '200': content: application/json: schema: $ref: '#/components/schemas/AudienceInsightsResponse' description: Success default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error tags: - Audience /ad_accounts/{ad_account_id}/audiences/{audience_id}: get: summary: Get audience description: Get a specific audience given the audience ID. operationId: audiences/get security: - pinterest_oauth2: - ads:read x-ratelimit-category: ads_read x-sandbox: disabled parameters: - $ref: '#/components/parameters/path_ad_account_id' - $ref: '#/components/parameters/path_audience_id' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/Audience' '404': description: Audience not found. content: application/json: schema: $ref: '#/components/schemas/Error' default: description: Unexpected error. content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Audience patch: summary: Update audience description: Update (edit or remove) an existing targeting audience. operationId: audiences/update security: - pinterest_oauth2: - ads:write x-ratelimit-category: ads_write x-sandbox: disabled parameters: - $ref: '#/components/parameters/path_ad_account_id' - $ref: '#/components/parameters/path_audience_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/AudienceUpdateRequest' description: The audience to be updated. responses: '200': content: application/json: schema: $ref: '#/components/schemas/Audience' description: Success default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error tags: - Audience components: parameters: path_ad_account_id: name: ad_account_id description: Unique identifier of an ad account. in: path required: true schema: type: string pattern: ^\d+$ maxLength: 18 query_audience_insight_type: description: Type of audience insights. explode: false in: query name: audience_insight_type required: true schema: $ref: '#/components/schemas/AudienceInsightType' path_audience_id: name: audience_id description: Unique identifier of an audience in: path required: true schema: type: string pattern: ^\d+$ maxLength: 18 schemas: AudienceDemographics: title: AudienceDemographics description: Audience demographics type: object properties: ages: title: ages description: Ages distribution. type: array items: $ref: '#/components/schemas/AudienceDemographicValue' genders: title: genders description: Gender distribution. type: array items: $ref: '#/components/schemas/AudienceDemographicValue' devices: title: devices description: Device usage distribution. type: array items: $ref: '#/components/schemas/AudienceDemographicValue' metros: title: metros description: Geographic metro area distribution. type: array items: $ref: '#/components/schemas/AudienceDemographicValue' countries: title: countries description: Country area distribution. type: array items: $ref: '#/components/schemas/AudienceDemographicValue' Error: title: Error type: object properties: code: type: integer message: type: string required: - code - message AudienceCommon: title: AudienceCommon type: object properties: ad_account_id: title: ad_account_id description: Ad account ID. type: string example: '549755885175' pattern: ^\d+$ name: title: name description: Audience name. type: string example: string rule: $ref: '#/components/schemas/AudienceRule' Audience: properties: ad_account_id: description: Ad account ID. example: '549755885175' pattern: ^\d+$ title: ad_account_id type: string id: description: Audience ID. example: '1234' pattern: ^\d+$ title: id type: string name: description: Audience name. example: ACME Tools title: name type: string audience_type: type: string description: 'Audience types: ACTALIKE, ENGAGEMENT, CUSTOMER_LIST and VISITOR' title: audience_type description: description: Audience description. example: People who love making quilts. nullable: true title: description type: string rule: $ref: '#/components/schemas/AudienceRule' size: description: Audience size. example: 1000 nullable: true title: size type: integer status: type: string description: Audience status. READY, INITIALIZING, TOO_SMALL - Each audience list needs to have at least 100 people with Pinterest accounts before you can start using it. title: status type: description: Always "audience". example: audience title: type type: string created_timestamp: description: Creation time. Unix timestamp in seconds. example: 1451431341 nullable: true title: created_time type: integer updated_timestamp: description: Last update time. Unix timestamp in seconds. example: 1451431341 nullable: true title: updated_time type: integer title: Audience type: object ObjectiveType: type: string description: Campaign objective type. If set as one of ["AWARENESS", "CONSIDERATION", "WEB_CONVERSION", "CATALOG_SALES"] the campaign is considered as a Campaign Budget Optimization (CBO) campaign, meaning budget needs to be set at the campaign level rather than at the ad group level. ["WEB_SESSIONS"] is DEPRECATED. For update, only draft campaigns may update objective type. enum: - AWARENESS - CONSIDERATION - VIDEO_VIEW - WEB_CONVERSION - CATALOG_SALES - WEB_SESSIONS AudienceInsightsResponse: title: AudienceInsightsResponse description: Audience interests and demographics. type: object properties: categories: title: categories description: Category interest distribution type: array items: $ref: '#/components/schemas/AudienceCategory' demographics: $ref: '#/components/schemas/AudienceDemographics' type: $ref: '#/components/schemas/AudienceInsightType' date: title: date description: Generation date type: string nullable: true example: '2022-10-09' pattern: ^\d{4}-\d{2}-\d{2}$ size: title: size description: Population count. type: integer example: 10000 size_is_upper_bound: title: size_is_upper_bound description: Indicates whether the audience size has been rounded up to the next highest upper boundary. type: boolean example: true TargetingSpec: description: Ad group targeting specification defining the ad group target audience. For example, `{"APPTYPE":["iphone"], "GENDER":["male"], "LOCALE":["en-US"], "LOCATION":["501"], "AGE_BUCKET":["25-34"]}` type: object properties: AGE_BUCKET: type: array nullable: true description: Age ranges. If the AGE_BUCKET field is missing, the default behavior in terms of ad delivery is that **All age buckets** will be targeted. example: - 35-44 - 50-54 items: type: string enum: - 18-24 - 21+ - 25-34 - 35-44 - 45-49 - 50-54 - 55-64 - 65+ APPTYPE: type: array nullable: true description: Allowed devices. If the APPTYPE field is missing, the default behavior in terms of ad delivery is that **All devices/apptypes** will be targeted. example: - ipad - iphone items: type: string enum: - android_mobile - android_tablet - ipad - iphone - web - web_mobile AUDIENCE_EXCLUDE: type: array nullable: true description: 'Excluded customer list IDs. Used to drive new customer acquisition goals. For example: ["2542620905475"]. Audience lists need to have at least 100 people with Pinterest accounts in them. If the AUDIENCE_EXCLUDE field is missing, the default behavior in terms of ad delivery is that **No users will be excluded**.' items: type: string pattern: ^\d+$ minItems: 100 AUDIENCE_INCLUDE: type: array nullable: true description: 'Targeted customer list IDs. For example: ["2542620905473"]. Audience lists need to have at least 100 people with Pinterest accounts in them Audience lists need to have at least 100 people with Pinterest accounts in them. If the AUDIENCE_INCLUDE field is missing, the default behavior in terms of ad delivery is that **All users will be included**.' items: type: string pattern: ^\d+$ minItems: 100 GENDER: type: array nullable: true description: 'Targeted genders. Values: ["unknown","male","female"]. If the GENDER field is missing, the default behavior in terms of ad delivery is that **All genders will be targeted**.' items: type: string enum: - unknown - male - female GEO: type: array nullable: true description: Location region codes, e.g., "BE-VOV" (East Flanders, Belgium) For complete list, click here or postal codes, e.g., "US-94107". Use either region codes or postal codes but not both. At least one of LOCATION or GEO must be specified. If the GEO field is missing, then only LOCATION values will be targeted (see LOCATION field below). items: type: string INTEREST: type: array description: Array of interest object IDs. If the INTEREST field is missing, the default behavior in terms of ad delivery is that **All interests will be targeted**. items: type: string LOCALE: type: array nullable: true description: 24 ISO 639-1 two letter language codes. If the LOCALE field is missing, the default behavior in terms of ad delivery is that **All languages will be targeted, only english non-sublanguage will be targeted**. items: type: string LOCATION: type: array nullable: true description: 22 ISO Alpha 2 two letter country codes or US Nielsen DMA (Designated Market Area) codes (location region codes) (e.g., ["US", "807"]). For complete list, click here. Location-Country and Location-Metro codes apply. At least one of LOCATION or GEO must be specified. If the LOCATION field is missing, then only GEO values will be targeted (see GEO field above). items: type: string SHOPPING_RETARGETING: type: array nullable: true description: "Array of object: lookback_window\t[Integer]: Number of days ago to start lookback timeframe for dynamic retargeting tag_types [Array of integer]: Event types to target for dynamic retargeting exclusion_window [Integer]: Number of days ago to stop lookback timeframe for dynamic retargeting" items: type: object example: lookback_window: 30 exclusion_window: 14 tag_types: - 0 - 6 properties: lookback_window: description: Number of days ago to start lookback timeframe for dynamic retargeting example: 30 title: lookback_window type: integer tag_types: description: Event types to target for dynamic retargeting example: - 0 - 6 items: type: integer title: tag_types type: array exclusion_window: description: Number of days ago to stop lookback timeframe for dynamic retargeting example: 14 title: exclusion_window type: integer title: TargetingSpec_SHOPPING_RETARGETING TARGETING_STRATEGY: type: array nullable: true description: '' items: enum: - CHOOSE_YOUR_OWN - FIND_NEW_CUSTOMERS - RECONNECT_WITH_USERS AdGroupAudienceSizingRequest: type: object properties: auto_targeting_enabled: type: boolean description: Enable auto-targeting for ad group. Also known as "expanded targeting". example: true default: true placement_group: type: string allOf: - $ref: '#/components/schemas/PlacementGroupType' default: ALL description: Placement group. creative_types: description: Pin creative types filter. Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. type: array items: type: string example: REGULAR enum: - REGULAR - VIDEO - SHOPPING - CAROUSEL - MAX_VIDEO - SHOP_THE_PIN - COLLECTION - IDEA nullable: true targeting_spec: $ref: '#/components/schemas/TargetingSpec' product_group_ids: type: array items: type: string pattern: ^\d+$ example: '23423422123' description: Targeted product group IDs. Note: This can only be combined with shopping/catalog sales campaigns. For more information, click here. SHOPPING_RETARGETING must be included in targeting_spec object or this field will be ignored. nullable: true keywords: type: array description: Array of keyword objects. If the keywords field is missing, all keywords will be targeted. items: type: object properties: match_type: $ref: '#/components/schemas/MatchTypeResponse' value: type: string description: Keyword value (120 chars max). required: - match_type - value nullable: true MatchTypeResponse: type: string description: Keyword match type nullable: true example: BROAD enum: - BROAD - PHRASE - EXACT - EXACT_NEGATIVE - PHRASE_NEGATIVE - null Currency: type: string description: Currency Codes from ISO 4217 example: USD enum: - UNK - USD - GBP - CAD - EUR - AUD - NZD - SEK - ILS - CHF - HKD - JPY - SGD - KRW - NOK - DKK - PLN - RON - HUF - CZK - BRL - MXN - ARS - CLP - COP AudienceDemographicValue: title: AudienceDemographicValue description: Demographic detail for a single audience demographic type: object properties: key: title: key description: Unique key for demographic item type: string example: us name: title: name description: Display name for demographic type: string example: United States ratio: title: ratio description: Value of demographic item as a percent of total audience type: number example: 0.551 example: name: United States key: us ratio: 0.551 AudienceUpdateRequest: type: object allOf: - $ref: '#/components/schemas/AudienceCommon' - title: AudienceUpdateRequest type: object properties: description: $ref: '#/components/schemas/AudienceDescription' operation_type: $ref: '#/components/schemas/AudienceUpdateOperationType' AudienceRule: description: 'JSON object defining targeted audience users. Example rule formats per audience type: