Kinde OAuth API

The OAuth API from Kinde — 3 operation(s) for oauth.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

kinde-oauth-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: '1'
  title: Kinde Account API Keys OAuth API
  description: '

    Provides endpoints to operate on an authenticated user.


    ## Intro


    ## How to use


    1. Get a user access token - this can be obtained when a user signs in via the methods you''ve setup in Kinde (e.g. Google, passwordless, etc).


    2. Call one of the endpoints below using the user access token in the Authorization header as a Bearer token. Typically, you can use the `getToken` command in the relevant SDK.

    '
  termsOfService: https://docs.kinde.com/trust-center/agreements/terms-of-service/
  contact:
    name: Kinde Support Team
    email: support@kinde.com
    url: https://docs.kinde.com
tags:
- name: OAuth
  x-displayName: OAuth
paths:
  /oauth2/v2/user_profile:
    servers: []
    get:
      tags:
      - OAuth
      operationId: getUserProfileV2
      summary: Get user profile
      description: 'This endpoint returns a user''s ID, names, profile picture URL and email of the currently logged in user.

        '
      responses:
        '200':
          description: Details of logged in user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/user_profile_v2'
        '403':
          description: Invalid credentials.
        '429':
          description: Request was throttled.
      security:
      - kindeBearerAuth: []
  /oauth2/introspect:
    servers: []
    post:
      tags:
      - OAuth
      operationId: tokenIntrospection
      summary: Introspect
      description: Retrieve information about the provided token.
      requestBody:
        description: Token details.
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                token:
                  description: The token to be introspected.
                  type: string
                  example: rrkYRaz8z96sAiOxPt6IzOCoelFFT4ujWIM2XNZgZsmX2Zu3imZ1W
                token_type_hint:
                  type: string
                  description: A hint about the token type being queried in the request.
                  enum:
                  - access_token
                  - refresh_token
              required:
              - token
      responses:
        '200':
          description: Details of the token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/token_introspect'
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/token_introspect'
        '401':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/token_error_response'
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/token_error_response'
        '403':
          description: Invalid credentials.
        '429':
          description: Request was throttled.
      security:
      - kindeBearerAuth: []
  /oauth2/revoke:
    servers: []
    post:
      tags:
      - OAuth
      operationId: tokenRevocation
      summary: Revoke token
      description: Use this endpoint to invalidate an access or refresh token. The token will no longer be valid for use.
      requestBody:
        description: Details of the token to be revoked.
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                client_id:
                  type: string
                  description: The `client_id` of your application.
                  example: 3b0b5c6c8fcc464fab397f4969b5f482
                client_secret:
                  type: string
                  description: The `client_secret` of your application. Required for backend apps only.
                  example: rrkYRaz8z96sAiOxPt6IzOCoelFFT4ujWIM2XNZgZsmX2Zu3imZ1W
                token:
                  description: The token to be revoked.
                  type: string
                  example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTIzNDU2Nzg5LCJuYW1lIjoiSm9zZXBoIn0.OpOSSw7e485LOP5PrzScxHb7SR6sAOMRckfFwi4rp7o
                token_type_hint:
                  type: string
                  description: The type of token to be revoked.
                  enum:
                  - access_token
                  - refresh_token
              required:
              - token
              - client_id
      responses:
        '200':
          description: Token successfully revoked.
        '400':
          $ref: '#/components/responses/bad_request'
        '401':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/token_error_response'
        '403':
          $ref: '#/components/responses/forbidden'
        '429':
          $ref: '#/components/responses/too_many_requests'
      security:
      - kindeBearerAuth: []
components:
  responses:
    bad_request:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error_response'
    forbidden:
      description: Unauthorized - invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error_response'
    too_many_requests:
      description: Too many requests. Request was throttled.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error_response'
  schemas:
    error:
      type: object
      properties:
        code:
          type: string
          description: Error code.
        message:
          type: string
          description: Error message.
    token_introspect:
      type: object
      properties:
        active:
          type: boolean
          description: Indicates the status of the token.
        aud:
          type: array
          description: Array of intended token recipients.
          items:
            type: string
            example: https://api.example.com/v1
        client_id:
          type: string
          description: Identifier for the requesting client.
          example: 3b0b5c6c8fcc464fab397f4969b5f482
        exp:
          type: integer
          description: Token expiration timestamp.
          example: 1612345678
        iat:
          type: integer
          description: Token issuance timestamp.
          example: 1612345678
    error_response:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/error'
    user_profile_v2:
      type: object
      properties:
        sub:
          type: string
          description: Unique ID of the user in Kinde.
          example: kp_c3143a4b50ad43c88e541d9077681782
        provided_id:
          type: string
          description: Value of the user's ID in a third-party system when the user is imported into Kinde.
          example: some_external_id
          nullable: true
        name:
          type: string
          description: User's first and last name separated by a space.
          example: John Snow
        given_name:
          type: string
          description: User's first name.
          example: John
        family_name:
          type: string
          description: User's last name.
          example: Snow
        updated_at:
          type: integer
          description: Date the user was last updated at (In Unix time).
          example: 1612345678
        email:
          type: string
          description: User's email address if available.
          example: john.snow@example.com
        email_verified:
          type: boolean
          description: Whether the user's email address has been verified.
          example: true
        picture:
          type: string
          description: URL that point's to the user's picture or avatar
          example: https://example.com/john_snow.jpg
          nullable: true
        preferred_username:
          type: string
          description: User's preferred username.
          example: john_snow
          nullable: true
        id:
          type: string
          description: Unique ID of the user in Kinde
          example: kp_c3143a4b50ad43c88e541d9077681782
    token_error_response:
      type: object
      properties:
        error:
          type: string
          description: Error.
        error_description:
          type: string
          description: The error description.
  securitySchemes:
    kindeBearerAuth:
      description: 'To access these endpoints, you will need to use a user token. This can be obtained when your users sign in via the methods you''ve setup in Kinde (e.g. Google, passwordless, etc). Find this using the getToken command in the relevant SDK.

        '
      type: http
      scheme: bearer
      bearerFormat: JWT