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

# Mint an integration token

> Public. Cache the token for `expires_in`: every mint creates a session. The reply is not wrapped in `data`.



## OpenAPI

````yaml /api-reference/endpoint/accounts/openapi.json post /oauth/token
openapi: 3.0.3
info:
  title: quiva.ai Gateway
  description: >-
    API for managing accounts, users, authentication, and payments in the
    quiva.ai platform
  version: 1.0.0
  contact:
    name: quiva.ai Support
    url: https://app.quiva.ai
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Account Management
    description: Operations related to account creation, updating, and deletion
  - name: User Management
    description: Operations related to user creation, updating, and deletion
  - name: Authentication
    description: Operations related to authentication and session management
  - name: API Keys
    description: Operations related to API key management
  - name: Multi-Factor Authentication
    description: Operations related to MFA setup and verification
  - name: Payment
    description: Operations related to subscription and payment management
  - name: Mesh Nodes
    description: Operations related to mesh node management
  - name: Integrations
    description: Machine identities and client credentials for task sync
  - name: Task Subscriptions
    description: Webhook subscriptions that push task events to your endpoint
paths:
  /oauth/token:
    post:
      tags:
        - Authentication
      summary: Mint an integration token
      description: >-
        Public. Cache the token for `expires_in`: every mint creates a session.
        The reply is not wrapped in `data`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthTokenRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OAuthTokenRequest'
      responses:
        '200':
          description: Token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthTokenResponse'
        '400':
          description: '`invalid_request`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationError'
        '401':
          description: '`invalid_client`. The text is the same for every cause.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationError'
        '503':
          description: '`temporarily_unavailable`. Retry.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationError'
      security: []
components:
  schemas:
    OAuthTokenRequest:
      type: object
      properties:
        grant_type:
          type: string
          enum:
            - client_credentials
        client_id:
          type: string
        client_secret:
          type: string
      required:
        - grant_type
        - client_id
        - client_secret
      description: >-
        Also accepted form-encoded. Send no Authorization header: the gateway
        refuses one it cannot resolve before this endpoint runs.
    OAuthTokenResponse:
      type: object
      properties:
        access_token:
          type: string
        token_type:
          type: string
          enum:
            - Bearer
        expires_in:
          type: integer
          description: Seconds. Cache the token for this long.
      required:
        - access_token
        - token_type
        - expires_in
    IntegrationError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code. Branch on this, not on `error`.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.