Pinterest Terms API

The Terms API from Pinterest — 3 operation(s) for terms.

OpenAPI Specification

pinterest-terms-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 5.13.0
  title: Pinterest Terms 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: Terms
paths:
  /ad_accounts/{ad_account_id}/terms_of_service:
    get:
      description: Get the text of the terms of service and see whether the advertiser has accepted the terms of service.
      operationId: terms_of_service/get
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/path_ad_account_id'
      - $ref: '#/components/parameters/query_include_html'
      - $ref: '#/components/parameters/query_tos_type'
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TermsOfService'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Get terms of service
      tags:
      - Terms
  /terms/related:
    get:
      summary: List related terms
      description: 'Get a list of terms logically related to each input term. <p/>

        Example: the term ''workout'' would list related terms like ''one song workout'', ''yoga workout'', ''workout motivation'', etc.'
      tags:
      - Terms
      operationId: terms_related/list
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/query_list_input_terms'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelatedTerms'
          description: Success
        '400':
          description: Invalid terms related parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Invalid terms related parameters.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /terms/suggested:
    get:
      summary: List suggested terms
      description: 'Get popular search terms that begin with your input term. <p/>

        Example: ''sport'' would return popular terms like ''sports bar'' and ''sportswear'', but not ''motor sports'' since the phrase does not begin with the given term.'
      tags:
      - Terms
      operationId: terms_suggested/list
      security:
      - pinterest_oauth2:
        - ads:read
      x-ratelimit-category: ads_read
      x-sandbox: enabled
      parameters:
      - $ref: '#/components/parameters/query_input_term'
      - $ref: '#/components/parameters/query_term_limit'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TermsSuggestedResponse'
          description: Success
        '400':
          description: Invalid terms suggested parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 400
                message: Invalid terms suggested parameters.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    query_tos_type:
      description: Request type.
      explode: true
      in: query
      name: tos_type
      required: false
      schema:
        type: string
      style: form
    query_input_term:
      description: Input term.
      in: query
      name: term
      example: sports
      required: true
      schema:
        type: string
    query_include_html:
      description: Return HTML in TOS text.
      explode: true
      in: query
      name: include_html
      required: false
      schema:
        default: false
        type: boolean
      style: form
    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_list_input_terms:
      description: List of input terms.
      in: query
      name: terms
      required: true
      schema:
        type: array
        items:
          type: string
          example: workout
    query_term_limit:
      description: Max suggested terms to return.
      in: query
      name: limit
      example: 4
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 10
        default: 4
  schemas:
    TermsOfService:
      example:
        has_accepted: true
        html: example test
        id: '2650449554526'
        ad_account_id: '549755885175'
      properties:
        id:
          description: The ID of the terms of service
          example: '2650449554526'
          title: id
          type: string
        html:
          description: The terms of service content
          example: example test
          nullable: true
          title: html
          type: string
        has_accepted:
          description: Whether the ad account has accepted terms of service.
          example: true
          title: hasAccepted
          type: boolean
        ad_account_id:
          description: The ID of the ad account.
          example: '549755885175'
          title: adAccountId
          type: string
      title: TermsOfService
      type: object
    RelatedTerms:
      type: object
      properties:
        id:
          description: First input term. For example, if you pass "?terms=clothes,workout", then id will be "clothes"
          type: string
          example: clothes
        related_term_count:
          description: Total number of related terms returned
          type: integer
          example: 2
        related_terms_list:
          description: The id of the advertiser.
          type: array
          items:
            type: object
            properties:
              term:
                type: string
                example: clothes
              related_terms:
                type: array
                items:
                  type: string
                example:
                - shoes
                - cute clothes
    Error:
      title: Error
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
      required:
      - code
      - message
    TermsSuggestedResponse:
      items:
        type: string
      type: array
  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