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

# Get an Access Token



## OpenAPI

````yaml /api-reference/openapi.json post /v0/auth/token
openapi: 3.1.0
info:
  title: Asset API
  version: '0.1'
servers:
  - url: https://api.sandbox.getasset.com
    description: Sandbox
  - url: https://api.getasset.com
    description: Production
security: []
paths:
  /v0/auth/token:
    post:
      tags:
        - Authentication
      summary: Get an Access Token
      operationId: get_oauth_token_v0_auth_token_post
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Body_get_oauth_token_v0_auth_token_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
components:
  schemas:
    Body_get_oauth_token_v0_auth_token_post:
      properties:
        client_id:
          type: string
          title: Client Id
          description: The oauth client id
        client_secret:
          type: string
          title: Client Secret
          default: The oauth client secret
        grant_type:
          $ref: '#/components/schemas/GrantType'
          description: The grant type. Defaults to client_credentials
          default: client_credentials
        business_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Business Id
          description: Scope the access token to a specific business
          examples:
            - biz_GA6EG2qFxA97NZHtxeLPUy
        expires_in:
          type: integer
          exclusiveMinimum: 0
          title: Expires In
          description: Access token expiration time in seconds
          default: 3600
        scope:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope
          description: >-
            Space-separated list of requested scopes, e.g. 'ledger:read
            invoice:create'
        resource:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Resource
          description: >-
            RFC 8707 resource indicator(s) identifying the protected resource(s)
            where the token is intended to be used. Sets the JWT `aud` claim.
            Each value must be an absolute URI with no fragment. May be
            repeated. Defaults to the current host.
          examples:
            - - https://api.example.com
      type: object
      required:
        - client_id
      title: Body_get_oauth_token_v0_auth_token_post
    AccessToken:
      properties:
        access_token:
          type: string
          title: Access Token
          description: The access token
        token_type:
          type: string
          title: Token Type
          description: The token type
          default: Bearer
        expires_in:
          type: integer
          title: Expires In
          description: The token expiration time as a unix timestamp (seconds)
          examples:
            - 1777657168
      type: object
      required:
        - access_token
        - expires_in
      title: AccessToken
    ErrorResponse:
      properties:
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: A description of the error
        data:
          title: Data
          description: Data associated with the error
      type: object
      required:
        - error
        - data
      title: ErrorResponse
    GrantType:
      type: string
      enum:
        - client_credentials
      title: GrantType

````