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

> Leituras, buscas e ações administrativas, com o encadeamento por hash, filtradas com os filtros no corpo.



## OpenAPI

````yaml openapi/pt/cell.json POST /v1/receipts/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-2
        description: A região do espaço, que também vem na chave.
security: []
paths:
  /v1/receipts/search:
    post:
      tags:
        - governance
      summary: Buscar comprovantes
      description: >-
        O mesmo que `GET /v1/receipts`, com os filtros no corpo: um id de
        conversa pode ser um telefone ou um e-mail, e nunca viaja numa URL.


        **Autenticação.** Token de pessoa do Console com o papel `security` (ou
        admin), ou chave de fonte com o escopo `admin`.
      operationId: search_receipts_v1_receipts_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReceiptSearch'
            example:
              conversation_id: call-4471
              kind: read
              since: '2026-09-22T00:00:00Z'
              limit: 50
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_ReceiptOut_'
              example:
                items:
                  - receipt_id: 0192f7a4-0e21-7f9b-a2d5-4a7f9e0b1c23
                    kind: history
                    surface: search
                    audience: customer_agent
                    day: '2026-09-22'
                    read_at: '2026-09-22T17:07:09Z'
                    source_id: 0192f79e-11aa-7b20-9f3e-6c1d2e4f5a60
                    profile_id: 0192f7a0-3b2e-7d41-8c5a-2e9f4b7a1c03
                    conversation_id: call-4471
                    purpose: customer_service
                    verification: V1
                    policy_version: pol-14
                    item_ids:
                      - 0192f7a3-7c32-7b0c-9e16-5b8a0f1c2d34
                      - 0192f7a2-5d10-7a8e-b1c4-3f6e8d9a0b12
                    withheld: 1
                    slice: 3
                    seq: 88214
                    prev_hash: sha256:0d9f3a61c2
                    hash: sha256:7e21c8a4b9
                next_cursor: null
          description: Uma página de comprovantes, como `GET /v1/receipts` devolve.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ReceiptSearch:
      additionalProperties: false
      description: >-
        Os filtros de `GET /v1/receipts`, no corpo: um id de conversa nunca
        viaja numa URL.
      properties:
        conversation_id:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          title: Conversation Id
        cursor:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Cursor
        kind:
          anyOf:
            - $ref: '#/components/schemas/ReceiptKind'
            - type: 'null'
        limit:
          default: 50
          maximum: 200
          minimum: 1
          title: Limit
          type: integer
        profile_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Profile Id
        since:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Since
        source_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Source Id
        until:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Until
      title: ReceiptSearch
      type: object
    Page_ReceiptOut_:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/ReceiptOut'
          title: Items
          type: array
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      required:
        - items
      title: Page[ReceiptOut]
      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
    ReceiptKind:
      enum:
        - read
        - history
        - analytics
        - admin
        - holdout
        - denied
      title: ReceiptKind
      type: string
    ReceiptOut:
      additionalProperties: false
      properties:
        about_handle_id:
          anyOf:
            - type: string
            - type: 'null'
          title: About Handle Id
        audience:
          $ref: '#/components/schemas/Audience'
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
        day:
          format: date
          title: Day
          type: string
        detail:
          additionalProperties:
            type: string
          description: >-
            Por que uma leitura `denied` foi recusada (`reason`), ou a ação que
            um comprovante `admin` registra (`action`, `target`).
          title: Detail
          type: object
        experiment_group:
          anyOf:
            - type: string
            - type: 'null'
          title: Experiment Group
        hash:
          description: >-
            SHA-256, em hexadecimal, sobre o hash anterior e a codificação
            canônica deste comprovante.
          title: Hash
          type: string
        item_ids:
          items:
            type: string
          title: Item Ids
          type: array
        kind:
          $ref: '#/components/schemas/ReceiptKind'
        manifest_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Manifest Hash
        object_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Object Id
        pack_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Pack Hash
        person_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Person Id
        policy_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Policy Version
        prev_hash:
          description: SHA-256, em hexadecimal, do elo anterior desta cadeia.
          title: Prev Hash
          type: string
        profile_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Id
        purpose:
          anyOf:
            - type: string
            - type: 'null'
          title: Purpose
        read_at:
          format: date-time
          title: Read At
          type: string
        receipt_id:
          title: Receipt Id
          type: string
        seq:
          title: Seq
          type: integer
        slice:
          title: Slice
          type: integer
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
        surface:
          $ref: '#/components/schemas/ReceiptSurface'
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
        verification:
          anyOf:
            - type: string
            - type: 'null'
          title: Verification
        withheld:
          default: 0
          title: Withheld
          type: integer
      required:
        - receipt_id
        - kind
        - surface
        - audience
        - read_at
        - slice
        - day
        - seq
        - prev_hash
        - hash
      title: ReceiptOut
      type: object
    Audience:
      enum:
        - customer_agent
        - internal_agent
        - human
        - reviewer
        - analyst
        - trigger_target
        - export
      title: Audience
      type: string
    ReceiptSurface:
      enum:
        - pack
        - live
        - delta
        - search
        - timeline
        - open
        - object
        - console
      title: ReceiptSurface
      type: string
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````