Pinterest Ad API

The Ad API from Pinterest — 63 operation(s) for ad.

OpenAPI Specification

pinterest-ad-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 5.13.0
  title: Pinterest Ad 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: Ad
paths:
  /ad_accounts:
    get:
      summary: List ad accounts
      description: 'Get a list of the ad_accounts that the "operation user_account" has access to.

        - This includes ad_accounts they own and ad_accounts that are owned by others who have granted them <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>.'
      tags:
      - Ad
      operationId: ad_accounts/list
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/query_bookmark'
      - $ref: '#/components/parameters/query_page_size'
      - $ref: '#/components/parameters/query_include_shared_accounts'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Paginated'
                - type: object
                  properties:
                    items:
                      description: Ad accounts
                      items:
                        $ref: '#/components/schemas/AdAccount'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create ad account
      description: 'Create a new ad account. Different ad accounts can support different currencies, payment methods, etc.

        An ad account is needed to create campaigns, ad groups, and ads; other accounts (your employees or partners) can be assigned business access and appropriate roles to access an ad account. <p/>

        You can set up up to 50 ad accounts per user. (The user must have a business account to create an ad account.) <p/>

        For more, see <a class="reference external" href="https://help.pinterest.com/en/business/article/create-an-advertiser-account">Create an advertiser account</a>.'
      tags:
      - Ad
      operationId: ad_accounts/create
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      x-sandbox: enabled
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdAccountCreateRequest'
        description: Ad account to create.
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdAccount'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
  /ad_accounts/{ad_account_id}:
    get:
      summary: Get ad account
      description: Get an ad account
      operationId: ad_accounts/get
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdAccount'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Ad
  /ad_accounts/{ad_account_id}/ad_groups:
    get:
      summary: List ad groups
      description: 'List ad groups based on provided campaign IDs or ad group IDs.(campaign_ids or ad_group_ids). <p/>

        <strong>Note:</strong><p/>

        Provide only campaign_id or ad_group_id. Do not provide both.'
      operationId: ad_groups/list
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_campaign_ids'
      - $ref: '#/components/parameters/query_ad_group_ids'
      - $ref: '#/components/parameters/query_entity_statuses'
      - $ref: '#/components/parameters/query_page_size'
      - $ref: '#/components/parameters/query_order'
      - $ref: '#/components/parameters/query_bookmark'
      - $ref: '#/components/parameters/query_translate_interests_to_names'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Paginated'
                - type: object
                  properties:
                    items:
                      type: array
                      items:
                        $ref: '#/components/schemas/AdGroupResponse'
          description: Success
        '400':
          description: Invalid ad account group parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Invalid ad account group parameters.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Ad
    post:
      summary: Create ad groups
      description: "Create multiple new ad groups. All ads in a given ad group will have the same budget, bid, run dates, targeting, and placement (search, browse, other). For more information, <a href=\"https://help.pinterest.com/en/business/article/campaign-structure\" target=\"_blank\"> click here</a>.</p>\n<strong>Note:</strong>\n- 'bid_in_micro_currency' and 'budget_in_micro_currency' should be expressed in microcurrency amounts based on the currency field set in the advertiser's profile.<p/>\n<p>Microcurrency is used to track very small transactions, based on the currency set in the advertisers profile.</p>\n<p>A microcurrency unit is 10^(-6) of the standard unit of currency selected in the advertisers profile.</p>\n <p><strong>Equivalency equations</strong>, using dollars as an example currency:</p>\n<ul>\n  <li>$1 = 1,000,000 microdollars</li>\n  <li>1 microdollar = $0.000001 </li>\n</ul>\n<p><strong>To convert between currency and microcurrency</strong>, using dollars as an example currency:</p>\n<ul>\n  <li>To convert dollars to microdollars, mutiply dollars by 1,000,000</li>\n  <li>To convert microdollars to dollars, divide microdollars by 1,000,000</li>\n</ul>\n- Ad groups belong to ad campaigns. Some types of campaigns (e.g. budget optimization) have limits on the number of ad groups they can hold. If you exceed those limits, you will get an error message.\n- Start and end time cannot be set for ad groups that belong to CBO campaigns. Currently, campaigns with the following objective types: TRAFFIC, AWARENESS, WEB_CONVERSIONS, and CATALOG_SALES will default to CBO."
      operationId: ad_groups/create
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/AdGroupCreateRequest'
              maxItems: 30
              minItems: 1
              type: array
        description: List of ad groups to create, size limit [1, 30].
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdGroupArrayResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Ad
    patch:
      summary: Update ad groups
      description: Update multiple existing ad groups.
      operationId: ad_groups/update
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/AdGroupUpdateRequest'
              maxItems: 30
              minItems: 1
              type: array
        description: List of ad groups to update, size limit [1, 30].
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdGroupArrayResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Ad
  /ad_accounts/{ad_account_id}/ad_groups/analytics:
    get:
      summary: Get ad group analytics
      description: 'Get analytics for the specified ad groups in the specified <code>ad_account_id</code>, filtered by the specified options.

        - The token''s user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager.

        - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days.

        - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.'
      operationId: ad_groups/analytics
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_analytics
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_start_date'
      - $ref: '#/components/parameters/query_end_date'
      - $ref: '#/components/parameters/query_ad_group_ids_required'
      - $ref: '#/components/parameters/query_columns'
      - $ref: '#/components/parameters/query_granularity'
      - $ref: '#/components/parameters/query_conversion_attribution_click_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_engagement_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_view_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_conversion_report_time'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdGroupsAnalyticsResponse'
          description: Success
        '400':
          description: Invalid ad account group analytics parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Invalid ad account group analytics parameters.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Ad
  /ad_accounts/{ad_account_id}/ad_groups/targeting_analytics:
    get:
      summary: Get targeting analytics for ad groups
      description: 'Get targeting analytics for one or more ad groups.

        For the requested ad group(s) and metrics, the response will include the requested metric information

        (e.g. SPEND_IN_DOLLAR) for the requested target type (e.g. "age_bucket") for applicable values (e.g. "45-49"). <p/>

        - The token''s user_account must either be the Owner of the specified ad account, or have one

        of the necessary roles granted to them via

        <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager.

        - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days.

        - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.'
      operationId: ad_groups_targeting_analytics/get
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_analytics
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_ad_group_ids_required'
      - $ref: '#/components/parameters/query_start_date'
      - $ref: '#/components/parameters/query_end_date'
      - $ref: '#/components/parameters/query_targeting_types'
      - $ref: '#/components/parameters/query_columns'
      - $ref: '#/components/parameters/query_granularity'
      - $ref: '#/components/parameters/query_conversion_attribution_click_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_engagement_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_view_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_conversion_report_time'
      - $ref: '#/components/parameters/query_attribution_types'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsResponse'
          description: Success
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Ad
  /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:
      - Ad
  /ad_accounts/{ad_account_id}/ad_groups/{ad_group_id}:
    get:
      summary: Get ad group
      description: 'Get a specific ad given the ad ID. If your pin is rejected, rejected_reasons will

        contain additional information from the Ad Review process.

        For more information about our policies and rejection reasons see the <a href="https://www.pinterest.com/_/_/policy/advertising-guidelines/"

        target="_blank">Pinterest advertising standards</a>.'
      operationId: ad_groups/get
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/path_ad_group_id'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdGroupResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Ad
  /ad_accounts/{ad_account_id}/ad_previews:
    post:
      summary: Create ad preview with pin or image
      description: 'Create an ad preview given an ad account ID and either an existing organic pin ID or the URL for an image to be used to create the Pin and the ad. <p/>

        If you are creating a preview from an existing Pin, that Pin must be promotable: that is, it must have a clickthrough link and meet other requirements. (See <a href="https://help.pinterest.com/en/business/article/promoted-pins-overview" target="_blank">Ads Overview</a>.) <p/>

        You can view the returned preview URL on a webpage or iframe for 7 days, after which the URL expires. Collection ads are not currently supported ad preview.'
      tags:
      - Ad
      operationId: ad_previews/create
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        description: Create ad preview with pin or image.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdPreviewRequest'
      responses:
        '200':
          description: Successful ad preview creation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdPreviewURLResponse'
        '400':
          description: Invalid Pin parameters response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InvalidPinUrl:
                  value:
                    code: 1
                    message: Whoops! It looks like you entered an invalid URL. Try creating a Pin again with a valid URL.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /ad_accounts/{ad_account_id}/ads:
    get:
      summary: List ads
      description: "List ads that meet the filters provided:\n  - Listed campaign ids or ad group ids or ad ids\n  - Listed entity statuses <p/>\nIf no filter is provided, all ads in the ad account are returned. <p/>\n<strong>Note:</strong><p/>\nProvide only campaign_id or ad_group_id or ad_id. Do not provide more than one type. <p/>\nReview status is provided for each ad; if review_status is REJECTED, the rejected_reasons field will contain additional information.\nFor more, see <a href=\"https://policy.pinterest.com/en/advertising-guidelines\">Pinterest advertising standards</a>."
      operationId: ads/list
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_campaign_ids'
      - $ref: '#/components/parameters/query_ad_group_ids'
      - $ref: '#/components/parameters/query_ad_ids'
      - $ref: '#/components/parameters/query_entity_statuses'
      - $ref: '#/components/parameters/query_page_size'
      - $ref: '#/components/parameters/query_order'
      - $ref: '#/components/parameters/query_bookmark'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Paginated'
                - type: object
                  properties:
                    items:
                      type: array
                      items:
                        $ref: '#/components/schemas/AdResponse'
          description: Success
        '400':
          description: Invalid ad account ads parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Invalid ad account ads parameters.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Ad
    post:
      description: Create multiple new ads. Request must contain ad_group_id, creative_type, and the source Pin pin_id.
      operationId: ads/create
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/AdCreateRequest'
              maxItems: 30
              minItems: 1
              type: array
        description: List of ads to create, size limit [1, 30].
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdArrayResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Create ads
      tags:
      - Ad
    patch:
      description: Update multiple existing ads
      operationId: ads/update
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/AdUpdateRequest'
              maxItems: 30
              minItems: 1
              type: array
        description: List of ads to update, size limit [1, 30]
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdArrayResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Update ads
      tags:
      - Ad
  /ad_accounts/{ad_account_id}/ads/analytics:
    get:
      summary: Get ad analytics
      description: 'Get analytics for the specified ads in the specified <code>ad_account_id</code>, filtered by the specified options.

        - The token''s user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager.

        - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days.

        - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.'
      operationId: ads/analytics
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_analytics
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_start_date'
      - $ref: '#/components/parameters/query_end_date'
      - $ref: '#/components/parameters/query_ad_ids_required'
      - $ref: '#/components/parameters/query_columns'
      - $ref: '#/components/parameters/query_granularity'
      - $ref: '#/components/parameters/query_conversion_attribution_click_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_engagement_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_view_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_conversion_report_time'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdsAnalyticsResponse'
          description: Success
        '400':
          description: Invalid ad account ads analytics parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Invalid ad account ads analytics parameters.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Ad
  /ad_accounts/{ad_account_id}/ads_credit/discounts:
    get:
      summary: Get ads credit discounts
      description: 'Returns the list of discounts applied to the account.


        <strong>This endpoint might not be available to all apps. <a href=''/docs/new/about-beta-access/''>Learn more</a>.</strong>'
      operationId: ads_credits_discounts/get
      security:
      - pinterest_oauth2:
        - ads:read
        - billing:read
      x-ratelimit-category: ads_read
      x-sandbox: disabled
      tags:
      - Ad
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_bookmark'
      - $ref: '#/components/parameters/query_page_size'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Paginated'
                - type: object
                  properties:
                    items:
                      type: array
                      items:
                        $ref: '#/components/schemas/AdsCreditDiscountsResponse'
          description: Success
        default:
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /ad_accounts/{ad_account_id}/ads_credit/redeem:
    post:
      summary: Redeem ad credits
      description: 'Redeem ads credit on behalf of the ad account id and apply it towards billing.


        <strong>This endpoint might not be available to all apps. <a href=''/docs/new/about-beta-access/''>Learn more</a>.</strong>'
      tags:
      - Ad
      operationId: ads_credit/redeem
      security:
      - pinterest_oauth2:
        - ads:write
        - billing:write
      x-ratelimit-category: ads_write
      x-sandbox: disabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        description: Redeem ad credits request.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdsCreditRedeemRequest'
      responses:
        '200':
          description: Successfully redeemed ad credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdsCreditRedeemResponse'
        '400':
          description: Error thrown when unable to redeem offer code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                ValidationError:
                  value:
                    code: 15
                    message: Unable to redeem offer code. Try again later.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /ad_accounts/{ad_account_id}/ads/targeting_analytics:
    get:
      summary: Get targeting analytics for ads
      description: 'Get targeting analytics for one or more ads. For the requested ad(s) and metrics,

        the response will include the requested metric information (e.g. SPEND_IN_DOLLAR) for the requested target type

        (e.g. "age_bucket") for applicable values (e.g. "45-49"). <p/>

        - The token''s user_account must either be the Owner of the specified ad account, or have one

        of the necessary roles granted to them via

        <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager.

        - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days.

        - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.'
      operationId: ad_targeting_analytics/get
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_analytics
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_ad_ids_required'
      - $ref: '#/components/parameters/query_start_date'
      - $ref: '#/components/parameters/query_end_date'
      - $ref: '#/components/parameters/query_targeting_types'
      - $ref: '#/components/parameters/query_columns'
      - $ref: '#/components/parameters/query_granularity'
      - $ref: '#/components/parameters/query_conversion_attribution_click_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_engagement_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_view_window_days'
      - $ref: '#/components/parameters/query_conversion_attribution_conversion_report_time'
      - $ref: '#/components/parameters/query_attribution_types'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Ad
  /ad_accounts/{ad_account_id}/ads/{ad_id}:
    get:
      summary: Get ad
      description: 'Get a specific ad given the ad ID. If your pin is rejected, rejected_reasons will

        contain additional information from the Ad Review process.

        For more information about our policies and rejection reasons see the <a href="https://www.pinterest.com/_/_/policy/advertising-guidelines/"

        target="_blank">Pinterest advertising standards</a>.'
      operationId: ads/get
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit

# --- truncated at 32 KB (449 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/pinterest/refs/heads/main/openapi/pinterest-ad-api-openapi.yml