Pinterest Tags API

The Tags API from Pinterest — 4 operation(s) for tags.

OpenAPI Specification

pinterest-tags-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 5.13.0
  title: Pinterest Tags 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: Tags
paths:
  /ad_accounts/{ad_account_id}/conversion_tags:
    get:
      summary: Get conversion tags
      description: List conversion tags associated with an ad account.
      operationId: conversion_tags/list
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_filter_deleted'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionTagListResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Tags
      x-sandbox: disabled
    post:
      x-sandbox: disabled
      summary: Create conversion tag
      description: 'Create a conversion tag, also known as <a href="https://help.pinterest.com/en/business/article/set-up-the-pinterest-tag" target="_blank">Pinterest tag</a>, with the option to enable enhanced match.<p/>

        The Pinterest Tag tracks actions people take on the ad account s website after they view the ad account''s ad on Pinterest. The advertiser needs to customize this tag to track conversions.<p/>

        For more information, see:<p/>

        <a class="reference external" href="https://help.pinterest.com/en/business/article/set-up-the-pinterest-tag">Set up the Pinterest tag</a><p/>

        <a class="reference external" href="https://developers.pinterest.com/docs/conversions/pinterest-tag/">Pinterest Tag</a><p/>

        <a class="reference external" href="https://developers.pinterest.com/docs/conversions/enhanced-match/">Enhanced match</a>'
      operationId: conversion_tags/create
      security:
      - pinterest_oauth2:
        - ads:write
      x-ratelimit-category: ads_write
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConversionTagCreate'
        description: Conversion Tag to create
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionTagResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Tags
  /ad_accounts/{ad_account_id}/conversion_tags/ocpm_eligible:
    get:
      summary: Get Ocpm eligible conversion tags
      description: Get Ocpm eligible conversion tag events for an ad account.
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      operationId: ocpm_eligible_conversion_tags/get
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      x-sandbox: disabled
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionTagsOcpmEligibleResponse'
        default:
          description: Unexpected errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Tags
  /ad_accounts/{ad_account_id}/conversion_tags/page_visit:
    get:
      summary: Get page visit conversion tags
      description: Get all page visit conversion tag events for an ad account.
      operationId: page_visit_conversion_tags/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_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/ConversionEventResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Tags
  /ad_accounts/{ad_account_id}/conversion_tags/{conversion_tag_id}:
    get:
      x-sandbox: disabled
      summary: Get conversion tag
      description: Get information about an existing conversion tag.
      operationId: conversion_tags/get
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/path_conversion_tag_id'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionTagResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      tags:
      - Tags
components:
  parameters:
    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
    path_conversion_tag_id:
      description: Id of the conversion tag.
      in: path
      example: '2617998078212'
      explode: false
      name: conversion_tag_id
      required: true
      schema:
        pattern: ^\d+$
        maxLength: 18
        type: string
      style: simple
    query_bookmark:
      name: bookmark
      description: Cursor used to fetch the next page of items
      in: query
      required: false
      schema:
        type: string
    query_filter_deleted:
      name: filter_deleted
      description: Filter out deleted tags.
      in: query
      required: false
      schema:
        type: boolean
        example: true
        default: false
    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_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
  schemas:
    EntityStatus:
      type: string
      description: Entity status
      example: ACTIVE
      enum:
      - ACTIVE
      - PAUSED
      - ARCHIVED
      - DRAFT
      - DELETED_DRAFT
    EnhancedMatchStatusType:
      description: The enhanced match status of the tag
      enum:
      - UNKNOWN
      - NOT_VALIDATED
      - VALIDATING_IN_PROGRESS
      - VALIDATION_COMPLETE
      - null
      example: VALIDATION_COMPLETE
      nullable: true
      title: EnhancedMatchStatusType
      type: string
    ConversionEventResponse:
      title: ConversionEventResponse
      type: object
      properties:
        conversion_event:
          type: string
          $ref: '#/components/schemas/ConversionTagType'
        conversion_tag_id:
          title: conversion_tag_id
          description: Id of the tag.
          type: string
          pattern: ^\d+$
          example: '2614324385652'
        ad_account_id:
          title: ad_account_id
          description: Id of the ad account.
          type: string
          pattern: ^\d+$
          example: '549757463328'
        created_time:
          title: created_time
          description: Creation date in epoch format.
          type: integer
          example: 1564768710
    Error:
      title: Error
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
      required:
      - code
      - message
    ConversionTagType:
      title: ConversionTagType
      description: conversion tag type
      type: string
      enum:
      - PAGE_LOAD
      - UNKNOWN
      - INITIALIZED
      - PAGE_VISIT
      - SIGNUP
      - CHECKOUT
      - CUSTOM
      - VIEW_CATEGORY
      - SEARCH
      - ADD_TO_CART
      - WATCH_VIDEO
      - LEAD
      - APP_INSTALL
      - WEB_SESSION
      - EXTERNAL_MEASUREMENT
      example: PAGE_LOAD
    ConversionTagResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/ConversionTagCommon'
      title: ConversionTagResponse
    ConversionTagListResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ConversionTagResponse'
    ConversionTagCommon:
      type: object
      properties:
        ad_account_id:
          description: Ad account ID.
          example: '549755885175'
          title: ad_account_id
          type: string
        code_snippet:
          description: Tag code snippet.
          example: <script type=text/javascript> [...]
          title: code_snippet
          type: string
        enhanced_match_status:
          $ref: '#/components/schemas/EnhancedMatchStatusType'
        id:
          description: Tag ID.
          example: '2617998078212'
          title: id
          type: string
        last_fired_time_ms:
          description: Time for the last event fired.
          example: 1599030000000
          nullable: true
          title: last_fired_time_ms
          type: number
        name:
          description: Conversion tag name.
          example: ACME Checkout Test Tag
          title: name
          type: string
        status:
          $ref: '#/components/schemas/EntityStatus'
        version:
          description: Version number.
          example: '3'
          title: version
          type: string
        configs:
          $ref: '#/components/schemas/ConversionTagConfigs'
      title: ConversionTagCommon
    ConversionTagConfigs:
      type: object
      properties:
        aem_enabled:
          description: Whether Automatic Enhanced Match email is enabled. See <a href="https://help.pinterest.com/en/business/article/enhanced-match" target="_blank">Enhanced match</a> for more information.
          example: true
          title: aem_enabled
          type: boolean
          default: false
          nullable: true
        md_frequency:
          description: Metadata ingestion frequency.
          example: 0.6
          title: md_frequency
          type: number
          default: 1
          nullable: true
        aem_fnln_enabled:
          description: Whether Automatic Enhanced Match name is enabled. See <a href="https://help.pinterest.com/en/business/article/enhanced-match" target="_blank">Enhanced match</a> for more information.
          example: true
          title: aem_fnln_enabled
          type: boolean
          default: false
          nullable: true
        aem_ph_enabled:
          description: Whether Automatic Enhanced Match phone is enabled. See <a href="https://help.pinterest.com/en/business/article/enhanced-match" target="_blank">Enhanced match</a> for more information.
          example: true
          title: aem_ph_enabled
          type: boolean
          default: false
          nullable: true
        aem_ge_enabled:
          description: Whether Automatic Enhanced Match gender is enabled. See <a href="https://help.pinterest.com/en/business/article/enhanced-match" target="_blank">Enhanced match</a> for more information.
          example: true
          title: aem_ge_enabled
          type: boolean
          default: false
          nullable: true
        aem_db_enabled:
          description: Whether Automatic Enhanced Match birthdate is enabled. See <a href="https://help.pinterest.com/en/business/article/enhanced-match" target="_blank">Enhanced match</a> for more information.
          example: true
          title: aem_db_enabled
          type: boolean
          default: false
          nullable: true
        aem_loc_enabled:
          description: Whether Automatic Enhanced Match location is enabled. See <a href="https://help.pinterest.com/en/business/article/enhanced-match" target="_blank">Enhanced match</a> for more information.
          example: true
          title: aem_loc_enabled
          type: boolean
          default: false
          nullable: true
      title: ConversionTagConfigs
    ConversionTagsOcpmEligibleResponse:
      type: object
      additionalProperties:
        type: array
        items:
          $ref: '#/components/schemas/ConversionEventResponse'
      example:
        '12345':
        - conversion_event: PAGE_LOAD
          created_time: 1564768710
          conversion_tag_id: '2614324385652'
          ad_account_id: '549757463328'
        - conversion_event: CHECKOUT
          created_time: 1564710210
          conversion_tag_id: '2614324315793'
          ad_account_id: '549757463328'
    Paginated:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
        bookmark:
          type: string
          nullable: true
      required:
      - items
    ConversionTagCreate:
      type: object
      allOf:
      - $ref: '#/components/schemas/ConversionTagConfigs'
      example:
        name: ACME Tools Tag
      properties:
        name:
          description: Conversion tag name.
          example: ACME Tools Tag
          title: name
          type: string
      required:
      - name
      title: ConversionTagCreate
  securitySchemes:
    pinterest_oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://www.pinterest.com/oauth/
          tokenUrl: https://api.pinterest.com/v5/oauth/token
          scopes:
            ads:read: See all of your advertising data, including ads, ad groups, campaigns etc.
            ads:write: Create, update, or delete ads, ad groups, campaigns etc.
            billing:read: See all of your billing data, billing profile, etc.
            billing:write: Create, update, or delete billing data, billing profiles, etc.
            biz_access:read: See business access data
            biz_access:write: Create, update, or delete business access data
            boards:read: See your public boards, including group boards you join
            boards:read_secret: See your secret boards
            boards:write: Create, update, or delete your public boards
            boards:write_secret: Create, update, or delete your secret boards
            catalogs:read: See all of your catalogs data
            catalogs:write: Create, update, or delete your catalogs data
            pins:read: See your public Pins
            pins:read_secret: See your secret Pins
            pins:write: Create, update, or delete your public Pins
            pins:write_secret: Create, update, or delete your secret Pins
            user_accounts:read: See your user accounts and followers
            user_accounts:write: Update your user accounts and followers
    conversion_token:
      type: http
      scheme: bearer
      description: This security scheme only applies to the conversion events endpoint (POST /ad_accounts/{ad_account_id}/events). This endpoint requires a bearer token generated via Ads Manager (ads.pinterest.com).
    basic:
      type: http
      scheme: basic
x-tagGroups:
- name: Pin and Boards
  tags:
  - pins
  - boards
  - media
  - aggregated_comments
  - aggregated_pin_data
  - user_account
- name: Campaign Management
  tags:
  - ad_accounts
  - campaigns
  - ad_groups
  - ads
  - product_group_promotions
  - bulk
- name: Targeting
  tags:
  - audiences
  - customer_lists
  - keywords
  - targeting_template
  - audience_insights
  - audience_sharing
- name: Ad Formats
  tags:
  - lead_forms
  - lead_ads
  - leads_export
- name: Billing
  tags:
  - billing
  - order_lines
  - terms_of_service
- name: Business Access
  tags:
  - business_access_assets
  - business_access_invite
  - business_access_relationships
- name: Conversions
  tags:
  - conversion_events
  - conversion_tags
- name: Others
  tags:
  - integrations
  - oauth
  - resources
  - search
  - terms
- name: Shopping
  tags:
  - catalogs
- name: Deprecated
  tags:
  - product_groups