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

# Buscar perfis

> Encontra perfis por handle, com o valor no corpo e nunca registrado em log.



## OpenAPI

````yaml openapi/pt/cell.json POST /v1/profiles/search
openapi: 3.1.0
info:
  title: API de dados da Niadra
  version: '1'
  description: >-
    Escrita, contexto, histórico, objetos, identidade, privacidade e governança
    de um espaço. Cada espaço tem um endereço estável, com o espaço e a região
    no nome.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: O espaço, que vem na chave de fonte.
      region:
        default: us-east-1
        description: A região do espaço, que também vem na chave.
security: []
paths:
  /v1/profiles/search:
    post:
      tags:
        - identity
      summary: Buscar perfis
      description: >-
        É uma leitura, então não gera comprovante; a consulta vai no corpo e
        nunca é registrada em log.


        **Autenticação.** Token de pessoa do Console com o papel `security`,
        `integration` (ou admin), ou chave de fonte com o escopo `admin`.
      operationId: search_profiles_v1_profiles_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfileSearchIn'
            example:
              query: '+14155550123'
              limit: 20
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileSearchOut'
              example:
                items:
                  - profile_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e01
                    pseudonym: p_7f3a91c2
                    kind: person
                    partial: false
                    handles:
                      - handle_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e02
                        type: phone_e164
                        value: +1415555****
                        scope: ''
                        subject_kind: person
                        status: active
                        level: V1
                        first_seen: '2021-04-06T13:20:00Z'
                        last_seen: '2026-09-22T17:07:03Z'
                      - handle_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e03
                        type: system_id
                        value: '48213'
                        scope: crm
                        subject_kind: person
                        status: active
                        level: V4
                        first_seen: '2021-04-06T13:21:00Z'
                        last_seen: '2026-09-22T17:07:03Z'
                    last_seen: '2026-09-22T17:07:03Z'
          description: >-
            Os perfis encontrados, com os handles mascarados pelo papel de quem
            lê.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ProfileSearchIn:
      additionalProperties: false
      description: >-
        O valor vai no corpo. Um pseudônimo (`p_...`) ou um identificador:
        telefones, e-mails, ids do WhatsApp e documentos nacionais são
        reconhecidos pelo formato; ids opacos pedem `type` (e `scope`, quando
        têm escopo).
      properties:
        limit:
          default: 20
          maximum: 50
          minimum: 1
          title: Limit
          type: integer
        query:
          maxLength: 320
          minLength: 1
          title: Query
          type: string
        scope:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Scope
        type:
          anyOf:
            - $ref: '#/components/schemas/HandleType'
            - type: 'null'
      required:
        - query
      title: ProfileSearchIn
      type: object
    ProfileSearchOut:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/ProfileMatch'
          title: Items
          type: array
      required:
        - items
      title: ProfileSearchOut
      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
    HandleType:
      enum:
        - phone_e164
        - wa_id
        - wa_jid
        - wa_lid
        - wa_bsuid
        - email
        - gov_id_hmac
        - app_user_id
        - system_id
        - org_registry_hmac
        - email_domain
        - anon_id
      title: HandleType
      type: string
      description: >-
        O tipo de identificador. O valor é classificado pelo formato, nunca pelo
        campo de onde veio.
    ProfileMatch:
      additionalProperties: false
      properties:
        handles:
          description: Mascarados conforme o papel de quem chama.
          items:
            $ref: '#/components/schemas/HandleOut'
          title: Handles
          type: array
        kind:
          $ref: '#/components/schemas/SubjectKind'
        last_seen:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: A atividade mais recente em qualquer handle do perfil.
          title: Last Seen
        partial:
          title: Partial
          type: boolean
        profile_id:
          format: uuid
          title: Profile Id
          type: string
        pseudonym:
          title: Pseudonym
          type: string
      required:
        - profile_id
        - pseudonym
        - kind
        - partial
        - handles
        - last_seen
      title: ProfileMatch
      type: object
    HandleOut:
      additionalProperties: false
      properties:
        first_seen:
          format: date-time
          title: First Seen
          type: string
        handle_id:
          format: uuid
          title: Handle Id
          type: string
        last_seen:
          format: date-time
          title: Last Seen
          type: string
        level:
          $ref: '#/components/schemas/Verification'
        scope:
          title: Scope
          type: string
        status:
          $ref: '#/components/schemas/HandleStatus'
        subject_kind:
          $ref: '#/components/schemas/SubjectKind'
        type:
          $ref: '#/components/schemas/HandleType'
        value:
          description: Mascarado conforme o papel de quem chama.
          title: Value
          type: string
      required:
        - handle_id
        - type
        - scope
        - subject_kind
        - value
        - status
        - level
        - first_seen
        - last_seen
      title: HandleOut
      type: object
    SubjectKind:
      enum:
        - person
        - account
        - partner
      title: SubjectKind
      type: string
      description: >-
        Uma pessoa, uma organização cliente (`account`) ou uma organização que
        participa sem ser cliente (`partner`).
    Verification:
      description: >-
        Nível de verificação da sessão. V0 autodeclarado, V1 plausível pelo
        canal, V2 atestado pelo canal, V3 desafiado (OTP ou login), V4 conferido
        com um sistema de registro ou por um atendente. `no_customer` vale para
        tarefas sem cliente presente e só é aceito de fontes de agente interno.
      enum:
        - V0
        - V1
        - V2
        - V3
        - V4
        - no_customer
      title: Verification
      type: string
    HandleStatus:
      enum:
        - active
        - ambiguous
        - blocked
        - suspected_recycled
      title: HandleStatus
      type: string
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````