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

# List consultations

> Lists the consultations of this deployment, newest first, one page at a time. You can filter by `status`, `type`, `companyConsultationId`, `subjectRole`, `restrictionActive`, `from` and `to`. Use `companyConsultationId` to list the holder and representative consultations that link to a company consultation. To filter by document, use `POST /v1/src/consultations/search`.

For an exact page sequence, set `to` a few seconds in the past before you read the first page.



## OpenAPI

````yaml /pt/openapi/v3-current/src.yaml get /v1/src/consultations
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/consultations:
    get:
      tags:
        - consultation
      summary: List consultations
      description: >-
        Lists the consultations of this deployment, newest first, one page at a
        time. You can filter by `status`, `type`, `companyConsultationId`,
        `subjectRole`, `restrictionActive`, `from` and `to`. Use
        `companyConsultationId` to list the holder and representative
        consultations that link to a company consultation. To filter by
        document, use `POST /v1/src/consultations/search`.


        For an exact page sequence, set `to` a few seconds in the past before
        you read the first page.
      operationId: listConsultations
      parameters:
        - description: >-
            Filter by lifecycle state: pending | completed | failed. An unknown
            value returns 422 SRC-0002.
          explode: false
          in: query
          name: status
          schema:
            description: >-
              Filter by lifecycle state: pending | completed | failed. An
              unknown value returns 422 SRC-0002.
            examples:
              - pending
            type: string
        - description: >-
            Filter by document type: CPF | CNPJ. An unknown value returns 422
            SRC-0002.
          explode: false
          in: query
          name: type
          schema:
            description: >-
              Filter by document type: CPF | CNPJ. An unknown value returns 422
              SRC-0002.
            examples:
              - CPF
            type: string
        - description: >-
            Only the consultations LINKED to this company consultation — the
            link seen from the company's side. The value is a consultation id.
            An id that does not exist, or belongs to another deployment, returns
            an EMPTY page and 200 — never 404/422. A value that is not a UUID
            returns 400 SRC-0001.
          explode: false
          in: query
          name: companyConsultationId
          schema:
            description: >-
              Only the consultations LINKED to this company consultation — the
              link seen from the company's side. The value is a consultation id.
              An id that does not exist, or belongs to another deployment,
              returns an EMPTY page and 200 — never 404/422. A value that is not
              a UUID returns 400 SRC-0001.
            examples:
              - 8f14e45f-ceea-467a-9a36-dedd4bea2543
            type: string
        - description: >-
            Filter by the role the consulted document plays: individual |
            company | holder | representative. An unknown value returns 422
            SRC-0002.
          explode: false
          in: query
          name: subjectRole
          schema:
            description: >-
              Filter by the role the consulted document plays: individual |
              company | holder | representative. An unknown value returns 422
              SRC-0002.
            examples:
              - representative
            type: string
        - description: >-
            Filter by whether the consultation holds an active restriction.
            THREE populations, and this parameter selects among them: true
            returns only the consultations where at least one consulted
            protection type came back restricted; false returns only the
            CONCLUDED consultations whose verdicts were all permitted; omitting
            the parameter returns all of them, INCLUDING the ones with no
            verdict yet (pending, and failed), which carry restrictionActive:
            null and are returned by NEITHER value — false is an assertion about
            a verdict RECEIVED, and a consultation BACEN has not answered has
            none. An empty value is the same as omitting the parameter; any
            other value outside true or false returns 422 SRC-0002.
          explode: false
          in: query
          name: restrictionActive
          schema:
            description: >-
              Filter by whether the consultation holds an active restriction.
              THREE populations, and this parameter selects among them: true
              returns only the consultations where at least one consulted
              protection type came back restricted; false returns only the
              CONCLUDED consultations whose verdicts were all permitted;
              omitting the parameter returns all of them, INCLUDING the ones
              with no verdict yet (pending, and failed), which carry
              restrictionActive: null and are returned by NEITHER value — false
              is an assertion about a verdict RECEIVED, and a consultation BACEN
              has not answered has none. An empty value is the same as omitting
              the parameter; any other value outside true or false returns 422
              SRC-0002.
            examples:
              - 'true'
            type: string
        - description: >-
            Inclusive lower bound on acceptance time (RFC3339 date-time).
            Unparseable returns 400 SRC-0001.
          explode: false
          in: query
          name: from
          schema:
            description: >-
              Inclusive lower bound on acceptance time (RFC3339 date-time).
              Unparseable returns 400 SRC-0001.
            examples:
              - '2026-08-01T00:00:00Z'
            type: string
        - description: >-
            Inclusive upper bound on acceptance time (RFC3339 date-time).
            Unparseable returns 400 SRC-0001; earlier than from returns 422
            SRC-0002. For an EXACT page sequence set it a few seconds in the
            past, closing the window before you start paging — see the operation
            description.
          explode: false
          in: query
          name: to
          schema:
            description: >-
              Inclusive upper bound on acceptance time (RFC3339 date-time).
              Unparseable returns 400 SRC-0001; earlier than from returns 422
              SRC-0002. For an EXACT page sequence set it a few seconds in the
              past, closing the window before you start paging — see the
              operation description.
            examples:
              - '2026-08-31T23:59:59Z'
            type: string
        - description: >-
            Opaque pagination cursor from a previous page. An invalid cursor
            returns 400 SRC-0001. Paging is exact only inside a closed, lagged
            'to' window — see the operation description.
          explode: false
          in: query
          name: cursor
          schema:
            description: >-
              Opaque pagination cursor from a previous page. An invalid cursor
              returns 400 SRC-0001. Paging is exact only inside a closed, lagged
              'to' window — see the operation description.
            type: string
        - description: Page size (1..200).
          explode: false
          in: query
          name: limit
          schema:
            default: 50
            description: Page size (1..200).
            examples:
              - 50
            format: int64
            maximum: 200
            minimum: 1
            type: integer
        - 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
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsultationListBody'
          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:consultation:read
components:
  schemas:
    ConsultationListBody:
      additionalProperties: false
      properties:
        items:
          description: The page's consultation summaries, newest first.
          items:
            $ref: '#/components/schemas/ConsultationSummaryBody'
          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'
        prevCursor:
          description: Opaque cursor for the preceding page; null.
          type:
            - string
            - 'null'
      required:
        - items
        - limit
        - nextCursor
        - prevCursor
      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
    ConsultationSummaryBody:
      additionalProperties: false
      properties:
        acceptedAt:
          description: Acceptance instant (RFC3339).
          format: date-time
          type: string
        companyConsultationId:
          description: >-
            The company consultation this row is linked to — the LINK, seen from
            the child. null for individual and company. Follow it with GET
            /v1/src/consultations/{id}. Its verdict and this one never couple:
            the decision is the institution's (arts. 2º-A/4º-A §3º).
          type:
            - string
            - 'null'
        concludedAt:
          description: Conclusion instant; null while pending.
          format: date-time
          type:
            - string
            - 'null'
        documentMasked:
          description: Masked consulted document.
          examples:
            - 529******25
          type: string
        documentType:
          description: Type of the consulted document.
          examples:
            - CPF
          type: string
        id:
          description: Consultation identifier.
          examples:
            - 8f14e45f-ceea-467a-9a36-dedd4bea2543
          type: string
        restrictionActive:
          description: >-
            When completed: whether any consulted protection type came back
            restricted. null when not completed — not the same as false.
          type:
            - boolean
            - 'null'
        status:
          description: 'Lifecycle state: pending | completed | failed.'
          examples:
            - pending
          type: string
        subjectRole:
          description: >-
            The role the consulted document plays: individual | company | holder
            | representative. Always present.
          examples:
            - representative
          type: string
      required:
        - id
        - documentMasked
        - documentType
        - subjectRole
        - companyConsultationId
        - status
        - restrictionActive
        - acceptedAt
        - concludedAt
      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.