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

# Retrieve a consultation

> Returns the current state of one consultation. `pending` is a normal state. A `completed` consultation carries the verdict for each protection type and BACEN's control code. A `failed` consultation carries the rejection.

An unknown id returns `404` with code `SRC-0301`. A malformed id returns `400` with code `SRC-0001`.



## OpenAPI

````yaml /en/openapi/v3-current/src.yaml get /v1/src/consultations/{id}
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/{id}:
    get:
      tags:
        - consultation
      summary: Retrieve a consultation
      description: >-
        Returns the current state of one consultation. `pending` is a normal
        state. A `completed` consultation carries the verdict for each
        protection type and BACEN's control code. A `failed` consultation
        carries the rejection.


        An unknown id returns `404` with code `SRC-0301`. A malformed id returns
        `400` with code `SRC-0001`.
      operationId: getConsultation
      parameters:
        - description: >-
            Consultation identifier (UUID). A malformed identifier returns 400
            SRC-0001.
          in: path
          name: id
          required: true
          schema:
            description: >-
              Consultation identifier (UUID). A malformed identifier returns 400
              SRC-0001.
            examples:
              - 8f14e45f-ceea-467a-9a36-dedd4bea2543
            type: string
        - 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/ConsultationBody'
          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
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: Not Found
        '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:
    ConsultationBody:
      additionalProperties: false
      properties:
        acceptedAt:
          description: Acceptance instant (RFC3339).
          format: date-time
          type: string
        attempts:
          $ref: '#/components/schemas/AttemptsBody'
          description: Dispatch attempt history summary.
        bcbControlCode:
          description: Consultation control code assigned by BACEN (NumCtrlSRC).
          examples:
            - SRC20260826000000123
          type: string
        bcbProcessedAt:
          description: Processing instant at BACEN (DtHrBC); null until completed.
          format: date-time
          type:
            - string
            - 'null'
        companyConsultationId:
          description: >-
            The company consultation this holder or representative belongs to —
            the LINK, seen from the child. null for individual and company.
            Follow it with GET /v1/src/consultations/{id}; list the other
            children with GET /v1/src/consultations?companyConsultationId={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
        institutionRecord:
          $ref: '#/components/schemas/InstitutionRecordBody'
          description: >-
            The ONE record the institution filed against this consultation
            (arts. 2º-A/4º-A): kind "exceptional_proceed" (§1º — it contracted
            despite the active restriction, with a justification and a
            circumstance) or "refusal_explanation" (§2º — it refused, and this
            is what the interested party was told). The two are mutually
            exclusive. null when none was filed; immutable once filed.
        motivation:
          $ref: '#/components/schemas/MotivationBody'
          description: The recorded motivation context.
        protectionTypes:
          description: The consulted protection types, in request order.
          items:
            type: string
          type:
            - array
            - 'null'
        regulatoryOperationNumber:
          description: >-
            The operation number (NUOp) that Lerian SRC creates for the
            consultation. It has 23 characters: the institution's 8-character
            CNPJ base, an 8-digit date and a 7-digit sequence. Use it to
            reconcile the operation with BACEN's records. Absent until the
            dispatch is opened.
          examples:
            - '12345678202609100000001'
          type: string
        rejection:
          $ref: '#/components/schemas/RejectionBody'
          description: >-
            Present when failed by a BACEN technical rejection (code preserved
            verbatim); null otherwise.
        status:
          description: >-
            Lifecycle state: pending | completed | failed. pending is a NORMAL
            state, never an error.
          examples:
            - pending
          type: string
        subjectRole:
          description: >-
            The role the consulted document plays: individual | company | holder
            | representative. Always present.
          examples:
            - representative
          type: string
        verdicts:
          description: Present when completed — one verdict per consulted protection type.
          items:
            $ref: '#/components/schemas/VerdictBody'
          type:
            - array
            - 'null'
      required:
        - id
        - documentMasked
        - documentType
        - subjectRole
        - companyConsultationId
        - protectionTypes
        - motivation
        - status
        - bcbProcessedAt
        - rejection
        - attempts
        - institutionRecord
        - acceptedAt
        - concludedAt
      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
    AttemptsBody:
      additionalProperties: false
      properties:
        budgetExhausted:
          description: >-
            true when the automatic retry budget was exhausted and the
            consultation became a signalled operator case.
          type: boolean
        count:
          description: Number of dispatch attempts made.
          examples:
            - 3
          format: int64
          type: integer
        lastAttemptAt:
          description: Instant of the most recent attempt; null when there has been none.
          format: date-time
          type:
            - string
            - 'null'
      required:
        - count
        - lastAttemptAt
        - budgetExhausted
      type: object
    InstitutionRecordBody:
      additionalProperties: false
      properties:
        circumstance:
          description: >-
            The exceptional circumstance alleged, as filed. Empty on a
            refusal-explanation record.
          type: string
        explanation:
          description: >-
            The explanation given to the interested party, as filed. Empty on an
            exceptional-proceed record.
          type: string
        filedBy:
          examples:
            - m2m:core-banking-integration
          type: string
        justification:
          description: >-
            The mandatory justification, as filed. Empty on a
            refusal-explanation record.
          type: string
        kind:
          description: >-
            Which paragraph of art. 2º-A this record answers:
            "exceptional_proceed" (§1º) or "refusal_explanation" (§2º). It is
            the member that says which prose members carry text.
          examples:
            - exceptional_proceed
          type: string
        registeredAt:
          description: >-
            Registration instant (RFC3339, UTC). The record is immutable, so
            this never changes.
          format: date-time
          type: string
        registeredBy:
          description: Who filed the record (institution-side identity).
          examples:
            - maria.compliance@bank.example
          type: string
      required:
        - kind
        - registeredBy
        - filedBy
        - justification
        - circumstance
        - explanation
        - registeredAt
      type: object
    MotivationBody:
      additionalProperties: false
      properties:
        note:
          description: Optional free-text context (max 1000 chars).
          maxLength: 1000
          type: string
        reference:
          description: >-
            Identifier of the originating event in the client's system (e.g. an
            account-opening request id). REQUIRED, 1..255 chars.
          examples:
            - acct-open-2026-000123
          maxLength: 255
          minLength: 1
          type: string
      required:
        - reference
      type: object
    RejectionBody:
      additionalProperties: false
      properties:
        classification:
          description: >-
            transient | permanent | unknown. The rejection code and message stay
            as BACEN sent them.
          examples:
            - transient
          type: string
        code:
          description: Original BACEN rejection code, verbatim.
          examples:
            - ESRC0011
          type: string
        message:
          description: Original BACEN message when present, verbatim.
          type: string
        receivedAt:
          description: Instant the rejection was received (RFC3339).
          format: date-time
          type: string
      required:
        - code
        - classification
        - receivedAt
      type: object
    VerdictBody:
      additionalProperties: false
      properties:
        permitted:
          description: >-
            `true` when BACEN reports no active restriction for this protection
            type; `false` when BACEN reports an active restriction.
          examples:
            - false
          type: boolean
        protectionType:
          description: The protection type this verdict answers.
          examples:
            - account_opening
          type: string
      required:
        - protectionType
        - permitted
      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.