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

# Reset a second factor

> For a person who lost the app and the codes: they set up a new authenticator at the next login.



## OpenAPI

````yaml openapi/en/control.json POST /v1/users/{user_id}/second-factor/reset
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/{user_id}/second-factor/reset:
    post:
      summary: Reset a second factor
      description: >-
        For a person who lost the authenticator app and the recovery codes:
        clears the secret, its

        confirmation and every code, so the person sets up an authenticator
        again at the next login. The

        reset is kept with who did it and why. Needs the admin role; a person of
        another tenant answers 404.


        **Authentication.** Person token issued by the control plane
        (`Authorization: Bearer <JWT>`), with the role the operation needs.
      operationId: reset_second_factor_v1_users__user_id__second_factor_reset_post
      parameters:
        - in: path
          name: user_id
          required: true
          schema:
            format: uuid
            title: User Id
            type: string
          example: 0192f0a0-4e5f-7061-9c72-8d9e0f1a2b35
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecondFactorResetRequest'
            example:
              reason: >-
                Lost the phone and the recovery codes; identity checked on a
                video call
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecondFactorResetOut'
              example:
                reset_id: 0192f7d4-8293-74a5-9fb6-2b3c4d5e6f78
                user_id: 0192f0a0-4e5f-7061-9c72-8d9e0f1a2b35
                reset_by: 0192f0a0-4e5f-7061-9c72-8d9e0f1a2b34
                reason: >-
                  Lost the phone and the recovery codes; identity checked on a
                  video call
                at: '2026-09-23T14:20:00Z'
          description: The reset, with who did it and why.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - personToken: []
components:
  schemas:
    SecondFactorResetRequest:
      additionalProperties: false
      properties:
        reason:
          description: Why, kept with the reset.
          maxLength: 1000
          minLength: 3
          title: Reason
          type: string
      required:
        - reason
      title: SecondFactorResetRequest
      type: object
    SecondFactorResetOut:
      additionalProperties: false
      properties:
        at:
          format: date-time
          title: At
          type: string
          description: When the reset happened.
        reason:
          title: Reason
          type: string
          description: Why, as the admin wrote it.
        reset_by:
          description: The admin who reset it.
          format: uuid
          title: Reset By
          type: string
        reset_id:
          format: uuid
          title: Reset Id
          type: string
          description: The id of this reset.
        user_id:
          format: uuid
          title: User Id
          type: string
          description: The person whose second factor was reset.
      required:
        - reset_id
        - user_id
        - reset_by
        - reason
        - at
      title: SecondFactorResetOut
      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

````