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

# Confirm the new app

> The first code of the new app completes the change and returns ten recovery codes.



## OpenAPI

````yaml openapi/en/control.json POST /v1/users/me/second-factor/confirm
openapi: 3.1.0
info:
  title: Niadra control API
  version: '1'
  description: >-
    Tenants, projects, sources, keys, people, configuration and usage. It never
    receives customer content.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/users/me/second-factor/confirm:
    post:
      summary: Confirm the new app
      description: >-
        Switches to the new authenticator app with its first code: the old app
        stops working, and ten new

        recovery codes come back, shown once. A wrong code answers 403; 409 when
        no change was started.


        **Authentication.** Person token issued by the control plane
        (`Authorization: Bearer <JWT>`), with the role the operation needs.
      operationId: confirm_second_factor_v1_users_me_second_factor_confirm_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecondFactorConfirmRequest'
            example:
              totp: '731594'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoveryCodesOut'
              example:
                recovery_codes:
                  - 7KQ2M-XA9BD
                  - H3VNP-8R2TW
                  - C4ZE6-JM7QK
                  - P9WXT-2BD5N
                  - R8HCV-6KMZ3
                  - T2NQA-WV47H
                  - Y6DJ9-QX3PC
                  - B5MRK-HT8WZ
                  - E7GXN-4PQ2V
                  - W3ZKC-9NBHD
          description: The new recovery codes, shown once.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - personToken: []
components:
  schemas:
    SecondFactorConfirmRequest:
      additionalProperties: false
      properties:
        totp:
          description: The current code of the new authenticator app.
          pattern: ^\d{6}$
          title: Totp
          type: string
      required:
        - totp
      title: SecondFactorConfirmRequest
      type: object
    RecoveryCodesOut:
      additionalProperties: false
      properties:
        recovery_codes:
          description: >-
            Ten single-use codes, `XXXXX-XXXXX`. Shown once; Niadra keeps only a
            keyed hash of each, and the earlier codes of the person no longer
            work.
          items:
            type: string
          title: Recovery Codes
          type: array
      required:
        - recovery_codes
      title: RecoveryCodesOut
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
  securitySchemes:
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````