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

# Get Token

> Exchange your **client id** and **client secret** for a bearer token.

We currently support one OAuth2 grant type: **Client Credentials**.

## Client Credentials

You can exchange your client\_id and client\_secret for an access token directly.


## OpenAPI

````yaml post /oauth2/token/
openapi: 3.1.0
info:
  title: api-authentication
  version: '2.0'
servers:
  - url: https://sandbox.elationemr.com/api/2.0
security:
  - sec0: []
paths:
  /oauth2/token/:
    post:
      summary: Get Token
      description: Exchange your **client id** and **client secret** for a bearer token.
      operationId: get-token
      parameters:
        - name: Content-type
          in: header
          schema:
            type: string
            default: application/x-www-form-urlencoded
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - grant_type
              properties:
                grant_type:
                  type: string
                  description: We currently only support *client_credentials* grant type.
                  default: client_credentials
                client_id:
                  type: string
                  description: Client ID that was supplied to you with your credentials
                client_secret:
                  type: string
                  description: Client Secret that was provided to you with your credentials
                scope:
                  type: string
                  description: >-
                    Currently in closed Beta for select customers. Optional.
                    Space-separated list of scopes to request. If omitted,
                    defaults to `apiv2` which grants the token access to all API
                    resources.
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                      "access_token": "TyEPKw8fVGRKpCBa81ygwjCLXDNIAm",
                      "token_type": "Bearer",
                      "expires_in": 36000,
                      "refresh_token": "44fpQdEzMP36klMm8xrg8CuD75jPnF",
                      "scope": "..."
                    }
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    example: TyEPKw8fVGRKpCBa81ygwjCLXDNIAm
                  token_type:
                    type: string
                    example: Bearer
                  expires_in:
                    type: integer
                    example: 36000
                    default: 0
                  refresh_token:
                    type: string
                    example: 44fpQdEzMP36klMm8xrg8CuD75jPnF
                  scope:
                    type: string
                    example: ...
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value: '{"error": "invalid_client"}'
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: invalid_client
      deprecated: false
      security: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````