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

# Change the authenticator app

> Starts the change after the password: the new secret waits for its first code, and the current app keeps working.



## OpenAPI

````yaml openapi/en/control.json POST /v1/users/me/second-factor
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:
    post:
      summary: Change the authenticator app
      description: >-
        Starts the move to another authenticator app, after the password again
        (403 when wrong). The new

        secret comes back and waits beside the current one, which keeps working
        until

        POST /v1/users/me/second-factor/confirm receives a first code of the new
        app. Starting again replaces

        a secret that was never confirmed.


        **Authentication.** Person token issued by the control plane
        (`Authorization: Bearer <JWT>`), with the role the operation needs.
      operationId: change_second_factor_v1_users_me_second_factor_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordRequest'
            example:
              password: correct horse battery staple
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecondFactorOut'
              example:
                secret: KRSXG5CTMVRXEZLUKRSXG5CTMVRXEZLU
                totp_uri: >-
                  otpauth://totp/Niadra:ana@acme.example?secret=KRSXG5CTMVRXEZLUKRSXG5CTMVRXEZLU&issuer=Niadra&algorithm=SHA1&digits=6&period=30
          description: The new secret, pending until its first code.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - personToken: []
components:
  schemas:
    PasswordRequest:
      additionalProperties: false
      properties:
        password:
          anyOf:
            - maxLength: 1024
              minLength: 1
              type: string
            - type: 'null'
          description: >-
            The person's password once more: a session alone does not change the
            second factor.
          title: Password
        totp:
          anyOf:
            - pattern: ^\d{6}$
              type: string
            - type: 'null'
          description: >-
            In place of the password, only for a person the tenant's SSO
            created, who has none: the current code of the authenticator app.
          title: Totp
      title: PasswordRequest
      type: object
    SecondFactorOut:
      additionalProperties: false
      properties:
        secret:
          description: Base32 TOTP secret, for typing into an authenticator app.
          title: Secret
          type: string
        totp_uri:
          description: otpauth:// address of the same secret, for a QR code.
          title: Totp Uri
          type: string
      required:
        - secret
        - totp_uri
      title: SecondFactorOut
      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

````