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

# Resume TED IN Poller

> Use this endpoint to clear the fail-closed at-most-once receive latch and re-arm a latched or dead TED IN poller without restarting the pod. This is a higher-privilege operator endpoint than `/ted-in/poll` because it re-opens JD destructive-read consumption. Reach for it only when auto-recovery cannot revive the poller — a panicked multi-tenant child or a single-tenant poller past the panic hard-cap.

Resume never bypasses the money-path durable-gap gate. When the live receive-state-unknown latch is set, the current latch's reconciliation-gap row must be durable before the poller resumes; otherwise the request is refused with `409` and the poller stays dead. Verify the pending gap with [List TED IN Reconciliation Gaps](/en/reference/midaz/plugins/ted/list-ted-in-reconciliation-gaps) before calling resume.

The optional body `{acknowledge, note}` additionally marks the current latch's reconciliation gap resolved and stamps an operator annotation on it. `acknowledge` defaults to `false`, leaving the gap OPEN so it remains visible for review. A healthy, not-latched poller returns `200` with `resumed: false` and `reason: "not_latched"` — the call is a safe idempotent no-op. Same-key retries replay the cached response.

The route is organization-independent and does not require the `X-Organization-Id` header — the tenant is resolved from the authenticated context. In multi-tenant deployments, an inactive tenant is rejected with `503`.



## OpenAPI

````yaml en/openapi/v3-current/ted.yaml post /v1/transfers/ted-in/resume
openapi: 3.0.3
info:
  title: Bank Transfer (TED) Plugin API
  description: >-
    Complete API for Brazilian bank transfers (TED OUT, TED IN, P2P) through the
    Lerian platform, including transfer initiation, processing, status tracking,
    and cancellation.
  version: 1.1.9
servers:
  - url: https://ted.sandbox.lerian.net
    description: Sandbox (placeholder — not yet available for public access)
security:
  - BearerAuth: []
  - OAuth2ClientCredentials:
      - api
  - OAuth2Password:
      - api
tags:
  - name: Transfers API
    description: Endpoints for initiating, processing, tracking, and cancelling transfers.
  - name: Webhooks
    description: >-
      Endpoints for registering and managing tenant-scoped webhook subscriptions
      for transfer events.
  - name: Webhook DLQ
    description: Endpoints for inspecting and retrying webhook dead-letter queue messages.
paths:
  /v1/transfers/ted-in/resume:
    post:
      tags:
        - Transfers API
      summary: Resume TED IN Poller
      description: >-
        Use this endpoint to clear the fail-closed at-most-once receive latch
        and re-arm a latched or dead TED IN poller without restarting the pod.
        This is a higher-privilege operator endpoint than `/ted-in/poll` because
        it re-opens JD destructive-read consumption. Reach for it only when
        auto-recovery cannot revive the poller — a panicked multi-tenant child
        or a single-tenant poller past the panic hard-cap.


        Resume never bypasses the money-path durable-gap gate. When the live
        receive-state-unknown latch is set, the current latch's
        reconciliation-gap row must be durable before the poller resumes;
        otherwise the request is refused with `409` and the poller stays dead.
        Verify the pending gap with [List TED IN Reconciliation
        Gaps](/en/reference/midaz/plugins/ted/list-ted-in-reconciliation-gaps)
        before calling resume.


        The optional body `{acknowledge, note}` additionally marks the current
        latch's reconciliation gap resolved and stamps an operator annotation on
        it. `acknowledge` defaults to `false`, leaving the gap OPEN so it
        remains visible for review. A healthy, not-latched poller returns `200`
        with `resumed: false` and `reason: "not_latched"` — the call is a safe
        idempotent no-op. Same-key retries replay the cached response.


        The route is organization-independent and does not require the
        `X-Organization-Id` header — the tenant is resolved from the
        authenticated context. In multi-tenant deployments, an inactive tenant
        is rejected with `503`.
      operationId: resumeTEDInPoller
      parameters:
        - $ref: '#/components/parameters/XIdempotencyKey'
      requestBody:
        required: false
        description: >-
          Optional resume options. An empty body re-arms the poller and leaves
          the reconciliation gap open.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TEDInResumeRequest'
            examples:
              rearmOnly:
                summary: Re-arm the poller, leave the gap open
                value: {}
              acknowledgeGap:
                summary: Re-arm and mark the current gap resolved
                value:
                  acknowledge: true
                  note: verified against the JD cabine; no inbound message lost
      responses:
        '200':
          description: >-
            Indicates that the resume attempt completed. `resumed` is `true`
            when a latched or dead poller was re-armed and `false` for the
            healthy no-op. `gapResolved` is `true` only when `acknowledge` was
            requested AND the gap row was successfully marked resolved. `reason`
            is the state resumed from (`receive_state_unknown`, `panic`,
            `auth_failure`) or `not_latched` for the no-op.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TEDInResumeResponse'
              examples:
                resumed:
                  summary: Latched poller re-armed
                  value:
                    resumed: true
                    gapResolved: false
                    reason: receive_state_unknown
                    tenantId: 11111111-1111-1111-1111-111111111111
                notLatched:
                  summary: Healthy no-op
                  value:
                    resumed: false
                    gapResolved: false
                    reason: not_latched
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: >-
            Resume refused. The receive-state-unknown latch has no durable
            reconciliation gap yet, so the poller stays dead. Retry after the
            gap row is persisted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
components:
  parameters:
    XIdempotencyKey:
      name: X-Idempotency
      in: header
      required: true
      description: >-
        Required idempotency key for safe retries. Use a UUID v4 or unique
        business identifier. If the same key is sent again and the original
        request was already processed, the cached response is returned.


        See [Retries and idempotency](/en/reference/retries-idempotency) for
        details.
      schema:
        type: string
        maxLength: 255
      example: 019c96a0-aa10-7abc-d1e2-8c9d0e1f2a3b
  schemas:
    TEDInResumeRequest:
      type: object
      description: >-
        Optional body for a TED IN poller resume. All fields are optional; an
        empty body re-arms the poller and leaves the reconciliation gap open.
      properties:
        acknowledge:
          type: boolean
          default: false
          description: >-
            When `true`, mark the current latch's reconciliation gap resolved
            after the poller is re-armed. Defaults to `false` so the gap stays
            OPEN and remains visible for review.
          example: false
        note:
          type: string
          maxLength: 500
          description: >-
            Operator annotation stamped onto the resolved gap when `acknowledge`
            is `true`. Ignored otherwise.
          example: verified against the JD cabine; no inbound message lost
    TEDInResumeResponse:
      type: object
      required:
        - resumed
        - gapResolved
        - reason
      properties:
        resumed:
          type: boolean
          description: >-
            `true` when a latched or dead poller was re-armed; `false` for the
            healthy no-op.
          example: true
        gapResolved:
          type: boolean
          description: >-
            `true` only when `acknowledge` was requested AND the gap row was
            successfully marked resolved.
          example: false
        reason:
          type: string
          enum:
            - receive_state_unknown
            - panic
            - auth_failure
            - not_latched
          description: >-
            The poller state that was resumed from. `not_latched` indicates the
            idempotent no-op.
          example: receive_state_unknown
        tenantId:
          type: string
          format: uuid
          description: Resolved tenant identifier. Omitted in single-tenant deployments.
          example: 11111111-1111-1111-1111-111111111111
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - service
            - category
            - message
            - requestId
          properties:
            code:
              type: string
              description: >-
                The stable error code. Plugin errors use the `BTF-XXXX` format;
                JD SPB business/auth rejections pass through the raw vendor code
                verbatim (e.g. `AAC90`, `ACE95`, `DVE01`), and transport-level
                JD failures surface the synthetic markers `TRANSPORT` or
                `JD_MISSING_CODE`. Match on this value rather than on the HTTP
                status.
              example: BTF-0010
            service:
              type: string
              description: The service or domain that produced the error.
              example: plugin
            category:
              type: string
              description: Machine-readable error category used for retry decisions.
              enum:
                - deterministic
                - transient
                - rate_limit
                - plugin
              example: deterministic
            message:
              type: string
              description: A human-readable error summary.
              example: >-
                Transfers can only be initiated Monday-Friday between 06:30 and
                17:00 Brasília time
            requestId:
              type: string
              description: The request correlation ID. Present even when empty.
              example: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
            fields:
              type: object
              additionalProperties: true
              description: >-
                Structured validation or retry metadata when available.
                Field-level, header, path, and query validation details are all
                returned here.
              example:
                currentTime: '2026-02-01T18:30:00-03:00'
                operatingHours: Mon-Fri 06:30-17:00 UTC-3
  responses:
    BadRequest:
      description: >-
        Indicates that the request contains invalid input. Check the field
        details for specific validation errors.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalidInput:
              summary: Validation error
              value:
                error:
                  code: BTF-0001
                  service: plugin
                  category: deterministic
                  message: >-
                    The request contains invalid fields. Check the field details
                    below.
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
                  fields:
                    recipientIspb: must be 8 digits
                    amount: must be positive
    Unauthorized:
      description: Indicates that the request is missing a valid authentication token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              summary: Missing authorization
              value:
                error:
                  code: BTF-0401
                  service: plugin
                  category: deterministic
                  message: Missing or invalid authentication token
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
    Forbidden:
      description: >-
        Indicates that the caller is authenticated but lacks permission for this
        operation, or the tenant is not licensed for this endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            notLicensed:
              summary: Tenant not licensed
              value:
                error:
                  code: BTF-0403
                  service: plugin
                  category: deterministic
                  message: Tenant is not licensed to use this endpoint
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
            permissionDenied:
              summary: Caller lacks permission
              value:
                error:
                  code: BTF-0405
                  service: plugin
                  category: deterministic
                  message: Caller lacks permission for this resource
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
    RateLimitExceeded:
      description: >-
        Indicates that the rate limit has been exceeded. Retry after the number
        of seconds specified in the Retry-After header.
      headers:
        Retry-After:
          description: Seconds until rate limit resets
          schema:
            type: integer
            example: 60
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimitExceeded:
              summary: Too many requests
              value:
                error:
                  code: BTF-0429
                  service: plugin
                  category: rate_limit
                  message: >-
                    Too many requests. Retry after the interval indicated by the
                    `Retry-After` header.
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
              description: >
                Rate-limit responses use the dedicated `BTF-0429` code with the
                `rate_limit` category. Clients should back off using the HTTP
                status `429` and the `Retry-After` header.
    InternalServerError:
      description: Indicates that an unexpected internal error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Internal error
              value:
                error:
                  code: BTF-9000
                  service: plugin
                  category: plugin
                  message: Unexpected error while processing the request
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
    ServiceUnavailable:
      description: >-
        Indicates that an external service (CRM, JD SPB, Midaz, or Fees) is
        temporarily unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            crmUnavailable:
              summary: CRM service down
              value:
                error:
                  code: BTF-0502
                  service: crm
                  category: transient
                  message: >-
                    Unable to validate account. The CRM service is temporarily
                    unavailable. Try again later.
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
            jdUnavailable:
              summary: JD SPB unavailable
              value:
                error:
                  code: TRANSPORT
                  service: jd_spb
                  category: transient
                  message: >-
                    Unable to submit transfer. The JD SPB service is temporarily
                    unavailable. Try again later.
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
            midazUnavailable:
              summary: Midaz ledger unavailable
              value:
                error:
                  code: BTF-2000
                  service: midaz
                  category: transient
                  message: >-
                    Unable to process transfer. The Midaz ledger service is
                    temporarily unavailable. Try again later.
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
            feeServiceUnavailable:
              summary: Fee service unavailable (fail-closed mode)
              value:
                error:
                  code: BTF-3000
                  service: fees
                  category: transient
                  message: >-
                    Unable to calculate fee. The fee service is temporarily
                    unavailable. Try again later.
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
            dlqInspectorUnavailable:
              summary: DLQ inspector not configured
              value:
                error:
                  code: BTF-9005
                  service: plugin
                  category: deterministic
                  message: DLQ inspector is not configured
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
    GatewayTimeout:
      description: >-
        Indicates that the upstream operation did not complete before the
        request deadline.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            timeout:
              summary: Drain exceeded deadline
              value:
                error:
                  code: BTF-9000
                  service: plugin
                  category: plugin
                  message: 'trigger ted in poller: request timed out'
                  requestId: 6d3e2a68-1f2b-4c3d-9e4f-5a6b7c8d9e0f
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token authentication. The tenantId is derived from the bearer
        token or authenticated request context and is not supplied through
        X-Organization-Id.
    OAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /v1/login/oauth/access_token
          scopes:
            api: TED transfer API access
    OAuth2Password:
      type: oauth2
      flows:
        password:
          tokenUrl: /v1/login/oauth/access_token
          scopes:
            api: TED transfer API access

````