> ## Documentation Index
> Fetch the complete documentation index at: https://api-documentation.kare-app.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Post adauthtwo factorenable

> Use this endpoint to enable two factor authentication. This will generate a TOTP URI and backup codes. Once the user verifies the TOTP URI, the two factor authentication will be enabled.



## OpenAPI

````yaml /api/ad/openapi.json post /ad/auth/two-factor/enable
openapi: 3.0.3
info:
  title: KARE API
  description: Backend API for the KARE platform
  version: dev
servers:
  - url: http://localhost:3000
    description: Local dev
security: []
tags:
  - name: better-auth
    description: >-
      Better Auth's own endpoints (sign-in, session, MFA, password) - generated
      from the audience's live config via `generateOpenAPISchema()`, not
      hand-written.
paths:
  /ad/auth/two-factor/enable:
    post:
      tags:
        - better-auth
      description: >-
        Use this endpoint to enable two factor authentication. This will
        generate a TOTP URI and backup codes. Once the user verifies the TOTP
        URI, the two factor authentication will be enabled.
      operationId: betterAuthPostTwoFactorEnableADV1
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: User password
                issuer:
                  type: string
                  description: Custom issuer for the TOTP URI
              required:
                - password
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  totpURI:
                    type: string
                    description: TOTP URI
                  backupCodes:
                    type: array
                    items:
                      type: string
                    description: Backup codes
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
          description: >-
            Bad Request. Usually due to missing parameters, or invalid
            parameters.
        '401':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
          description: Unauthorized. Due to missing or invalid authentication.
        '403':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
          description: >-
            Forbidden. You do not have permission to access this resource or to
            perform this action.
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
          description: Not Found. The requested resource was not found.
        '429':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
          description: >-
            Too Many Requests. You have exceeded the rate limit. Try again
            later.
        '500':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
          description: >-
            Internal Server Error. This is a problem with the server that you
            cannot fix.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication

````