> ## Documentation Index
> Fetch the complete documentation index at: https://docs.light.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Create access token

> Exchanges an authorization code or refresh token for an access token



## OpenAPI

````yaml /openapi-public.json post /oauth/token
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /oauth/token:
    post:
      tags:
        - Authorization
      summary: Create access token
      description: Exchanges an authorization code or refresh token for an access token
      operationId: getOAuthToken
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                client_id:
                  type: string
                client_secret:
                  type: string
                grant_type:
                  type: string
                code:
                  type: string
                redirect_uri:
                  type: string
                refresh_token:
                  type: string
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalOauthToken'
components:
  schemas:
    ExternalOauthToken:
      type: object
      properties:
        access_token:
          type: string
        expires_in:
          type: integer
          format: int64
        token_type:
          type: string
        refresh_token:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: >-
        Basic authentication header of the form **Basic** **<api_key>**, where
        **<api_key>** is your api key.
      name: Authorization
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````