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

# Search evidence records

> Searches the evidence trail by document and returns the matching records, newest first by `occurredAt`. The results include requests that Lerian SRC refused before acceptance, which belong to no consultation. When `kind` is `operator_case_closure` or `credential_operation`, `document` is optional.

The response does not carry the record content. For a record that belongs to a consultation, `GET /v1/src/evidence/consultations/{id}` returns the content.



## OpenAPI

````yaml /es/openapi/v3-current/src.yaml post /v1/src/evidence/records
openapi: 3.1.0
info:
  description: >-
    API for Lerian SRC, which sends your institution's restriction consultations
    to BACEN's BC Protege+ and keeps the evidence of each consultation.
  title: Lerian SRC API
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: Replace the example host with your deployment's address.
security:
  - m2m: []
tags:
  - description: >-
      Asynchronous restriction consultations (accept → pending →
      completed/failed).
    name: consultation
  - description: >-
      Client-decision records (exceptional proceed, refusal explanation) —
      single-purpose, write-once.
    name: decision
  - description: Regulatory evidence trail — search, reconstruction, chained correction.
    name: evidence
  - description: Aggregated numeric view per institution.
    name: dashboard
  - description: Status of the institution's regulatory credential.
    name: credential
  - description: >-
      Operator cases — the backlog `openOperatorCases` counts, and the act that
      closes one.
    name: operator
paths:
  /v1/src/evidence/records:
    post:
      tags:
        - evidence
      summary: Search evidence records
      description: >-
        Searches the evidence trail by document and returns the matching
        records, newest first by `occurredAt`. The results include requests that
        Lerian SRC refused before acceptance, which belong to no consultation.
        When `kind` is `operator_case_closure` or `credential_operation`,
        `document` is optional.


        The response does not carry the record content. For a record that
        belongs to a consultation, `GET /v1/src/evidence/consultations/{id}`
        returns the content.
      operationId: searchEvidenceRecords
      parameters:
        - description: Optional correlation id (UUID) propagated through logs/traces.
          in: header
          name: X-Request-ID
          schema:
            description: Optional correlation id (UUID) propagated through logs/traces.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvidenceRecordSearchRequestBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvidenceRecordSearchListBody'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: Forbidden
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: Internal Server Error
      security:
        - m2m:
            - src:evidence:read
components:
  schemas:
    EvidenceRecordSearchRequestBody:
      additionalProperties: false
      properties:
        cursor:
          description: >-
            Opaque pagination cursor from a previous page. An invalid cursor
            returns 400 SRC-0001.
          type: string
        document:
          description: >-
            Required unless `kind` is `credential_operation` or
            `operator_case_closure`. The consulted document, unmasked: CPF (11
            numeric digits) or CNPJ (14 characters, 12 alphanumeric [0-9A-Z]
            plus 2 numeric check digits). Absent or off-pattern returns `422`
            `SRC-0002`, except that absence is accepted when `kind` is one of
            those two classes.
          pattern: ^([0-9]{11}|[0-9A-Z]{12}[0-9]{2})$
          type: string
        documentType:
          description: >-
            Optional declared class of the document: CPF or CNPJ. It filters
            nothing and does not change the returned `documentMasked`. A value
            outside the vocabulary returns `422` `SRC-0002` with a violation on
            this member.
          enum:
            - CPF
            - CNPJ
          examples:
            - CPF
          type: string
        kind:
          description: >-
            Optional record class that restricts the page. When it is
            `credential_operation` or `operator_case_closure`, `document` is
            optional. For every other class, `document` is required. A value
            outside the vocabulary returns `422` `SRC-0002` with a violation on
            this member.
          enum:
            - acceptance
            - entry_refusal
            - dispatch_attempt
            - channel_confirmation
            - response
            - rejection
            - duplicate_response
            - notification
            - client_decision
            - refusal_explanation
            - credential_operation
            - operator_case_closure
            - correction
          examples:
            - operator_case_closure
          type: string
        limit:
          default: 50
          description: Page size (1..200).
          examples:
            - 50
          format: int64
          maximum: 200
          minimum: 1
          type: integer
      type: object
    EvidenceRecordSearchListBody:
      additionalProperties: false
      properties:
        documentMasked:
          description: The searched document, masked.
          examples:
            - 529******26
          type: string
        items:
          description: The page's evidence records, most recently occurred first.
          items:
            $ref: '#/components/schemas/EvidenceRecordSearchItemBody'
          type:
            - array
            - 'null'
        limit:
          description: Effective page size this request was served with.
          examples:
            - 50
          format: int64
          type: integer
        nextCursor:
          description: Opaque cursor for the following page; null on the last page.
          type:
            - string
            - 'null'
      required:
        - items
        - documentMasked
        - limit
        - nextCursor
      type: object
    ProblemDetails:
      additionalProperties: false
      properties:
        code:
          type: string
        correlationId:
          examples:
            - req-7a3f9c2e
          type: string
        detail:
          examples:
            - check digits are invalid for the declared documentType
          type: string
        details:
          additionalProperties: {}
          type: object
        instance:
          examples:
            - /v1/src/consultations
          type: string
        status:
          examples:
            - 400
          format: int64
          type: integer
        title:
          examples:
            - Bad Request
          type: string
        traceId:
          examples:
            - a1b2c3d4
          type: string
        type:
          type: string
        violations:
          items:
            $ref: '#/components/schemas/Violation'
          type:
            - array
            - 'null'
      required:
        - type
        - title
        - status
        - detail
        - instance
        - traceId
        - correlationId
        - violations
      type: object
    EvidenceRecordSearchItemBody:
      additionalProperties: false
      properties:
        bcbControlCode:
          description: >-
            BACEN control code (NumCtrlSRC) this record concerned; null when it
            concerned none.
          type:
            - string
            - 'null'
        consultationId:
          description: >-
            Consultation the record belongs to; NULL for an entry_refusal — a
            request refused before acceptance creates no consultation.
          type:
            - string
            - 'null'
        kind:
          description: Record class.
          enum:
            - acceptance
            - entry_refusal
            - dispatch_attempt
            - channel_confirmation
            - response
            - rejection
            - duplicate_response
            - notification
            - client_decision
            - refusal_explanation
            - credential_operation
            - operator_case_closure
            - correction
          examples:
            - entry_refusal
          type: string
        occurredAt:
          description: >-
            When the recorded FACT happened (RFC3339) — not when the row was
            written. It is the ordering key of this page.
          format: date-time
          type: string
        recordId:
          description: Evidence record identifier.
          examples:
            - 0192f5c4-1c2f-7c3a-8a1b-9f2e3d4c5b6a
          type: string
        sequence:
          description: >-
            Position in the record's own trail, from 1. An entry_refusal is a
            trail of one.
          examples:
            - 1
          format: int64
          type: integer
      required:
        - recordId
        - consultationId
        - kind
        - sequence
        - bcbControlCode
        - occurredAt
      type: object
    Violation:
      additionalProperties: false
      properties:
        code:
          type: string
        field:
          examples:
            - document
          type: string
        reason:
          examples:
            - check digits are invalid for the declared documentType
          type: string
      required:
        - field
        - reason
      type: object
  securitySchemes:
    m2m:
      flows:
        clientCredentials:
          scopes:
            src:consultation:read: Read/list consultations
            src:consultation:write: Create restriction consultations
            src:credential:read: Read regulatory-credential status
            src:dashboard:read: Read the aggregated numeric dashboard
            src:decision:write: >-
              File the institution's record against a consultation — exceptional
              proceed (§1º) or refusal explanation (§2º)
            src:evidence:correct: Append a chained correction to an evidence trail
            src:evidence:read: Search and reconstruct the evidence trail
            src:operator:close: >-
              Close an open operator case so it leaves the openOperatorCases
              backlog
            src:operator:read: List the operator cases
          tokenUrl: https://access-manager.example.com/oauth2/token
      type: oauth2

````

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