# Generate Authentication Token

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /oauth/token:
    post:
      summary: Generate Authentication Token
      deprecated: false
      description: >-

        :::highlight purple 📌

        To generate an authentication token, send a POST request to our OAuth
        endpoint. This request authenticates your credentials and returns an
        access token, which you will use to authorize all subsequent API calls.

        Make sure your credentials are properly encoded and transmitted securely
        during this process to protect sensitive information.

        :::
      tags:
        - Bharat Connect (BBPS)/APIs - BBPS/Bill Payment
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/x-www-form-urlencoded
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            Basic Authorization token generated using Base64 encoding
            (clientId:clientSecret)
          required: true
          example: Basic ZW5rYXNoLWNsaWVudDplbmthc2gtc2VjcmV0
          schema:
            type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                username:
                  description: Registered Email Id
                  example: '6660686678'
                  type: string
                password:
                  description: Password for the user
                  example: Test@1234567
                  type: string
                grant_type:
                  type: string
                  default: password
                  example: password
                clientId:
                  description: 'Client Id '
                  example: CEKQ08TRRG
                  type: string
              required:
                - username
                - password
                - grant_type
                - clientId
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                  tokenType:
                    type: string
                  expiresIn:
                    type: integer
                    format: int32
                  refreshToken:
                    type: string
                x-apidog-orders:
                  - 01J05FADB98VP8XVQS35RHBM3K
                x-apidog-refs:
                  01J05FADB98VP8XVQS35RHBM3K:
                    $ref: '#/components/schemas/OauthTokenResponse'
                x-apidog-ignore-properties:
                  - accessToken
                  - tokenType
                  - expiresIn
                  - refreshToken
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: Bharat Connect (BBPS)/APIs - BBPS/Bill Payment
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/616243/apis/api-12704314-run
components:
  schemas:
    OauthTokenResponse:
      type: object
      properties:
        accessToken:
          type: string
        tokenType:
          type: string
        expiresIn:
          type: integer
          format: int32
        refreshToken:
          type: string
      x-apidog-orders:
        - accessToken
        - tokenType
        - expiresIn
        - refreshToken
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://ekpayout-uat.enkash.in
    description: Testing Env
security: []

```
