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

# OAuth token endpoint

> OAuth token endpoint



## OpenAPI

````yaml /api/core-api/crmiapi.json post /api/v1/oauth/token
openapi: 3.1.1
info:
  title: chargecloud - Core API
  summary: chargecloud Core API. All around CRM, Asset Management and more.
  version: 1.113.1
  description: chargecloud Core API. All around CRM, Asset Management and more.
servers:
  - url: https://api.chargecloud.dev
    description: Production - chargecloud Core API
  - url: https://demo.chargecloud.de
    description: Sandbox/Dev - chargecloud Core API
security: []
paths:
  /api/v1/oauth/token:
    post:
      tags:
        - OAuth
      summary: OAuth token endpoint
      description: OAuth token endpoint
      operationId: /api/v1/oauth/token_POST
      requestBody:
        description: OAuth token endpoint
        content:
          application/json:
            schema:
              type: object
              required:
                - username
                - password
                - tenant
                - context
              properties:
                username:
                  type: string
                  minLength: 8
                  maxLength: 128
                  description: The public identifier used to authenticate the API client.
                password:
                  type: string
                  minLength: 8
                  maxLength: 128
                  description: >-
                    The secret key used to authenticate the API client. Must be
                    kept confidential and never exposed in client-side code or
                    logs.
                tenant:
                  type: string
                  minLength: 3
                  maxLength: 128
                  description: >-
                    The unique tenant identifier that determines the target
                    environment for authentication. Scopes the issued token to
                    the resources of the specified tenant.
                context:
                  type: string
                  enum:
                    - apikey
                    - contract
                    - user
                    - client
                    - employee
                  description: >-
                    Defines the api clients type being authenticated. Determines
                    the scope and permissions of the resulting token.
                  example: apikey
        required: true
      responses:
        '200':
          description: OAuth 2.0 token
          content:
            application/json:
              schema:
                type: object
                required:
                  - access_token
                  - refresh_token
                  - token_type
                  - expires_in
                properties:
                  access_token:
                    type: string
                    description: Access token
                  refresh_token:
                    type: string
                    description: Refresh token
                  token_type:
                    type: string
                    description: Token type
                  expires_in:
                    type: integer
                    format: int64
                    description: Token expiration time. UNIX timestamp.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '405':
          description: Method not allowed
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '422':
          description: Request validation failed
          content:
            application/json:
              schema:
                type: object
                required:
                  - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        errorKey:
                          type: string
                          description: A key identifying the error
                        message:
                          type: string
                          description: The error message
                        parameter:
                          type: string
                          description: The parameter that caused the error, if any
                      required:
                        - errorKey
                        - message
                        - parameter
                      description: Error
                    description: List of errors
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message

````

## Related topics

- [Authentication](/authentication.md)
- [How To](/api/core-api/how-to.md)
- [Introduction](/api/core-api/index.md)
