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

# Lê um usuário final, sem segredo nenhum

> Exige uma chave secreta criada COM o escopo auth:users:read (chaves sem restrição não o têm).



## OpenAPI

````yaml /api-reference/openapi.json get /auth/users/{id}
openapi: 3.1.0
info:
  title: UNIFOKAL API
  version: v1
  summary: >-
    Verificação de identidade: sessão criada no servidor, jornada no widget,
    resultado no webhook.
  description: >-
    A versão vive no caminho (/v1); não existe header de versão. Adição
    compatível (campo, módulo ou chave nova) NÃO sobe a versão: ignore o que não
    conhecer. Todo erro tem a forma { error, message }: o código é estável, a
    mensagem não. Ids são prefixo + ULID. Webhooks são assinados (HMAC SHA-256
    no header X-IDSAAS-Signature, janela de 300s; o segredo é SEU, mínimo 32
    caracteres) e o header x-idsaas-event carrega o tipo do evento.
  termsOfService: https://unifokal.com/termos
  contact:
    name: UNIFOKAL
    url: https://docs.unifokal.com/
servers:
  - url: https://api.unifokal.com/v1
security: []
externalDocs:
  description: >-
    Documentação completa em https://docs.unifokal.com/. Briefing para agentes
    de IA em https://unifokal.com/llms.txt.
  url: https://docs.unifokal.com/
paths:
  /auth/users/{id}:
    get:
      summary: Lê um usuário final, sem segredo nenhum
      description: >-
        Exige uma chave secreta criada COM o escopo auth:users:read (chaves sem
        restrição não o têm).
      operationId: getAuthUser
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            pattern: ^usr_[0-9A-HJKMNP-TV-Z]{26}$
      responses:
        '200':
          description: O usuário, com o telefone inteiro e o metadado privado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthUserDetail'
        '400':
          description: >-
            Códigos estáveis: validation_error. Ramifique pelo campo error,
            nunca pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - validation_error
        '401':
          description: >-
            Códigos estáveis: invalid_api_key. Ramifique pelo campo error, nunca
            pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - invalid_api_key
        '403':
          description: >-
            Códigos estáveis: credential_type_not_allowed,
            organization_suspended, test_key_used_in_production,
            insufficient_scope, ip_not_allowed. Ramifique pelo campo error,
            nunca pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - credential_type_not_allowed
                          - organization_suspended
                          - test_key_used_in_production
                          - insufficient_scope
                          - ip_not_allowed
        '404':
          description: >-
            Códigos estáveis: user_not_found. Ramifique pelo campo error, nunca
            pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - user_not_found
        '429':
          description: >-
            Códigos estáveis: rate_limited. Ramifique pelo campo error, nunca
            pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - rate_limited
      security:
        - secretKey: []
components:
  schemas:
    AuthUserDetail:
      type: object
      required:
        - object
        - id
        - status
        - email
        - email_verified
        - phone
        - phone_verified
        - external_id
        - public_metadata
        - password_set
        - created_at
        - updated_at
        - last_sign_in_at
        - private_metadata
        - password_disabled
        - mfa_factors
        - identity_verification_id
      properties:
        object:
          type: string
          const: user
        id:
          type: string
          pattern: ^usr_[0-9A-HJKMNP-TV-Z]{26}$
        status:
          type: string
          enum:
            - pending
            - active
            - locked
            - disabled
        email:
          type:
            - string
            - 'null'
        email_verified:
          type: boolean
        phone:
          type:
            - string
            - 'null'
          description: Mascarado na lista; inteiro na leitura por id.
        phone_verified:
          type: boolean
        external_id:
          type:
            - string
            - 'null'
        public_metadata:
          type: object
          additionalProperties: true
          description: Até 1200 bytes; viaja no token de acesso (claim md).
        password_set:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        last_sign_in_at:
          type:
            - string
            - 'null'
          format: date-time
        private_metadata:
          type: object
          additionalProperties: true
          description: Até 4096 bytes; nunca sai no token.
        password_disabled:
          type: boolean
        mfa_factors:
          type: array
          items:
            type: string
            enum:
              - totp
              - sms
              - email
        identity_verification_id:
          type:
            - string
            - 'null'
    ErrorEnvelope:
      type: object
      description: >-
        Todo erro da API tem exatamente esta forma. O campo error é um código
        estável (contrato); message é texto livre e pode mudar sem aviso.
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Código estável do erro. Ramifique por ele.
        message:
          type: string
          description: Texto explicativo. NÃO é contrato.
      additionalProperties: false
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        Chave secreta (unifokal_live_ em produção, unifokal_test_ no sandbox: 64
        hex mais CRC-32) no Authorization: Bearer. Só no seu servidor: nunca no
        browser ou app (o widget monta apenas com o id vs_ da sessão). Não
        existe chave publishable.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.