> ## Documentation Index
> Fetch the complete documentation index at: https://microstrate-1133-notifications-prefs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate with password

> Authenticates a user with their email and password. If MFA is enabled, returns an MFA token that must be used with a subsequent authentication request.



## OpenAPI

````yaml /api-reference/endpoint/accounts/openapi.json post /accounts/auth-with-password
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
paths:
  /accounts/auth-with-password:
    post:
      tags:
        - Authentication
      summary: Authenticate with password
      description: >-
        Authenticates a user with their email and password. If MFA is enabled,
        returns an MFA token that must be used with a subsequent authentication
        request.
      operationId: authWithPassword
      requestBody:
        description: Authentication credentials
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthWithPasswordRequest'
            examples:
              basicAuth:
                summary: Basic authentication
                value:
                  email: user@example.com
                  password: SecurePassword123
              withAccount:
                summary: With account specified
                value:
                  account: acme
                  email: user@example.com
                  password: SecurePassword123
      responses:
        '200':
          description: Authentication successful or MFA required
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    oneOf:
                      - $ref: '#/components/schemas/AuthResponse'
                      - $ref: '#/components/schemas/MfaRequiredResponse'
              examples:
                authSuccess:
                  summary: Authentication successful (no MFA)
                  value:
                    data:
                      refresh_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                      auth_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                      passkey_enabled: false
                      totp_enabled: false
                      account:
                        name: acme
                        id: acct_12345
                        display_name: ACME Corporation
                        root_email: admin@acme.com
                        subscription_status: active
                mfaRequired:
                  summary: MFA verification required
                  value:
                    data:
                      token: mfa_token_abcdef1234567890
                      passkey_enabled: true
                      totp_enabled: true
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid credentials
      security: []
components:
  schemas:
    AuthWithPasswordRequest:
      type: object
      properties:
        account:
          type: string
          description: >-
            Account name (optional). If not provided and the user is a root
            user, their root account will be used.
        email:
          type: string
          format: email
          description: User's email address
        password:
          type: string
          format: password
          description: User's password
      required:
        - email
        - password
      example:
        account: acme
        email: user@example.com
        password: SecurePassword123
    AuthResponse:
      type: object
      properties:
        refresh_token:
          type: string
          description: Refresh token
        auth_token:
          type: string
          description: Authentication token
        passkey_enabled:
          type: boolean
          description: Whether passkey authentication is enabled
        totp_enabled:
          type: boolean
          description: Whether TOTP authentication is enabled
    MfaRequiredResponse:
      type: object
      properties:
        token:
          type: string
          description: MFA token
        passkey_enabled:
          type: boolean
          description: Whether passkey authentication is enabled
        totp_enabled:
          type: boolean
          description: Whether TOTP authentication is enabled
    Error:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````