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

# Take in client-supplied funds-recovery ids

> Accepts an inventory of BACEN funds-recovery ids the client already holds and runs each one through the canonical snapshot pipeline: authoritative GET at BACEN, then apply through the same compare-and-set seam every other path uses. This is the only way a recovery older than BACEN's seven-day event-notification window — or one whose notification was lost — becomes visible here; the window is not an inventory. Idempotent by construction: an id already at BACEN's current version is a no-op that emits no second event, so the same batch may be re-sent safely. Each id is answered independently; a batch is capped at 50 ids per request.



## OpenAPI

````yaml /pt/openapi/v3-current/spi-dict.yaml post /api/v1/dict/funds-recoveries/intake
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    OpenAPI 3.1 surface for the DICT (Diretório de Identificadores de Contas
    Transacionais) capability of Lerian SPI, the direct integration between the
    institution and the Brazilian Instant Payment System (SPI/Pix). It covers
    the PIX key lifecycle, portability and ownership claims, the MED 2.0 dispute
    surface (infraction reports, refunds, fraud markers, and funds recoveries),
    antifraud statistics, synchronous DICT reports, and the internal operations
    that keep the key directory consistent.
  license:
    name: Lerian Studio General License
  title: Lerian SPI — DICT API
  version: 1.0.0
servers:
  - url: https://spi.sandbox.lerian.net
security: []
tags:
  - description: 'PIX key lifecycle: register, list, search, lookup, delete, and statistics.'
    name: Keys
  - description: >-
      PIX key portability and ownership claims through their full lifecycle
      (initiate, confirm, reject, cancel, acknowledge, complete).
    name: Claims
  - description: 'DICT infraction reports: list and retrieve.'
    name: Infractions
  - description: 'DICT refund requests: create, list, and retrieve.'
    name: Refunds
  - description: 'PIX fraud markers: create, list, and statistics.'
    name: Fraud Markers
  - description: >-
      Durable MED operation-intent status: the operationId every
      create/lifecycle-transition backlog route returns or references on every
      outcome, queryable independently of the business resource.
    name: Operations
  - description: >-
      Synchronous reports over Lerian SPI's own DICT record: COUNT(*) summaries
      of keys (by type/status) and claims (by type/status + open-past-deadline).
      COUNT-only — DICT holds no money.
    name: Reports
  - description: >-
      Internal DICT operations: reconciliation runs, claim deadline processing,
      and orphaned-key cleanup.
    name: Internal
paths:
  /api/v1/dict/funds-recoveries/intake:
    post:
      tags:
        - Funds Recoveries
      summary: Take in client-supplied funds-recovery ids
      description: >-
        Accepts an inventory of BACEN funds-recovery ids the client already
        holds and runs each one through the canonical snapshot pipeline:
        authoritative GET at BACEN, then apply through the same compare-and-set
        seam every other path uses. This is the only way a recovery older than
        BACEN's seven-day event-notification window — or one whose notification
        was lost — becomes visible here; the window is not an inventory.
        Idempotent by construction: an id already at BACEN's current version is
        a no-op that emits no second event, so the same batch may be re-sent
        safely. Each id is answered independently; a batch is capped at 50 ids
        per request.
      operationId: intakeFundsRecoveries
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FundsRecoveryIntakeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundsRecoveryIntakeResponse'
          description: OK
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Not Found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    FundsRecoveryIntakeRequest:
      additionalProperties: false
      properties:
        attestGapRecovered:
          description: >-
            Set to true to declare that the recoveries this deployment is
            missing — those lost to a blocked convergence gap, and those on the
            feed's stepped-over replay list — have now been supplied. It clears
            the block and empties the replay list in full, including ids this
            request did not carry. Every id it erases is written to the audit
            log by name first, along with the size of the whole inventory, so a
            recovery nobody ever supplied stays nameable after the list is gone.
            It is an assertion by the caller, recorded under the caller's
            identity: nothing verifies it, and nothing else lifts the block.
          type: boolean
        bacenResourceIds:
          description: >-
            BACEN-assigned funds-recovery UUIDs the client holds from its own
            records. Each one is fetched from BACEN and applied through the
            canonical snapshot pipeline. Any age and any status is accepted —
            this is precisely the inventory the seven-day event-notification
            window cannot reveal.
          items:
            type: string
          maxItems: 50
          minItems: 1
          type:
            - array
            - 'null'
      required:
        - bacenResourceIds
      type: object
    FundsRecoveryIntakeResponse:
      additionalProperties: false
      properties:
        gapBlockCleared:
          description: >-
            True when this request carried an attestation and the
            convergence-gap block was cleared.
          type: boolean
        results:
          description: One entry per supplied id, in the order supplied.
          items:
            $ref: '#/components/schemas/FundsRecoveryIntakeResult'
          type: array
      required:
        - results
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        correlationId:
          description: Request-scoped correlation identifier echoing X-Request-ID.
          examples:
            - req-7a3f9c2e
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      required:
        - correlationId
      type: object
    FundsRecoveryIntakeResult:
      additionalProperties: false
      properties:
        bacenResourceId:
          description: The supplied BACEN funds-recovery id.
          format: uuid
          type: string
        outcome:
          description: >-
            materialized: no local record existed and BACEN's snapshot became
            this resource's first observation. applied: BACEN's snapshot was
            newer than the stored one and replaced it. deduped: the stored
            snapshot is already BACEN's current one — nothing written, no second
            event. ignored: BACEN served an older snapshot than the stored one.
            not_found: BACEN does not serve us a recovery with this id.
            unmaterializable: BACEN's snapshot cannot be stored as a local
            record. failed: the attempt did not complete (BACEN unreachable or a
            write failure) — retry the id.
          enum:
            - materialized
            - applied
            - deduped
            - ignored
            - not_found
            - unmaterializable
            - failed
          type: string
      required:
        - bacenResourceId
        - outcome
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````