> ## 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.

# Finish sign-in on the chosen account

> Public. Completes an email-only sign-in that returned `select_account`. The token is single-use and every refusal is the same 401, so a token cannot be used to probe memberships. The response is `AuthResponse`, or `MfaRequiredResponse` when the account's user has TOTP on and the device is not remembered.



## OpenAPI

````yaml /api-reference/endpoint/accounts/openapi.json post /accounts/auth-select-account
openapi: 3.0.3
info:
  title: quiva.ai Accounts API
  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
  - name: Email Templates
    description: Account email templates used by flows, Abbie and the client sign-in email
  - name: Branding
    description: Sign-in branding and account images
  - name: Client Access
    description: Passwordless sign-in and invitations for client users
  - name: Sync Packages
    description: Install, upgrade and remove sync packages for an account
  - name: Terms
    description: Terms documents, provider terms and the acceptance log
  - name: Email Sending
    description: Sending identity and outbound email
  - name: Usage and Billing
    description: Cost events, billing events, credit budget and spend guard
  - name: Notifications
    description: In-app notifications for the signed-in user
  - name: Resource Access
    description: Per-user grants on resources such as spaces
  - name: Document Branding
    description: Account theme and logo used on generated documents
paths:
  /accounts/auth-select-account:
    post:
      tags:
        - Authentication
      summary: Finish sign-in on the chosen account
      description: >-
        Public. Completes an email-only sign-in that returned `select_account`.
        The token is single-use and every refusal is the same 401, so a token
        cannot be used to probe memberships. The response is `AuthResponse`, or
        `MfaRequiredResponse` when the account's user has TOTP on and the device
        is not remembered.
      operationId: authSelectAccount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthSelectAccountRequest'
            example:
              token: select_token_abcdef1234567890
              account_id: acct_12345
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    oneOf:
                      - $ref: '#/components/schemas/AuthResponse'
                      - $ref: '#/components/schemas/MfaRequiredResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    AuthSelectAccountRequest:
      type: object
      required:
        - token
        - account_id
      properties:
        token:
          type: string
          description: The `token` from the `select_account` response
        account_id:
          type: string
          description: Id of one of the accounts in the picker list
        device_token:
          type: string
          description: Remembered-device token; skips TOTP when valid
    AuthResponse:
      type: object
      description: Tokens and the signed-in user and account.
      properties:
        refresh_token:
          type: string
          description: Refresh token
        auth_token:
          type: string
          description: Authentication token (JWT)
        passkey_enabled:
          type: boolean
        totp_enabled:
          type: boolean
        first_sign_in:
          type: boolean
          description: >-
            True on the first sign-in after an invitation; the app routes it to
            MFA setup
        account:
          $ref: '#/components/schemas/AccountPublicInfo'
        user:
          type: string
          format: email
          description: User email
        user_id:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        role:
          type: string
          description: Role on the signed-in account
        mfa:
          $ref: '#/components/schemas/MfaInfo'
        theme:
          type: string
        sound:
          type: boolean
        advanced_mode:
          type: boolean
        voice_transcription:
          type: boolean
        onboarding_progress:
          type: object
          additionalProperties: true
        timezone:
          type: string
        notification_preferences:
          type: object
          additionalProperties: true
        folder:
          type: string
          description: Set for client users filed under a folder
        device_token:
          type: string
          description: >-
            Present when `remember_device` was set on an MFA step. Send it as
            `device_token` on later password sign-ins.
    MfaRequiredResponse:
      type: object
      properties:
        token:
          type: string
          description: >-
            MFA token. Use it with the TOTP, recovery-code or passkey
            authentication request.
        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
    AccountPublicInfo:
      type: object
      properties:
        name:
          type: string
          description: Account name (normalized)
        id:
          type: string
          description: Account unique identifier - 10 digits
        display_name:
          type: string
          description: Account display name
        root_email:
          type: string
          format: email
          description: Root user email address
        subscription_status:
          type: string
          description: Subscription status
          enum:
            - active
            - pending
            - cancelled
        subscription_plan:
          type: string
          description: Subscription plan
        emergency_credit:
          type: number
          format: float
          description: Emergency credit amount
        country:
          type: string
          description: Country
        company_name:
          type: string
          description: Company name
        address:
          type: string
          description: Address
        website:
          type: string
          description: Website
        phone_number:
          type: string
          description: Phone number
        scheduled_for_deletion:
          type: boolean
          description: Whether the account is scheduled for deletion
        deletion_date:
          type: string
          format: date-time
          description: >-
            If the account is scheduled for deletion, it will be deleted on this
            date
        region:
          type: string
          description: Region
        provider:
          type: string
          description: Provider
        bstier:
          type: integer
          description: BS tier
        cloud:
          type: boolean
          description: >-
            Cloud functionality enabled. It true, the user has access to
            quiva.ai Cloud
        hub:
          type: boolean
          description: >-
            Hub functionality enabled. It true, the user has access to quiva.ai
            Hub
    MfaInfo:
      type: object
      required:
        - passkey_enabled
        - totp_enabled
      properties:
        passkey_enabled:
          type: boolean
          description: Whether passkey authentication is enabled
        totp_enabled:
          type: boolean
          description: Whether TOTP authentication is enabled
  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.