openapi: 3.0.1
servers:
  - url: https://api.hubapi.com
info:
  title: Auth Oauth
  version: v1
  x-hubspot-documentation-banner: NONE
  x-hubspot-product-tier-requirements:
    cms: FREE
    marketing: FREE
    sales: FREE
    service: FREE
  x-logo:
    url: https://developers.hubspot.com/hubfs/assets/hubspot.com/buzz/HubSpotOpenGraph.png
  x-origin:
    - format: openapi
      url: https://api.hubspot.com/api-catalog-public/v1/apis/oauth/v1
      version: "3.0"
  x-providerName: hubapi.com
  x-serviceName: auth
tags:
  - name: Access_Tokens
  - name: Refresh_Tokens
  - name: Tokens
paths:
  /oauth/v1/access-tokens/{token}:
    get:
      operationId: get-/oauth/v1/access-tokens/{token}_get
      parameters:
        - explode: false
          in: path
          name: token
          required: true
          schema:
            type: string
          style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccessTokenInfoResponse"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security: []
      tags:
        - Access_Tokens
  /oauth/v1/refresh-tokens/{token}:
    delete:
      operationId: delete-/oauth/v1/refresh-tokens/{token}_archive
      parameters:
        - explode: false
          in: path
          name: token
          required: true
          schema:
            type: string
          style: simple
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security: []
      tags:
        - Refresh_Tokens
    get:
      operationId: get-/oauth/v1/refresh-tokens/{token}_get
      parameters:
        - explode: false
          in: path
          name: token
          required: true
          schema:
            type: string
          style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RefreshTokenInfoResponse"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security: []
      tags:
        - Refresh_Tokens
  /oauth/v1/token:
    post:
      operationId: post-/oauth/v1/token_create
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              properties:
                client_id:
                  type: string
                client_secret:
                  type: string
                code:
                  type: string
                grant_type:
                  enum:
                    - authorization_code
                    - refresh_token
                  type: string
                redirect_uri:
                  type: string
                refresh_token:
                  type: string
              type: object
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenResponseIF"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security: []
      tags:
        - Tokens
components:
  responses:
    Error:
      content:
        "*/*":
          schema:
            $ref: "#/components/schemas/Error"
      description: An error occurred.
  schemas:
    AccessTokenInfoResponse:
      properties:
        app_id:
          description: ""
          format: int32
          type: integer
        expires_in:
          description: ""
          format: int32
          type: integer
        hub_domain:
          description: ""
          type: string
        hub_id:
          description: ""
          format: int32
          type: integer
        scopes:
          description: ""
          items:
            type: string
          type: array
        token:
          description: ""
          type: string
        token_type:
          description: ""
          type: string
        user:
          description: ""
          type: string
        user_id:
          description: ""
          format: int32
          type: integer
      required:
        - app_id
        - expires_in
        - hub_id
        - scopes
        - token
        - token_type
        - user_id
      type: object
    Error:
      example:
        category: VALIDATION_ERROR
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
        message: Invalid input (details will vary based on the error)
      properties:
        category:
          description: The error category
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            invalidPropertyName:
              - propertyValue
            missingScopes:
              - scope1
              - scope2
          type: object
        correlationId:
          description: A unique identifier for the request. Include this value with any error reports or support tickets
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
          format: uuid
          type: string
        errors:
          description: further information about the error
          items:
            $ref: "#/components/schemas/ErrorDetail"
          type: array
        links:
          additionalProperties:
            type: string
          description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps
          type: object
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          example: An error occurred
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - category
        - correlationId
        - message
      type: object
    ErrorDetail:
      properties:
        code:
          description: The status code associated with the error detail
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            missingScopes:
              - scope1
              - scope2
          type: object
        in:
          description: The name of the field or parameter in which the error was found.
          type: string
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - message
      type: object
    RefreshTokenInfoResponse:
      properties:
        client_id:
          description: ""
          type: string
        hub_domain:
          description: ""
          type: string
        hub_id:
          description: ""
          format: int32
          type: integer
        scopes:
          description: ""
          items:
            type: string
          type: array
        token:
          description: ""
          type: string
        token_type:
          description: ""
          type: string
        user:
          description: ""
          type: string
        user_id:
          description: ""
          format: int32
          type: integer
      required:
        - client_id
        - hub_id
        - scopes
        - token
        - token_type
        - user_id
      type: object
    TokenResponseIF:
      properties:
        access_token:
          description: ""
          type: string
        expires_in:
          description: ""
          format: int32
          type: integer
        id_token:
          description: ""
          type: string
        refresh_token:
          description: ""
          type: string
        token_type:
          description: ""
          type: string
      required:
        - access_token
        - expires_in
        - refresh_token
        - token_type
      type: object
  securitySchemes: {}
x-hubspot-available-client-libraries:
  - PHP
  - Node
  - Ruby
  - Python
x-hubspot-documentation-banner: NONE
x-hubspot-product-tier-requirements:
  cms: FREE
  marketing: FREE
  sales: FREE
  service: FREE
