openapi: 3.0.3
info:
version: 5.13.0
title: Pinterest Token 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: Token
paths:
/oauth/token:
post:
summary: Generate OAuth access token
description: 'Generate an OAuth access token by using an authorization code or a refresh token.
IMPORTANT: You need to start the OAuth flow via www.pinterest.com/oauth before calling this endpoint (or have an existing refresh token).
See <a href=''/docs/getting-started/authentication/''>Authentication</a> for more.
<strong>Parameter <i>refresh_on</i> and its corresponding response type <i>everlasting_refresh</i> are now available to all apps! Later this year, continuous refresh will become the default behavior (ie you will no longer need to send this parameter). <a href=''/docs/new/about-beta-access/''>Learn more</a>.</strong>'
tags:
- Token
operationId: oauth/token
security:
- basic: []
x-ratelimit-category: org_read
x-sandbox: enabled
requestBody:
description: Generate an OAuth access token.
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OauthAccessTokenRequest'
responses:
'200':
description: response
content:
application/json:
schema:
$ref: '#/components/schemas/OauthAccessTokenResponse'
default:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
OauthAccessTokenRequest:
title: OAuth access token request
description: Describes the valid schema for possible OAuth access token requests.
type: object
discriminator:
propertyName: grant_type
mapping:
authorization_code: '#/components/schemas/OauthAccessTokenRequestCode'
refresh_token: '#/components/schemas/OauthAccessTokenRequestRefresh'
properties:
grant_type:
type: string
enum:
- authorization_code
- refresh_token
required:
- grant_type
Error:
title: Error
type: object
properties:
code:
type: integer
message:
type: string
required:
- code
- message
OauthAccessTokenResponse:
title: OAuth access token response
description: A successful OAuth access token response.
type: object
properties:
response_type:
type: string
enum:
- authorization_code
- refresh_token
access_token:
type: string
token_type:
type: string
default: bearer
expires_in:
type: integer
scope:
type: string
discriminator:
propertyName: response_type
mapping:
authorization_code: '#/components/schemas/OauthAccessTokenResponseCode'
refresh_token: '#/components/schemas/OauthAccessTokenResponseRefresh'
integration_refresh: '#/components/schemas/OauthAccessTokenResponseIntegrationRefresh'
everlasting_refresh: '#/components/schemas/OauthAccessTokenResponseEverlastingRefresh'
required:
- access_token
- token_type
- expires_in
- scope
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