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

# OAuth Token

> Obtain an access token using Resource Owner Password Credentials (password grant type).



## OpenAPI

````yaml POST /api/external/oauth/token
openapi: 3.0.0
info:
  title: Employee List API
  description: Retrieve a paginated list of employees from the organization.
  version: 1.0.0
servers:
  - url: https://{env}.tartanhq.com
    description: Dynamic environment-based server
    variables:
      env:
        default: dev
security: []
paths:
  /api/external/oauth/token:
    post:
      summary: Get OAuth Token
      description: >-
        Obtain an access token using Resource Owner Password Credentials
        (password grant type).
      operationId: getOAuthToken
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - username
                - password
                - grant_type
              properties:
                username:
                  type: string
                  example: johndoe@example.com
                password:
                  type: string
                  format: password
                  example: mysecretpassword
                grant_type:
                  type: string
                  enum:
                    - password
                  example: password
      responses:
        '200':
          description: OAuth token generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    example: eyJhbGciOi...
                  token_type:
                    type: string
                    example: bearer
                  expires_in:
                    type: integer
                    example: 3600
                  refresh_token:
                    type: string
                    example: eyJhbGciOi...
        '400':
          description: Invalid credentials or malformed request
        '401':
          description: Unauthorized

````