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

# Reativar pessoa

> A pessoa volta a entrar, com os mesmos papéis e o mesmo segundo fator.



## OpenAPI

````yaml openapi/pt/control.json POST /v1/users/{user_id}/reactivate
openapi: 3.1.0
info:
  title: API de controle da Niadra
  version: '1'
  description: >-
    Tenants, projetos, fontes, chaves, pessoas, configuração e uso. Nunca recebe
    conteúdo de cliente.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/users/{user_id}/reactivate:
    post:
      summary: Reativar pessoa
      description: >-
        Deixa uma pessoa desativada entrar de novo, com os mesmos papéis, a
        mesma senha e o mesmo segundo fator.


        **Autenticação.** Token de pessoa emitido pelo controle (`Authorization:
        Bearer <JWT>`), com o papel que a operação pede.
      operationId: reactivate_user_v1_users__user_id__reactivate_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/UserStateRequest'
            example:
              reason: Back from leave
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserOut'
              example:
                active: true
                last_login_at: null
                totp_uri: null
                created_at: '2026-09-01T12:00:00Z'
                deactivated_at: null
                password_set: true
                sso: false
                last_sso_login_at: null
                second_factor_confirmed_at: '2026-09-03T10:00:00Z'
                recovery_codes_left: 10
                invitation_expires_at: null
                invitation: null
                user_id: 0192f0a0-4e5f-7061-9c72-8d9e0f1a2b35
                email: rui@acme.example
                roles:
                  - role: security
                    space_id: null
                    source_ids: []
          description: A pessoa, ativa de novo.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security:
        - personToken: []
components:
  schemas:
    UserStateRequest:
      additionalProperties: false
      properties:
        reason:
          description: O motivo, guardado no histórico de acesso da pessoa.
          maxLength: 1000
          minLength: 3
          title: Reason
          type: string
      required:
        - reason
      title: UserStateRequest
      type: object
    UserOut:
      additionalProperties: false
      properties:
        active:
          title: Active
          type: boolean
        created_at:
          format: date-time
          title: Created At
          type: string
        deactivated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Deactivated At
        email:
          title: Email
          type: string
        invitation:
          anyOf:
            - $ref: '#/components/schemas/InvitationOut'
            - type: 'null'
          description: 'Aparece uma vez só: na criação, para uma pessoa criada sem senha.'
        invitation_expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            Até quando o link de convite aberto da pessoa vale; nulo quando não
            há convite aberto.
          title: Invitation Expires At
        last_login_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Login At
        last_sso_login_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Sso Login At
        password_set:
          description: >-
            Falso enquanto uma pessoa convidada não escolheu a senha, e para
            quem o SSO criou.
          title: Password Set
          type: boolean
        recovery_codes_left:
          default: 0
          title: Recovery Codes Left
          type: integer
        roles:
          items:
            $ref: '#/components/schemas/BindingOut'
          title: Roles
          type: array
        second_factor_confirmed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            Quando o autenticador em uso foi confirmado; nulo enquanto não há
            um.
          title: Second Factor Confirmed At
        sso:
          description: O domínio do e-mail pertence à conexão de SSO do tenant.
          title: Sso
          type: boolean
        totp_uri:
          anyOf:
            - type: string
            - type: 'null'
          description: Aparece uma vez só, na criação, para cadastrar o segundo fator.
          title: Totp Uri
        user_id:
          format: uuid
          title: User Id
          type: string
      required:
        - user_id
        - email
        - active
        - roles
        - created_at
        - password_set
        - sso
      title: UserOut
      type: object
    Problem:
      additionalProperties: false
      description: >-
        Detalhes do problema no formato da RFC 9457; `code` vem do catálogo de
        erros versionado.
      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
    InvitationOut:
      additionalProperties: false
      properties:
        expires_at:
          format: date-time
          title: Expires At
          type: string
        token:
          description: >-
            Aparece uma vez só. O Console transforma o token no link
            `<console>/console/convite#<token>`, que entra uma vez e até
            `expires_at`. A Niadra guarda só um hash com chave dele.
          title: Token
          type: string
      required:
        - token
        - expires_at
      title: InvitationOut
      type: object
    BindingOut:
      additionalProperties: false
      properties:
        role:
          $ref: '#/components/schemas/Role'
        source_ids:
          items:
            format: uuid
            type: string
          title: Source Ids
          type: array
        space_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Space Id
      required:
        - role
        - space_id
        - source_ids
      title: BindingOut
      type: object
    Role:
      description: Papéis do Console, combináveis.
      enum:
        - admin
        - security
        - integration
        - review
        - analysis
        - vendor
      title: Role
      type: string
  securitySchemes:
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````