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

# Correct an evidence record

> Appends a correction record to the evidence trail of a consultation. The correction points to the corrected record through `correctsSequence`, and the corrected record stays in the trail unchanged. The response returns the position of the new record.

A `409` with code `SRC-0104` means that a concurrent correction took the position. Nothing was written, and you can retry. This operation is not idempotent: a repeated request appends a second correction.



## OpenAPI

````yaml /es/openapi/v3-current/src.yaml post /v1/src/evidence/consultations/{id}/corrections
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/consultations/{id}/corrections:
    post:
      tags:
        - evidence
      summary: Correct an evidence record
      description: >-
        Appends a correction record to the evidence trail of a consultation. The
        correction points to the corrected record through `correctsSequence`,
        and the corrected record stays in the trail unchanged. The response
        returns the position of the new record.


        A `409` with code `SRC-0104` means that a concurrent correction took the
        position. Nothing was written, and you can retry. This operation is not
        idempotent: a repeated request appends a second correction.
      operationId: correctEvidenceRecord
      parameters:
        - description: >-
            Consultation identifier (UUID) whose evidence trail is being
            corrected.
          in: path
          name: id
          required: true
          schema:
            description: >-
              Consultation identifier (UUID) whose evidence trail is being
              corrected.
            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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvidenceCorrectionRequestBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvidenceCorrectionBody'
          description: Created
        '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
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: Conflict
        '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:correct
components:
  schemas:
    EvidenceCorrectionRequestBody:
      additionalProperties: false
      properties:
        correctsSequence:
          description: >-
            REQUIRED. Position (sequence) of the record being corrected, as
            returned by getEvidenceTrail. Must be at least 1 and must be held by
            a record in THIS consultation's trail; anything else returns 422
            SRC-0002 with nothing written.
          examples:
            - 3
          format: int64
          type: integer
        reason:
          description: >-
            Required. Free-text explanation of what was wrong with the corrected
            record. At most 2000 characters, and no control characters other
            than tab, line feed and carriage return. It must be valid UTF-8.
            Empty, over-long or malformed returns `422` `SRC-0002`.
          maxLength: 2000
          minLength: 1
          type: string
      type: object
      required:
        - correctsSequence
        - reason
    EvidenceCorrectionBody:
      additionalProperties: false
      properties:
        correctsSequence:
          description: >-
            The position of the corrected record. That record remains in the
            trail, unchanged.
          examples:
            - 3
          format: int64
          type: integer
        sequence:
          description: >-
            The trail position of the new correction record. It is greater than
            `correctsSequence`.
          examples:
            - 4
          format: int64
          type: integer
      required:
        - sequence
        - correctsSequence
      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
    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.