Pinterest Campaigns API

The Campaigns API from Pinterest — 4 operation(s) for campaigns.

OpenAPI Specification

pinterest-campaigns-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 5.13.0
  title: Pinterest Campaigns 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: Campaigns
paths:
  /ad_accounts/{ad_account_id}/campaigns:
    get:
      summary: List campaigns
      description: 'Get a list of the campaigns 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.'
      operationId: campaigns/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_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/CampaignResponse'
          description: Success
        '400':
          description: Invalid ad account campaign parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Invalid ad account campaign parameters.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Campaigns
    post:
      summary: Create campaigns
      description: "Create multiple new campaigns. Every campaign has its own campaign_id and houses one or more ad groups, which contain one or more ads.\nFor more, see <a href=\"https://help.pinterest.com/en/business/article/set-up-your-campaign/\">Set up your campaign</a>. <p/>\n<strong>Note:</strong>\n- The values for 'lifetime_spend_cap' and 'daily_spend_cap' are microcurrency amounts based on the currency field set in the advertiser's profile. (e.g. USD) <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>"
      tags:
      - Campaigns
      operationId: campaigns/create
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        description: Array of campaigns.
        required: true
        content:
          application/json:
            schema:
              type: array
              maxItems: 30
              minItems: 1
              items:
                $ref: '#/components/schemas/CampaignCreateRequest'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignCreateResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update campaigns
      description: "Update multiple ad campaigns based on campaign_ids. <p/>\n<strong>Note:</strong><p/>\n - <p>The values for 'lifetime_spend_cap' and 'daily_spend_cap' are microcurrency amounts based on the currency field set in the advertiser's profile. (e.g. USD) <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 advertiser s 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>"
      tags:
      - Campaigns
      operationId: campaigns/update
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        description: Array of campaigns.
        required: true
        content:
          application/json:
            schema:
              type: array
              maxItems: 30
              minItems: 1
              items:
                $ref: '#/components/schemas/CampaignUpdateRequest'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignUpdateResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /ad_accounts/{ad_account_id}/campaigns/analytics:
    get:
      summary: Get campaign analytics
      description: 'Get analytics for the specified campaigns 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: campaigns/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_campaign_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/CampaignsAnalyticsResponse'
          description: Success
        '400':
          description: Invalid ad account campaign analytics parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Invalid ad account campaign analytics parameters.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Campaigns
  /ad_accounts/{ad_account_id}/campaigns/targeting_analytics:
    get:
      summary: Get targeting analytics for campaigns
      description: 'Get targeting analytics for one or more campaigns.

        For the requested account 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: campaign_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_campaign_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:
      - Campaigns
  /ad_accounts/{ad_account_id}/campaigns/{campaign_id}:
    get:
      summary: Get campaign
      description: Get a specific campaign given the campaign ID.
      operationId: campaigns/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_campaign_id'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Campaigns
components:
  schemas:
    CampaignCreateCommon:
      type: object
      allOf:
      - $ref: '#/components/schemas/CampaignCommon'
      - type: object
        properties:
          status:
            type: string
            default: ACTIVE
            allOf:
            - $ref: '#/components/schemas/EntityStatus'
          is_flexible_daily_budgets:
            type: boolean
            default: false
            allOf:
            - $ref: '#/components/schemas/CampaignIsFlexibleDailyBudgets'
          default_ad_group_budget_in_micro_currency:
            type: integer
            description: When transitioning from campaign budget optimization to non-campaign budget optimization, the default_ad_group_budget_in_micro_currency will propagate to each child ad groups daily budget. Unit is micro currency of the associated advertiser account.
            example: 0
            nullable: true
          is_automated_campaign:
            type: boolean
            default: false
            allOf:
            - $ref: '#/components/schemas/CampaignIsAutomatedCampaign'
    EntityStatus:
      type: string
      description: Entity status
      example: ACTIVE
      enum:
      - ACTIVE
      - PAUSED
      - ARCHIVED
      - DRAFT
      - DELETED_DRAFT
    Error:
      title: Error
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
      required:
      - code
      - message
    Exception:
      title: Generic exception class to be used within schemas
      type: object
      properties:
        code:
          type: integer
          example: 2
          description: Exception error code.
        message:
          type: string
          example: Advertiser not found.
          description: Exception message.
    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
    CampaignResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/CampaignId'
      - $ref: '#/components/schemas/CampaignCommon'
      - type: object
        properties:
          objective_type:
            $ref: '#/components/schemas/ObjectiveType'
          created_time:
            type: integer
            description: Campaign creation time. Unix timestamp in seconds.
            example: 1432744744
          updated_time:
            type: integer
            description: UTC timestamp. Last update time.
            example: 1432744744
          type:
            type: string
            description: Always "campaign".
            example: campaign
          is_flexible_daily_budgets:
            type: boolean
            description: Determines if a campaign has flexible daily budgets setup.
            example: true
            nullable: true
          is_campaign_budget_optimization:
            type: boolean
            description: Determines if a campaign automatically generate ad-group level budgets given a campaign budget to maximize campaign outcome. When transitioning from non-cbo to cbo, all previous child ad group budget will be cleared.
            example: true
            nullable: true
    CampaignCreateResponseItem:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CampaignCreateResponseData'
        exceptions:
          type: array
          items:
            $ref: '#/components/schemas/Exception'
    CampaignIsFlexibleDailyBudgets:
      type: boolean
      description: Determine if a campaign has flexible daily budgets setup.
      example: true
      default: false
    CampaignCreateResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CampaignCreateResponseItem'
    MetricsResponse:
      properties:
        data:
          items:
            type: object
          type: array
          example:
          - targeting_type: KEYWORD
            targeting_value: christmas decor ideas
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: APPTYPE
            targeting_value: iphone
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: APPTYPE
            targeting_value: ipad
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: APPTYPE
            targeting_value: web
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: APPTYPE
            targeting_value: web_mobile
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: APPTYPE
            targeting_value: android_mobile
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: APPTYPE
            targeting_value: android_tablet
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: GENDER
            targeting_value: female
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: LOCATION
            targeting_value: 500
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: PLACEMENT
            targeting_value: SEARCH
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: COUNTRY
            targeting_value: US
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: TARGETED_INTEREST
            targeting_value: Food and Drinks
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: PINNER_INTEREST
            targeting_value: Chocolate Cookies
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: AUDIENCE_INCLUDE
            targeting_value: 254261234567
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: GEO
            targeting_value: US:94102
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: AGE_BUCKET
            targeting_value: 45-49
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
          - targeting_type: REGION
            targeting_value: US-CA
            metrics:
              AD_GROUP_ID: 2680067996745
              DATE: '2022-04-26'
              SPEND_IN_DOLLAR: 240
      type: object
    Paginated:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
        bookmark:
          type: string
          nullable: true
      required:
      - items
    CampaignUpdateResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/CampaignCreateResponse'
    CampaignIsAutomatedCampaign:
      type: boolean
      description: Specifies whether the campaign was created in the automated campaign flow
      example: true
      default: false
    CampaignUpdateRequest:
      type: object
      allOf:
      - $ref: '#/components/schemas/CampaignId'
      - $ref: '#/components/schemas/CampaignCommon'
      - $ref: '#/components/schemas/CampaignCreateCommon'
      - type: object
        properties:
          is_campaign_budget_optimization:
            type: boolean
            nullable: true
            allOf:
            - $ref: '#/components/schemas/CampaignIsCampaignBudgetOptimization'
          is_flexible_daily_budgets:
            type: boolean
            nullable: true
            allOf:
            - $ref: '#/components/schemas/CampaignIsFlexibleDailyBudgets'
          is_automated_campaign:
            type: boolean
            nullable: true
            allOf:
            - $ref: '#/components/schemas/CampaignIsAutomatedCampaign'
          status:
            type: string
            nullable: true
            allOf:
            - $ref: '#/components/schemas/EntityStatus'
          objective_type:
            type: string
            nullable: true
            allOf:
            - $ref: '#/components/schemas/ObjectiveType'
        required:
        - id
        - ad_account_id
    CampaignCommon:
      type: object
      description: Campaign Data
      properties:
        ad_account_id:
          description: Campaign's Advertiser ID. If you want to create a campaign in a Business Account shared account you need to specify the Business Access advertiser ID in both the query path param as well as the request body schema.
          example: '549755885175'
          type: string
          pattern: ^\d+$
        name:
          type: string
          description: Campaign name.
          example: ACME Tools
        status:
          type: string
          allOf:
          - $ref: '#/components/schemas/EntityStatus'
        lifetime_spend_cap:
          description: Campaign total spending cap. Required for Campaign Budget Optimization (CBO) campaigns. This and "daily_spend_cap" cannot be set at the same time.
          example: 1432744744
          type: integer
          nullable: true
        daily_spend_cap:
          description: Campaign daily spending cap. Required for Campaign Budget Optimization (CBO) campaigns. This and "lifetime_spend_cap" cannot be set at the same time.
          example: 1432744744
          type: integer
          nullable: true
        order_line_id:
          description: Order line ID that appears on the invoice.
          example: '549755885175'
          type: string
          pattern: ^\d+$
          nullable: true
        tracking_urls:
          type: object
          nullable: true
          allOf:
          - $ref: '#/components/schemas/TrackingUrls'
        start_time:
          type: integer
          description: Campaign start time. Unix timestamp in seconds. Only used for Campaign Budget Optimization (CBO) campaigns.
          example: 1580865126
          nullable: true
        end_time:
          type: integer
          description: Campaign end time. Unix timestamp in seconds. Only used for Campaign Budget Optimization (CBO) campaigns.
          example: 1644023526
          nullable: true
        summary_status:
          type: string
          allOf:
          - $ref: '#/components/schemas/CampaignSummaryStatus'
    CampaignIsCampaignBudgetOptimization:
      type: boolean
      description: Determines if a campaign automatically generate ad-group level budgets given a campaign budget to maximize campaign outcome. When transitioning from non-cbo to cbo, all previous child ad group budget will be cleared.
      example: true
      default: false
    CampaignCreateRequest:
      type: object
      allOf:
      - $ref: '#/components/schemas/CampaignCreateCommon'
      - type: object
        properties:
          objective_type:
            $ref: '#/components/schemas/ObjectiveType'
        required:
        - name
        - objective_type
        - ad_account_id
    TrackingUrls:
      description: Third-party tracking URLs. Up to three tracking URLs - with a max length of 2,000 - are supported for each event type. Tracking URLs set at the ad group or ad level can override those set at the campaign level. For more information, see <a href="https://help.pinterest.com/en/business/article/third-party-and-dynamic-tracking" target="_blank">Third-party and dynamic tracking</a>.
      example:
        impression:
        - URL1
        - URL2
        click:
        - URL1
        - URL2
        engagement:
        - URL1
        - URL2
        buyable_button:
        - URL1
        - URL2
        audience_verification:
        - URL1
        - URL2
      type: object
      nullable: true
      properties:
        impression:
          type: array
          items:
            type: string
        click:
          type: array
          items:
            type: string
        engagement:
          type: array
          items:
            type: string
        buyable_button:
          type: array
          items:
            type: string
        audience_verification:
          type: array
          items:
            type: string
    ConversionReportAttributionType:
      type: string
      description: Attribution type. Refers to the Pinterest Tag endpoints
      example: INDIVIDUAL
      enum:
      - INDIVIDUAL
      - HOUSEHOLD
    CampaignId:
      properties:
        id:
          description: Campaign ID.
          example: '549755885175'
          type: string
          pattern: ^\d+$
      type: object
    CampaignsAnalyticsResponse:
      type: array
      items:
        type: object
        properties:
          CAMPAIGN_ID:
            description: The ID of the campaing that this metrics belongs to.
            type: string
            pattern: ^\d+$
          DATE:
            description: Current metrics date. Only returned when granularity is a time-based value (`DAY`, `HOUR`, `WEEK`, `MONTH`)
            type: string
            format: date
        required:
        - CAMPAIGN_ID
        additionalProperties: true
        example:
          DATE: '2021-04-01'
          CAMPAIGN_ID: '547602124502'
          SPEND_IN_DOLLAR: 30
          TOTAL_CLICKTHROUGH: 216
    AdsAnalyticsTargetingType:
      type: string
      description: Reporting targeting type
      example: APPTYPE
      enum:
      - KEYWORD
      - APPTYPE
      - GENDER
      - LOCATION
      - PLACEMENT
      - COUNTRY
      - TARGETED_INTEREST
      - PINNER_INTEREST
      - AUDIENCE_INCLUDE
      - GEO
      - AGE_BUCKET
      - REGION
      - AGE_BUCKET_AND_GENDER
    CampaignCreateResponseData:
      type: object
      allOf:
      - $ref: '#/components/schemas/CampaignCreateCommon'
      - $ref: '#/components/schemas/CampaignResponse'
      - type: object
        properties:
          objective_type:
            $ref: '#/components/schemas/ObjectiveType'
    CampaignSummaryStatus:
      type: string
      description: Summary status for campaign
      example: RUNNING
      enum:
      - RUNNING
      - PAUSED
      - NOT_STARTED
      - COMPLETED
      - ADVERTISER_DISABLED
      - ARCHIVED
      - DRAFT
      - DELETED_DRAFT
    Granularity:
      type: string
      description: Granularity
      enum:
      - TOTAL
      - DAY
      - HOUR
      - WEEK
      - MONTH
  parameters:
    query_campaign_ids_required:
      description: List of Campaign Ids to use to filter the results.
      in: query
      name: campaign_ids
      required: true
      schema:
        type: array
        items:
          type: string
          pattern: ^\d+$
          maxLength: 18
        minItems: 1
        maxItems: 100
    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_end_date:
      description: 'Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.'
      in: query
      name: end_date
      required: true
      schema:
        type: string
        format: date
    query_targeting_types:
      name: targeting_types
      description: Targeting type breakdowns for the report. The reporting per targeting type <br> is independent from each other. ["AGE_BUCKET_AND_GENDER"] is in BETA and not yet available to all users.
      required: true
      explode: false
      in: query
      schema:
        items:
          $ref: '#/components/schemas/AdsAnalyticsTargetingType'
        maxItems: 15
        minItems: 1
        type: array
    query_conversion_attribution_click_window_days:
      name: click_window_days
      in: query
      schema:
        type: integer
        enum:
        - 0
        - 1
        - 7
        - 14
        - 30
        - 60
        default: 30
      description: Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
      example: 1
    query_conversion_attribution_conversion_report_time:
      description: 'The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.'
      example: TIME_OF_AD_ACTION
      in: query
      name: conversion_report_time
      schema:
        type: string
        enum:
        - TIME_OF_AD_ACTION
        - TIME_OF_CONVERSION
        default: TIME_OF_AD_ACTION
    query_page_size:
      name: page_size
      description: Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 250
        default: 25
    query_bookmark:
      name: bookmark
      description: Cursor used to fetch the next page of items
      in: query
      required: false
      schema:
        type: string
    query_granularity:
      description: TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
      example: DAY
      in: query
      name: granularity
      required: true
      schema:
        $ref: '#/components/schemas/Granularity'
    path_campaign_id:
      name: campaign_id
      description: Campaign ID, must be associated with the ad account ID provided in the path.
      in: path
      required: true
      schema:
        type: string
        pattern: ^\d+$
        maxLength: 18
    query_order:
      description: 'The order in which to sort the items returned: ASCENDING or DESCENDING

        by ID. Note that higher-value IDs are associated with more-recently added

        items.'
      in: query
      name: order
      required: false
      schema:
        type: string
        example: ASCENDING
        enum:
        - ASCENDING
        - DESCENDING
    query_columns:
      description: 'Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile''s currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it''s microdollars. Otherwise, it''s in microunits of the advertiser''s currency.<br/>For example, if the advertiser''s currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned'
      explode: false
      in: query
      na

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