components:
  schemas:
    AntecipacaoIncluirBody:
      additionalProperties: false
      properties:
        listaCompetencias:
          description: Competências to suspend by early payment, each yyyyMM. Must be non-empty, well-formed and free of duplicates; the rail's own UA additionally refuses any competência that is not strictly greater than its current payroll competência, or that falls outside the contract's programmed discount window.
          examples:
            -   - "202611"
          items:
            pattern: ^[0-9]{6}$
            type: string
          minItems: 1
          type:
            - array
            - "null"
      required:
        - listaCompetencias
      type: object
    AntecipacaoOperationResponse:
      additionalProperties: false
      properties:
        contrato:
          description: The contract number the rail confirmed the operation against.
          examples:
            - "1997123478"
          type: string
        mensagem:
          description: The rail's own message.
          examples:
            - Antecipacao de parcela realizada com sucesso
          type: string
      required:
        - mensagem
        - contrato
      type: object
    AverbacaoDataprevFollowUp:
      additionalProperties: false
      properties:
        bank_action_required:
          description: "True while the follow-up ended and the contract still waits for its documentation: the bank sends the documentation or excludes the contract."
          type: boolean
        ended_at:
          description: "When the follow-up stopped reading the contract: the first read past the documentation due instant plus the configured cap that observed no external change."
          format: date-time
          type:
            - string
            - "null"
        excluido_em:
          description: "dataHoraExclusao of that read: when Dataprev excluded the contract."
          format: date-time
          type:
            - string
            - "null"
        external_change_observed_at:
          description: When the gateway read the contract excluded or ended at Dataprev (situação 2, 3, 15 or 16) outside this gateway. From then on documentation is refused with 409 AVERBACAO_EXCLUDED, the deadline signals stop and the saldo devedor (M015) reports stop.
          format: date-time
          type:
            - string
            - "null"
        last_read_at:
          description: When the gateway last read the contract at Dataprev (Manual 005 §3.2).
          format: date-time
          type: string
        motivo_exclusao:
          description: "motivoExclusao.codigo of that read (Manual 005 §3.2.2: 1 desistência, 2 falecimento, 3 liquidação antecipada, 7 ação judicial, 8 fraude, 9 outros)."
          format: int64
          type:
            - integer
            - "null"
        origem_exclusao:
          description: "origemExclusao.codigo of that read (Manual 005 §3.2.2: 1 APS, 2 banco, 3 sistema, 4 troca de titularidade, 5 portabilidade, 6 reversão de refinanciamento, 7 refinanciamento). 5 and 7 settle the contract, so its last saldo devedor report is 0.00."
          format: int64
          type:
            - integer
            - "null"
        read_error:
          description: "The rail código of the last read Dataprev refused (HY: no loan under the number), or unavailable when the read failed without one. Null when the read named the contract."
          type:
            - string
            - "null"
        situacao_emprestimo:
          description: "situacaoEmprestimo.codigo of the last read that named the contract. Null when that read failed: see read_error."
          format: int64
          type:
            - integer
            - "null"
      required:
        - last_read_at
        - situacao_emprestimo
        - read_error
        - external_change_observed_at
        - origem_exclusao
        - motivo_exclusao
        - excluido_em
        - ended_at
        - bank_action_required
      type: object
    AverbacaoDocumentationClose:
      additionalProperties: false
      properties:
        closed_at:
          description: When the gateway closed the attempt, in UTC.
          format: date-time
          type: string
        code:
          description: The Manual 004 códigos Dataprev refused the documentation with, comma-separated, or unknown when the attempt ended without a verdict (no answer in time, a Dataprev 5xx, an unusable receipt).
          examples:
            - PZ
          type: string
      required:
        - code
        - closed_at
      type: object
    AverbacaoMarginSnapshot:
      additionalProperties: false
      properties:
        as_of:
          description: UTC instant at which the margin snapshot was observed.
          examples:
            - "2026-07-30T11:55:00Z"
          format: date-time
          type: string
        available_margin:
          description: Available payroll margin observed for this booking, as a non-negative decimal string with at most two places; anything else is refused 422 BOOKING_FIELD_INVALID by the averbação route before the rail is called. It must hold installment_amount and not exceed remuneracao_disponivel, else 422 MARGIN_SNAPSHOT_INCONSISTENT.
          examples:
            - "1000.00"
          maxLength: 64
          type: string
        remuneracao_disponivel:
          description: Available remuneration observed with the margin, as a non-negative decimal string with at most two places; anything else is refused 422 BOOKING_FIELD_INVALID by the averbação route before the rail is called. It must be greater than zero, else 422 MARGIN_SNAPSHOT_INCONSISTENT.
          examples:
            - "5000.00"
          maxLength: 64
          type: string
      required:
        - available_margin
        - remuneracao_disponivel
        - as_of
      type: object
    AverbacaoOperationItem:
      additionalProperties: false
      properties:
        attachment_at:
          format: date-time
          type:
            - string
            - "null"
        attachment_invocation_deadline_at:
          format: date-time
          type:
            - string
            - "null"
        attachment_unknown_at:
          format: date-time
          type:
            - string
            - "null"
        averbacao_at:
          format: date-time
          type:
            - string
            - "null"
        averbacao_at_origin:
          description: "Who stamped averbacao_at. dataprev_response: the gateway clock on receiving Dataprev's acceptance, seconds after it. recovery_read: the recovery pass clock when its read proved the acceptance, at or after Dataprev's real acceptance, so the real due instant can be earlier than documentation_due_at. imported: the rail's own instant, declared at import. Null exactly when documentation_due_at is."
          enum:
            - dataprev_response
            - recovery_read
            - imported
            - null
          type:
            - string
            - "null"
        averbacao_invocation_deadline_at:
          format: date-time
          type:
            - string
            - "null"
        averbacao_unknown_at:
          format: date-time
          type:
            - string
            - "null"
        booking_profile:
          description: "Fixed by the averbação. booked: the documentation sends signature_evidence_ref and artifacts.biometrics_documents_pack. rail_only: it sends neither."
          enum:
            - booked
            - rail_only
          type: string
        claimed_at:
          format: date-time
          type: string
        contract_id:
          type: string
        dataprev_follow_up:
          $ref: "#/components/schemas/AverbacaoDataprevFollowUp"
          description: "What the gateway last read at Dataprev (Manual 005) while the contract waited for its documentation: one read a day, from one day after averbacao_at until the follow-up ends or observes the contract excluded or ended. Absent until the first read."
        documentation_due_at:
          description: "When the averbação's documentation is due: averbacao_at plus 7 calendar days (Manual 004 v1.6 §1.1). Null until Dataprev accepted the averbação, and on a refusal. The real due instant can be earlier than this one: see averbacao_at_origin."
          format: date-time
          type:
            - string
            - "null"
        documentation_overdue:
          description: "True while the averbação is attachment_pending and nobody sent its documentation, or is attachment_invoking past attachment_invocation_deadline_at (the call lost its process), exclusion_status is null or rejected under any evidenceSource but m005_observation, the contract has not left the registry (by a refinanciamento or renegociação no reversal undid, a portability exclusion, an exclusion dataprev_follow_up observed at Dataprev, or a termination the Manual 006 report listed), and documentation_due_at has passed. A signal only: the gateway excludes or changes nothing because of it."
          type: boolean
        exclusion_status:
          description: "The exclusion requested through this gateway that describes the contract now, by the rule of GET .../exclusion. Null when none was claimed here; an exclusion made outside the gateway leaves it null and shows in dataprev_follow_up. While the operation is attachment_pending, any value but rejected makes POST .../ccb-attachment answer 409 AVERBACAO_EXCLUDED, and so does a rejected whose GET .../exclusion evidenceSource is m005_observation: that read showed the contract already off the registry."
          enum:
            - claimed
            - invoking
            - confirmed
            - rejected
            - outcome_unknown
            - null
          type:
            - string
            - "null"
        fact_id:
          description: The CloudEvents id of the operation's terminal fact (confirmed or rejected). Null until the operation reaches one. GET /v1/consignado/event-delivery/invalid shows it as event_id, or as id for an outcome an older gateway recorded.
          type:
            - string
            - "null"
        last_documentation_close:
          $ref: "#/components/schemas/AverbacaoDocumentationClose"
          description: "The newest documentation attempt Dataprev did not accept, which returned the contract to attachment_pending. Absent when none closed. A later accepted documentation does not clear it: compare closed_at with attachment_at."
        numero_contrato:
          type: string
        outcome_at:
          format: date-time
          type:
            - string
            - "null"
        response_code:
          description: The rail's return code for the averbação call. Empty until the rail answered.
          type: string
        response_message:
          description: The rail's message for the averbação call. Empty until the rail answered.
          type: string
        status:
          description: "The situation the operation is durably parked in. An attachment_invoking call past attachment_invocation_deadline_at lost its process: the contract takes documentation or an exclusion as in attachment_pending."
          enum:
            - claimed
            - averbacao_invoking
            - averbacao_unknown
            - attachment_pending
            - attachment_invoking
            - attachment_unknown
            - confirmed
            - rejected
          type: string
      required:
        - contract_id
        - numero_contrato
        - status
        - response_code
        - response_message
        - claimed_at
        - averbacao_at
        - attachment_at
        - outcome_at
        - averbacao_unknown_at
        - attachment_unknown_at
        - averbacao_invocation_deadline_at
        - attachment_invocation_deadline_at
        - fact_id
        - booking_profile
        - exclusion_status
        - documentation_due_at
        - averbacao_at_origin
        - documentation_overdue
      type: object
    AverbacaoOperationResponse:
      additionalProperties: false
      properties:
        attachmentAt:
          description: Instant the CCB attachment was recorded, RFC 3339 UTC. ABSENT until the attachment was recorded.
          examples:
            - "2026-07-30T12:00:09Z"
          format: date-time
          type: string
        averbacaoAt:
          description: Instant the rail's averbação response was recorded, RFC 3339 UTC. ABSENT until the rail has answered — absence is a state, not a zero timestamp.
          examples:
            - "2026-07-30T12:00:04Z"
          format: date-time
          type: string
        contractId:
          description: The client's own contract identity, echoed. Empty for a contract a renegociação minted, which has none.
          examples:
            - contract-1
          type: string
        hashOperacao:
          description: The rail's identity for the accepted CCB attachment (hashOperacao, Manual 004 §2.1). Durable, so a replay returns it without touching the rail.
          examples:
            - HASH-1
          type: string
        message:
          description: The rail's own response message.
          examples:
            - averbado
          type: string
        numeroContrato:
          description: The contract number the operation was addressed to.
          examples:
            - 99999999999AN1
          type: string
        responseCode:
          description: The rail's own response code for the averbação.
          examples:
            - AV
          type: string
        status:
          description: Durable operation status. attachment_pending means the averbação was accepted by Dataprev and the contract is waiting for its documentation, sent through POST .../ccb-attachment, also after an earlier one failed at Dataprev; this is a deliberate wait, not a failure. averbacao_unknown means the averbação's outcome at the rail is ambiguous and the operation needs reconciliation — it is not a failure to retry blindly. attachment_unknown is no longer produced.
          enum:
            - claimed
            - averbacao_invoking
            - averbacao_unknown
            - attachment_pending
            - attachment_invoking
            - attachment_unknown
            - confirmed
            - rejected
          examples:
            - confirmed
          type: string
      required:
        - contractId
        - numeroContrato
        - status
      type: object
    AverbacaoOperationsPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/AverbacaoOperationItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
      required:
        - items
        - page
      type: object
    AverbacaoPreparation:
      additionalProperties: false
      properties:
        credit_instrument_id:
          description: The CCB instrument the lender issued from that quote, as a canonical lowercase UUID.
          examples:
            - 7d2e4f6a-8b0c-4e1d-a3f5-6b7c8d9e0f1a
          maxLength: 36
          type: string
        original_ccb_digest_sha256:
          description: Lowercase hex SHA-256 of the original CCB document the lender issued from the quote, as the lender reported it. It is not the signed CCB.
          examples:
            - 3a1e0c5f9b2d4e6a8c7b1f0e2d3c4b5a69788796a5b4c3d2e1f0a9b8c7d6e5f4
          maxLength: 64
          type: string
        quote_id:
          description: The lender quote the contract was prepared from, as a canonical lowercase UUID.
          examples:
            - 0b6b7c1e-2f4a-4d6e-9a1b-3c5d7e9f1a2b
          maxLength: 36
          type: string
      required:
        - quote_id
        - credit_instrument_id
        - original_ccb_digest_sha256
      type: object
    AverbacaoRequestedCommand:
      additionalProperties: false
      properties:
        annual_rate:
          description: valorTaxaAnual as a PERCENT-per-year decimal string. "23.87" is 23.87 %/year — the effective compounding of monthly_rate 1.80.
          examples:
            - "23.87"
          type: string
        cet_annual:
          description: valorCETAnual — Custo Efetivo Total as a PERCENT-per-year decimal string (the effective compounding of cet_monthly).
          examples:
            - "25.34"
          type: string
        cet_monthly:
          description: valorCETMensal — Custo Efetivo Total as a PERCENT-per-month decimal string. Sits above monthly_rate because it absorbs IOF and fees.
          examples:
            - "1.90"
          type: string
        cnpj_operador:
          description: "CNPJ of the operator responsible for the operation — banking correspondent, cooperado or similar (Manual 003 §3.1.1 p.9, Obrigatório NÃO). An absent value is a legitimate \"no intermediary operator\": the adapter drops the field rather than sending an empty string."
          examples:
            - "98765432000188"
          type: string
        codigo_inscricao_empregador:
          description: "Employer inscription TYPE code. Manual 003 §3.1.1 p.10 publishes exactly two: 1 = CNPJ, 2 = CPF. REQUIRED on the wire (Obrigatório Sim, error SG); a value outside the enumeration is refused 422 before the rail is called."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        contract_id:
          description: The CLIENT's own contract identity, echoed back on the response and used to correlate the emitted confirmed/rejected fact. Never minted here. 1..128 bytes of UTF-8 without leading or trailing spaces. With the booking block, one with control characters is refused 422 BOOKING_FIELD_INVALID before the rail is called, and so is one outside those bounds on a contract import.
          examples:
            - contract-1
          type: string
        cpf:
          description: Worker CPF, exactly 11 digits — a CPF is eleven digits by definition (Manual 002 v1.15 §3.1.1 p.8 types the request field Número, 11 algarismos). In the BODY, never a path or query parameter.
          examples:
            - "12345678901"
          pattern: ^[0-9]{11}$
          type: string
        dados_cadastrais:
          $ref: "#/components/schemas/DadosCadastrais"
          description: "Optional worker, employer, origination and disbursement-account record. Part of the semantic digest. Rendered once at averbação and stored with nome_trabalhador; that rendering, not the request bytes, is what the dados-cadastrais route serves and the digest covers. Provisional until the contract confirms: a documentation that sends its own dados_cadastrais replaces this block whole. Never sent to Dataprev. contract.registered carries only the SHA-256 of the final cadastro."
        data_fim_contrato:
          description: Contract end date, RFC 3339 UTC. A value other than data_primeiro_desconto plus (installment_count - 1) months does not block the averbação.
          examples:
            - "2027-07-30T00:00:00Z"
          format: date-time
          type: string
        data_inicio_contrato:
          description: "Contract start date, RFC 3339 UTC. With the booking block, data_fim_contrato, data_primeiro_desconto and expected_disbursement_date must not fall before it, and expected_disbursement_date must be before data_primeiro_desconto, compared as UTC calendar dates: the averbação route refuses that order 422 DECLARED_DATES_OUT_OF_ORDER before the rail is called."
          examples:
            - "2026-07-30T00:00:00Z"
          format: date-time
          type: string
        data_primeiro_desconto:
          description: Date of the first payroll deduction, RFC 3339 UTC; its UTC calendar date is what the rail and the Lerian lender receive. With the booking block, a date that is not a banking business day rolls to the next one, or back to the month's last one when the next falls in another month; the rolled date must be after expected_disbursement_date, or the averbação route refuses it 422 DECLARED_DATES_OUT_OF_ORDER before the rail is called.
          examples:
            - "2026-08-30T00:00:00Z"
          format: date-time
          type: string
        expected_disbursement_date:
          description: Expected loan disbursement date in YYYY-MM-DD. Required for every booking, including originations without numero_proposta. A date outside 2026 to 2099 is refused 422 CONTRACT_NOT_BOOKABLE by the averbação route before the rail is called.
          examples:
            - "2026-08-01"
          maxLength: 10
          type: string
        first_deduction_competencia:
          description: "Payroll competência of the first deduction, yyyyMM. With the booking block, data_primeiro_desconto must fall in this month or a later one: an earlier month is refused 422 FIRST_DEDUCTION_BEFORE_COMPETENCIA by the averbação route before the rail is called."
          examples:
            - "202608"
          type: string
        formalization_deadline:
          description: "UTC deadline by which the accepted contract must complete formalization. The documentation's data_hora_assinatura must not be after it, compared to the second: POST .../ccb-attachment refuses that 422 FORMALIZATION_DEADLINE_EXCEEDED before Dataprev is called."
          examples:
            - "2026-08-02T12:00:00Z"
          format: date-time
          type: string
        fundo_ref:
          description: |-
            OPTIONAL opaque UTF-8 fund reference, bounded to 128 bytes. It is preserved byte-for-byte without trimming, case folding, normalization, parsing, or a local character whitelist. NOT a rail field — the fund has no relationship with the rail, so it never crosses the wire; it is persisted and published unchanged. With the booking block, a value of only spaces is refused 422 BOOKING_FIELD_INVALID by the averbação route before the rail is called.

            VERIFIED against your credential. A fund, or a third party acting for one, may only name the fund its own credential carries: a different value is refused before the rail is called, and an omitted value is filled in from the credential. The comparison is exact bytes, so padding, letter case and accent composition are part of the fund's identity — send the reference exactly as it was issued to you. A bancarizador carries no fund of its own and may name one here; its value is taken as given, unchanged, and a present value must name a fund that still accepts new credit: one the tenant registered in this gateway, or one of the tenant's Lender fund registry, named by its Lender id (the lowercase UUID text of assignment_fund_id).

            OMIT it entirely and the contract is simply not attributed to any fund: nothing is looked up, nothing is refused, and the operation persists no fund at all. Which fund bought the credit is YOUR bookkeeping, not the rail's - the fund has no relationship with Dataprev.
          examples:
            - "  Fundo: Árvore/Classe A — série № 7  "
          maxLength: 128
          type: string
        installment_amount:
          description: valorParcela — the instalment amount (decimal string, BRL).
          examples:
            - "201.75"
          type: string
        installment_count:
          description: totalParcelas — the number of instalments. With the booking block, more than 96 is refused 422 CONTRACT_NOT_BOOKABLE by the averbação route before the rail is called.
          examples:
            - 12
          format: int64
          type: integer
        iof_amount:
          description: valorIOF — the IOF charged (decimal string, BRL).
          examples:
            - "10.00"
          type: string
        liberated_amount:
          description: "valorLiberado — \"o valor líquido repassado ao trabalhador após descontos\" (Manual 003 §3.1.1 p.9, Obrigatório Sim, errors BL/BQ), also required on the winning proposta (Manual 001 §3.1.2 p.10). DISTINCT from principal_amount and NOT derivable from it: the Manual 001 p.13 example quotes valorEmprestimo 2160.00 / valorIOF 10.00 with valorLiberado 2000.00. Never computed here."
          examples:
            - "2000.00"
          type: string
        loan_product_version:
          description: Immutable version of the loan product whose terms governed this contract, as a UUID. A value that is not a UUID, or the nil UUID, is refused 422 BOOKING_FIELD_INVALID by the averbação route before the rail is called. The averbação route also refuses, 422 RATE_OUTSIDE_PRODUCT_RANGE before the rail is called, a monthly_rate that times 12 falls outside the annual rate range the Lender published for this version; a version this gateway has not seen is not checked.
          examples:
            - 0f9d1a7c-3b52-4c8e-9a1d-2f6b8c4e5d70
          maxLength: 128
          type: string
        margin_snapshot:
          $ref: "#/components/schemas/AverbacaoMarginSnapshot"
        matricula:
          description: "The worker's payroll registration at the employer (Texto 1..30, errors OT/SI). REQUIRED on the wire: Manual 004 v1.6 §2.1.2 marks it Obrigatório S on the CCB attach and the attach reuses this one value."
          examples:
            - M-1
          maxLength: 30
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        monthly_rate:
          description: "valorTaxaMensal as a PERCENT-per-month decimal string. \"1.80\" is 1.80 %/month, NOT the fraction 0.018. With the booking block, the four rates must be greater than zero, annual_rate above monthly_rate, cet_annual above cet_monthly, each CET at least its interest rate, and monthly_rate times 12 at most 1000: the averbação route refuses otherwise 422 DECLARED_TERMS_INCONSISTENT before the rail is called."
          examples:
            - "1.80"
          type: string
        nome_trabalhador:
          description: "The worker's full name as it appears on the contract (Texto 1..90, errors AO/OT). REQUIRED: Manual 003 §3.1.1 marks nomeTrabalhador Obrigatório Sim, so a blank name is refused 422 before the rail is called."
          examples:
            - MARIA DA SILVA
          maxLength: 90
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        numero_contrato:
          description: "The rail contract number, minted by the CLIENT: 2 to 15 letters or digits, without spaces, accents or symbols. It MUST equal the numero_contrato path parameter — a mismatch is refused 422 so a caller cannot address one contract and averbar another."
          examples:
            - 99999999999AN1
          maxLength: 15
          minLength: 2
          pattern: ^[A-Za-z0-9]+$
          type: string
        numero_inscricao_empregador:
          description: Employer inscription NUMBER matching codigo_inscricao_empregador (Texto 14 since Manual 004 v1.6, error SH). REQUIRED on the wire.
          examples:
            - "12345678000199"
          type: string
        numero_proposta:
          description: "The optional proposal identifier this gateway minted for the winning bid. Absent means the origination did not pass through this gateway's auction. Present values are matched exactly: leading or trailing whitespace is refused, never normalized into another identity."
          examples:
            - "12345678901234567890"
          maxLength: 20
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        origination_fee_amount:
          description: "OPTIONAL origination fee the client charges on this contract, in BRL as a canonical decimal with exactly two places (\"10.00\", \"0.00\"). Omitted means zero. It must be below principal_amount and is sent only with the booking block. It is the client's definitive declaration: the gateway never derives it from the other terms and it is carried unchanged on consignado.contract.registered. NOT a rail field: it never reaches Dataprev."
          examples:
            - "10.00"
          maxLength: 20
          type: string
        perc_verba_rescisoria_garantia:
          description: Percentage of the rescission verbas pledged as collateral (decimal string, PERCENT). This rides the SEPARATE employer verba-rescisória track, not the FGTS-guarantee execution API.
          examples:
            - "10.00"
          type: string
        preparation:
          $ref: "#/components/schemas/AverbacaoPreparation"
          description: "OPTIONAL references to a preparation the client obtained from the Lerian lender before averbação: the quote, the CCB instrument issued from it and the SHA-256 of that original CCB. All three are required when the object is sent, and it is sent only with the booking block. They are the client's declarations: the gateway checks their shape, never looks them up, and carries them unchanged on consignado.contract.registered. NOT a rail field: it never reaches Dataprev."
        principal_amount:
          description: "valorEmprestimo — the amount lent (decimal string, BRL). DISTINCT from liberated_amount and not derivable from it: the Manual 001 §3.1.2 p.13 example quotes valorEmprestimo 2160.00 / valorIOF 10.00 with valorLiberado 2000.00. With the booking block, principal_amount, liberated_amount and installment_amount must be greater than zero, and neither liberated_amount nor iof_amount may exceed principal_amount: the averbação route refuses otherwise 422 DECLARED_TERMS_INCONSISTENT before the rail is called."
          examples:
            - "2160.00"
          type: string
        tem_garantias:
          description: Whether the contract pledges FGTS collateral. REQUIRED — it is the gate the three collateral values below are conditional on, and false is an authoritative "no collateral" rather than an absence. False with any of them, or true with none, is refused 422 by the averbação route before the rail is called (Dataprev rule FI).
          examples:
            - true
          type: boolean
        valor_multa_rescisoria_garantia_fgts:
          description: Rescission-penalty portion pledged as collateral (decimal string, BRL). Conditional on tem_garantias; omit rather than send 0.
          examples:
            - "400.25"
          type: string
        valor_saldo_disponivel_garantia_fgts:
          description: "Consignable FGTS balance pledged as collateral (decimal string, BRL). Conditional on tem_garantias. OMIT it when there is no FGTS collateral: the rail reads a sent 0 as an invalid guarantee value."
          examples:
            - "1000.50"
          type: string
      required:
        - contract_id
        - numero_contrato
        - cpf
        - principal_amount
        - installment_amount
        - installment_count
        - annual_rate
        - cet_monthly
        - cet_annual
        - iof_amount
        - first_deduction_competencia
        - matricula
        - nome_trabalhador
        - codigo_inscricao_empregador
        - numero_inscricao_empregador
        - data_inicio_contrato
        - data_fim_contrato
        - data_primeiro_desconto
        - monthly_rate
        - liberated_amount
        - tem_garantias
      type: object
    AverbacaoSignedArtifact:
      additionalProperties: false
      properties:
        bytes_base64:
          description: Canonical base64 artifact bytes. The two artifacts remain distinct inputs.
          examples:
            - UEsDBEFDS1BBQ0s=
          maxLength: 8388608
          type: string
        content_type:
          description: Artifact media type.
          examples:
            - application/pdf
          maxLength: 128
          type: string
        file_name:
          description: Original artifact file name.
          examples:
            - contract.pdf
          maxLength: 255
          type: string
      required:
        - file_name
        - content_type
        - bytes_base64
      type: object
    AverbacaoSignedArtifacts:
      additionalProperties: false
      properties:
        biometrics_documents_pack:
          $ref: "#/components/schemas/AverbacaoSignedArtifact"
        signed_ccb:
          $ref: "#/components/schemas/AverbacaoSignedArtifact"
      required:
        - signed_ccb
      type: object
    BidContactRequest:
      additionalProperties: false
      properties:
        contato:
          description: Client-supplied contact value. Type 1 uses <telefone>?text=<URL-encoded text>. The gateway separately injects the tenant portal URL.
          examples:
            - bidder@example.com
          maxLength: 255
          minLength: 1
          type: string
        tipo:
          description: "Optional client contact type: 1 WhatsApp, 2 phone, 3 email, 4 other. Type 0 is server-owned and refused in the body."
          examples:
            - 3
          format: int64
          maximum: 4
          minimum: 1
          type: integer
      required:
        - tipo
        - contato
      type: object
    BidDataprevRefusalExtension:
      additionalProperties: false
      properties:
        code:
          description: Required bounded Dataprev code, comma-joined when the rail listed several; provider free text is never exposed.
          examples:
            - OL
          maxLength: 32
          type: string
        detail:
          description: Bounded client-safe explanation; provider free text is never exposed.
          examples:
            - the rail refused the proposal set
          type: string
        field:
          description: Stable field classification for the Dataprev refusal.
          examples:
            - rail
          type: string
        rule:
          description: Stable gateway classification of the Dataprev refusal.
          examples:
            - DATAPREV_412
          type: string
        source:
          description: Stable Dataprev refusal provenance.
          enum:
            - dataprev
          type: string
      required:
        - source
        - code
        - field
        - rule
        - detail
      type: object
    BidLocalRefusalExtension:
      additionalProperties: false
      properties:
        detail:
          description: Bounded client-safe explanation of the refusal.
          examples:
            - matricula must match the discovered solicitacao
          type: string
        field:
          description: Request field refused by the local rail rule.
          examples:
            - matricula
          type: string
        rule:
          description: Stable local rail-rule identifier.
          examples:
            - MATRICULA_MATCH
          type: string
        source:
          description: Stable local refusal provenance.
          enum:
            - local
          type: string
      required:
        - source
        - field
        - rule
        - detail
      type: object
    BidProposalRequest:
      additionalProperties: false
      properties:
        contatos:
          description: Client contacts, at most one for each client-owned type 1 through 4. Type 0 is server-owned and rejected here. When the tenant has a portal base URL registered the server injects it as type 0; when it does not, at least one contact of type 1 through 4 is required.
          items:
            $ref: "#/components/schemas/BidContactRequest"
          maxItems: 4
          type:
            - array
            - "null"
        dataHoraValidadeProposta:
          description: Proposal validity instant, RFC 3339 UTC.
          examples:
            - "2030-01-01T10:00:00Z"
          format: date-time
          type: string
        numeroParcelas:
          description: Number of instalments, capped by Manual 001 v1.9 §3.1.1.
          examples:
            - 12
          format: int64
          maximum: 96
          minimum: 1
          type: integer
        percVerbaRescisoriaGarantia:
          description: Optional severance-pay percentage pledged as collateral.
          examples:
            - "15.00"
          maxLength: 6
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        temGarantias:
          description: Whether this proposal pledges FGTS collateral.
          examples:
            - true
          type: boolean
        valorCETAnual:
          description: Annual total effective cost in percent.
          examples:
            - "11.00"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorCETMensal:
          description: Monthly total effective cost in percent.
          examples:
            - "0.90"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorEmprestimo:
          description: Principal plus financed costs as an exact decimal string.
          examples:
            - "2160.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorIOF:
          description: IOF amount as an exact decimal string.
          examples:
            - "10.00"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorLiberado:
          description: Amount released to the worker as an exact decimal string.
          examples:
            - "2000.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorMultaRescisoriaGarantiaFgts:
          description: Optional rescission-penalty amount pledged as collateral.
          examples:
            - "300.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorParcela:
          description: Instalment amount as an exact decimal string.
          examples:
            - "180.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorSaldoDisponivelGarantiaFgts:
          description: Optional consignable FGTS balance pledged as collateral.
          examples:
            - "600.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaAnual:
          description: Annual interest rate in percent.
          examples:
            - "10.00"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaMensal:
          description: Monthly interest rate in percent.
          examples:
            - "0.80"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - dataHoraValidadeProposta
        - numeroParcelas
        - valorParcela
        - valorLiberado
        - valorEmprestimo
        - valorIOF
        - valorTaxaAnual
        - valorCETAnual
        - valorTaxaMensal
        - valorCETMensal
        - temGarantias
      type: object
    BidProposalResponse:
      additionalProperties: false
      properties:
        accepted:
          description: True only when the rail's codigo equals BD.
          examples:
            - true
          type: boolean
        codigo:
          description: Bounded per-proposal rail outcome code. The complete trimmed upstream value must match the safe shape; malformed values are suppressed whole, never rewritten into another code. Upstream free text is never returned or persisted.
          examples:
            - BD
          maxLength: 32
          pattern: ^[A-Za-z0-9_-]*$
          type: string
        dataHoraValidadeProposta:
          description: Proposal validity instant echoed by Dataprev.
          examples:
            - "2030-01-01T10:00:00Z"
          format: date-time
          type: string
        numeroProposta:
          description: Server-minted proposal identity echoed by Dataprev.
          examples:
            - 7K9M2P4R6T8V3W5X2Y4Z
          type: string
      required:
        - numeroProposta
        - accepted
        - codigo
        - dataHoraValidadeProposta
      type: object
    BidRefusalError:
      additionalProperties: true
      properties:
        code:
          description: "Stable, machine-readable product error code. One of the enumerated values: the CLT-NNNN catalog codes for the general refusal classes; the named command conflicts, which a client branches on to tell one conflict from another; the four terminal refusals IDEMPOTENCY_STATE_UNRECOGNISED, IDEMPOTENCY_RECORD_UNREADABLE, IDEMPOTENCY_OUTCOME_UNRECORDED and IDEMPOTENCY_REPLAY_UNAVAILABLE (422), which tell the client to reconcile the original request and never retry under a new key; IDEMPOTENCY_KEY_REUSE (422): the key is spent on a different request, so send a new key; the codes a single surface answers, named after it (FUNDO_*, CESSAO_*, REGISTRO_B3_*, ...); and the 5xx codes naming an upstream (DATAPREV_*, STREAMING_HUB_*, TENANT_MANAGER_*, the Access Manager's AUT-0033 and AUT-1021) or an unknown outcome, whose detail is client-readable."
          enum:
            - AUT-0033
            - AUT-1021
            - AVERBACAO_ARTIFACT_CONFLICT
            - AVERBACAO_CLAIM_CONFLICT
            - AVERBACAO_DOCUMENTATION_CONFLICT
            - AVERBACAO_EXCLUDED
            - AVERBACAO_HELD_BY_ANOTHER_SENDER
            - AVERBACAO_NOT_ACCEPTED
            - AVERBACAO_OPERATIONS_INTERNAL
            - AVERBACAO_OPERATIONS_INVALID_CURSOR
            - AVERBACAO_OPERATIONS_INVALID_QUERY
            - AVERBACAO_OPERATIONS_UNKNOWN_STATUS
            - AVERBACAO_OPERATION_NOT_FOUND
            - BID_NO_PROPOSTA_LEFT
            - BID_ORIGINADOR_INACTIVE
            - BID_ORIGINADOR_UNKNOWN
            - BID_PROPOSAL_SLOT_TAKEN
            - BID_SOLICITACAO_TAKEN
            - BID_SOLICITACAO_UNKNOWN
            - BID_SUBMISSIONS_INTERNAL
            - BID_SUBMISSIONS_INVALID_CURSOR
            - BID_SUBMISSIONS_UNKNOWN_SITUATION
            - BOOKING_FIELD_INVALID
            - CEDED_CREDIT_INTERNAL
            - CEDED_CREDIT_NO_FUND_ENTITLEMENT
            - CEDED_CREDIT_UNAVAILABLE
            - CESSAO_CEDED_TO_OTHER_FUND
            - CESSAO_CREDIT_NOT_ACCEPTED
            - CESSAO_CREDIT_NOT_FOUND
            - CESSAO_CREDIT_NOT_WITNESSED
            - CESSAO_CREDIT_PENDING
            - CESSAO_FUNDO_NOT_ATTRIBUTED
            - CESSAO_INTERNAL
            - CESSAO_INVALID_INPUT
            - CESSAO_UNAVAILABLE
            - CESSAO_UNWIRED
            - CLT-0001
            - CLT-0002
            - CLT-0003
            - CLT-0004
            - CLT-0005
            - CLT-0006
            - CLT-0007
            - CLT-0008
            - CLT-0009
            - CLT-0010
            - CLT-0011
            - CONTRACT_ALREADY_REGISTERED
            - CONTRACT_NOT_BOOKABLE
            - CURSOR_EXPIRED
            - CURSOR_FENCE_MISMATCH
            - DATAPREV_CREDENTIAL_REJECTED
            - DATAPREV_CREDENTIAL_REQUIRED
            - DATAPREV_CREDENTIAL_REVOKED
            - DATAPREV_INVALID_RESPONSE
            - DATAPREV_TIMEOUT
            - DATAPREV_UNAVAILABLE
            - DECLARED_DATES_OUT_OF_ORDER
            - DECLARED_TERMS_INCONSISTENT
            - DISBURSEMENT_CONFIRMATIONS_INTERNAL
            - DISBURSEMENT_CONFIRMATIONS_INVALID_CURSOR
            - DISBURSEMENT_PAYMENT_CONFLICT
            - EVENT_DELIVERY_INTERNAL
            - EXCLUSION_AUTHORITY_CONFLICT
            - EXCLUSION_BOOKING_IDENTITY_INCOMPLETE
            - EXCLUSION_DOCUMENTATION_UNDERWAY
            - EXCLUSION_OPERATIONS_INTERNAL
            - EXCLUSION_OPERATIONS_INVALID_CURSOR
            - EXCLUSION_OPERATIONS_INVALID_QUERY
            - EXCLUSION_OPERATIONS_UNKNOWN_STATUS
            - EXCLUSION_OPERATION_NOT_FOUND
            - FGTS_EXECUTION_ALREADY_REFUSED
            - FGTS_EXECUTION_CONTRACT_TAKEN
            - FGTS_EXECUTION_OUTCOME_UNRESOLVED
            - FGTS_EXECUTION_PAYLOAD_MISMATCH
            - FIRST_DEDUCTION_BEFORE_COMPETENCIA
            - FORMALIZATION_DEADLINE_EXCEEDED
            - FUNDO_CNPJ_CONFLICT
            - FUNDO_DEACTIVATED
            - FUNDO_INTERNAL
            - FUNDO_INVALID_ID
            - FUNDO_INVALID_INPUT
            - FUNDO_NOT_FOUND
            - FUNDO_NOT_REGISTERED
            - FUNDO_REF_CONFLICT
            - FUNDO_UNAVAILABLE
            - IDEMPOTENCY_KEY_REUSE
            - IDEMPOTENCY_OUTCOME_UNRECORDED
            - IDEMPOTENCY_RECORD_UNREADABLE
            - IDEMPOTENCY_REPLAY_UNAVAILABLE
            - IDEMPOTENCY_STATE_UNRECOGNISED
            - INVALID_CONTRACT_NUMBER
            - INVALID_CURSOR
            - INVALID_EVENTS_INVALID_CURSOR
            - INVALID_EVENT_NOT_FOUND
            - INVALID_EVENT_NOT_REQUEUEABLE
            - INVALID_PAGE_LIMIT
            - INVENTORY_UNAVAILABLE
            - MARGIN_SNAPSHOT_INCONSISTENT
            - ORIGINADOR_INTERNAL
            - ORIGINADOR_INVALID_ID
            - ORIGINADOR_INVALID_INPUT
            - ORIGINADOR_NOT_FOUND
            - ORIGINADOR_REF_CONFLICT
            - ORIGINADOR_UNAVAILABLE
            - OUTCOME_UNKNOWN
            - PORTABILIDADE_WINDOW_EXPIRED
            - RAIL_COMMANDS_INTERNAL
            - RAIL_COMMANDS_INVALID_CURSOR
            - RAIL_COMMANDS_TENANT_REQUIRED
            - RAIL_COMMANDS_UNKNOWN_FILTER
            - RAIL_COMMAND_ALREADY_REFUSED
            - RAIL_COMMAND_ANSWER_NOT_RETAINED
            - RAIL_COMMAND_CLAIM_CONFLICT
            - RAIL_COMMAND_OUTCOME_UNRESOLVED
            - RAIL_COMMAND_PAYLOAD_MISMATCH
            - RATE_OUTSIDE_PRODUCT_RANGE
            - REGISTRATION_NOT_FOUND
            - REGISTRO_B3_AVERBACAO_NAO_CONFIRMADA
            - REGISTRO_B3_CONTRATO_NAO_ENCONTRADO
            - REGISTRO_B3_DATA_REGISTRO_INVALIDA
            - REGISTRO_B3_INTERNAL
            - REGISTRO_B3_JA_INFORMADO
            - REGISTRO_B3_NAO_INFORMADO
            - REGISTRO_B3_UNAVAILABLE
            - REGISTRO_B3_UNWIRED
            - REPASSE_EXPECTATIONS_INTERNAL
            - REPASSE_EXPECTATIONS_INVALID_CURSOR
            - REPASSE_EXPECTATIONS_UNKNOWN_SITUATION
            - REVERSAO_WINDOW_EXPIRED
            - SALDO_DEVEDOR_INTERNAL
            - SALDO_DEVEDOR_INVALID_CURSOR
            - SALDO_DEVEDOR_NOT_FOUND
            - SALDO_DEVEDOR_TENANT_REQUIRED
            - SALDO_DEVEDOR_UNAVAILABLE
            - STREAMING_HUB_TIMEOUT
            - STREAMING_HUB_UNAVAILABLE
            - TENANT_MANAGER_TIMEOUT
            - TENANT_MANAGER_UNAVAILABLE
            - THROUGHPUT_HISTORY_INTERNAL
            - THROUGHPUT_HISTORY_INVALID_CURSOR
            - THROUGHPUT_HISTORY_TENANT_REQUIRED
            - THROUGHPUT_HISTORY_UNAVAILABLE
            - THROUGH_REQUIRED
            - UNKNOWN_QUERY_PARAMETER
          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
        refusal:
          $ref: "#/components/schemas/BidRefusalExtension"
          description: Exact durable refusal. Local refusals publish source, field, rule, and detail; Dataprev refusals additionally require a bounded code. Provider free text is never published.
        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:
        - refusal
      type: object
    BidRefusalExtension:
      oneOf:
        - $ref: "#/components/schemas/BidLocalRefusalExtension"
        - $ref: "#/components/schemas/BidDataprevRefusalExtension"
    BidRequest:
      additionalProperties: false
      properties:
        matricula:
          description: Employment bond matrícula echoed from the discovered solicitação and checked against its durable snapshot.
          examples:
            - EMP-7K9M2P
          maxLength: 30
          minLength: 1
          type: string
        originadorRef:
          description: "Originador this bid is placed for, as registered under this tenant. Preserved byte for byte: never trimmed, case-folded, or normalized. A bancarizador names one of its own registered originadores here, and the bid then formalizes on that originador's registered portal unless it carries a portalBaseUrl of its own. An originador authenticating with its own credential does not need to send it — the reference is taken from the credential — and if it does send one it must be its own, or the request is refused. Omit it for a bancarizador bidding on its own account."
          examples:
            - originador-a
          maxLength: 128
          minLength: 1
          type: string
        portalBaseUrl:
          description: "Optional formalization portal base URL for this bid alone, for a tenant that originates through several partners and formalizes each bid on that partner's portal. It wins over every registered value: the portal the named originador registered, and the tenant's own. Must be an absolute HTTPS URL with no credentials and no fragment; an invalid value is refused with rule PORTAL_URL and nothing is submitted to the rail. The server still mints the type 0 contact itself, appending id_solicitacao and numero_proposta. Omit it to fall back on the named originador's registered portal, then the tenant's."
          examples:
            - https://partner.example.com/formalizacao
          maxLength: 255
          type: string
        propostas:
          items:
            $ref: "#/components/schemas/BidProposalRequest"
          maxItems: 2
          minItems: 1
          type: array
      required:
        - matricula
        - propostas
      type: object
    BidResponse:
      additionalProperties: false
      properties:
        idSolicitacao:
          description: Dataprev solicitação identifier addressed by the bid.
          examples:
            - "18406"
          type: string
        propostas:
          items:
            $ref: "#/components/schemas/BidProposalResponse"
          type:
            - array
            - "null"
        submittedAt:
          description: UTC instant when the full rail outcome was durably recorded.
          examples:
            - "2026-07-31T12:00:00Z"
          format: date-time
          type: string
      required:
        - idSolicitacao
        - submittedAt
        - propostas
      type: object
    BidSubmissionItem:
      additionalProperties: false
      properties:
        cedido:
          description: Whether a cessão is durably registered for this credit.
          examples:
            - true
          type: boolean
        cedido_at:
          description: When the cessão was registered, in UTC. Null exactly when cedido is false.
          examples:
            - "2026-08-14T10:02:15Z"
          format: date-time
          type:
            - string
            - "null"
        claimed_at:
          description: When the replay claim was written, in UTC.
          examples:
            - "2026-08-14T09:12:33Z"
          format: date-time
          type: string
        fundo_ref:
          description: The fund this credit is ceded to once cedido, otherwise the fund it is attributed to, byte for byte. Null when neither.
          examples:
            - FUNDO-A
          type:
            - string
            - "null"
        id_solicitacao:
          description: The rail's pre-auction solicitação this bid answered. Null for a local refusal recorded before the rail was reached.
          examples:
            - "9876543210"
          type:
            - string
            - "null"
        idempotency_key:
          description: "The credit's own business key: the same idempotency_key the bid was submitted under."
          examples:
            - credit-2026-08-14-000123
          type: string
        originador_ref:
          description: The originador that placed this bid, byte for byte. Null when the bancarizador bid on its own account.
          examples:
            - originador-a
          type:
            - string
            - "null"
        payload_retained:
          description: Whether the request payload is still retained, so an unresolved submission can still be replayed. The payload itself is never published.
          examples:
            - true
          type: boolean
        portal_base_url:
          description: "Formalização portal base URL this bid resolved to: the bid's own, else the named originador's registered one, else the tenant's; absent when no link was minted, which is either a bid that travelled on client contacts alone or a durable refusal row. Published only to the bancarizador's own book: a partner reading its own bids never receives this member."
          examples:
            - https://partner.example.com/formalizacao
          type: string
        retry_lease_expires_at:
          description: The current retry lease horizon, in UTC. An instant already in the past on a retry_in_flight row means the submission is reconducible.
          examples:
            - "2026-08-14T09:13:33Z"
          format: date-time
          type: string
        settled_at:
          description: When the submission reached a terminal outcome, in UTC. Null while it is unsettled.
          examples:
            - "2026-08-14T09:12:41Z"
          format: date-time
          type:
            - string
            - "null"
        situation:
          description: The durable state of this submission, carried verbatim from the money path.
          enum:
            - claimed
            - accepted
            - refused
            - unknown
            - retry_in_flight
          examples:
            - accepted
          type: string
      required:
        - idempotency_key
        - id_solicitacao
        - situation
        - claimed_at
        - settled_at
        - retry_lease_expires_at
        - payload_retained
        - cedido
        - cedido_at
        - fundo_ref
        - originador_ref
      type: object
    BidSubmissionsPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/BidSubmissionItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
      required:
        - items
        - page
      type: object
    CCBAttachmentRequestedCommand:
      additionalProperties: false
      properties:
        artifacts:
          $ref: "#/components/schemas/AverbacaoSignedArtifacts"
        base_biometrica:
          description: Identifier of the government biometric base the facial record was matched against. Required together with score when indicador_validacao_com_doc_oficial is false (§2.1.1, error BK). Manual 004 publishes no enumeration for it, so the value is relayed verbatim.
          examples:
            - SERPRO
          type: string
        dados_cadastrais:
          $ref: "#/components/schemas/DadosCadastrais"
          description: "Optional cadastro block, in the averbação's shape and under its cross-field rules against the averbação's cpf and employer. When sent it replaces the averbação's block WHOLE: a field left out is gone, and an omitted numero_ccb means numero_contrato. nome_trabalhador is not part of it and stays the averbação's, as Dataprev received it with the M003. It belongs to this documentation package and its digest; without it the averbação's cadastro stands. The resulting cadastro is what the dados-cadastrais route serves and what contract.registered names by SHA-256 once the contract confirms. Never sent to Dataprev."
        data_hora_assinatura:
          description: Instant the worker signed the CCB, RFC 3339 UTC (Manual 004 §2.1.2, Obrigatório S, error GA). It may be days after the averbação. With the averbação's booking block, an instant after its formalization_deadline is refused 422 FORMALIZATION_DEADLINE_EXCEEDED and one more than five minutes ahead of the gateway's clock 422 DECLARED_DATES_OUT_OF_ORDER, compared to the second, before Dataprev is called. Rendered to the rail's ddMMyyyyHHmmss by the adapter.
          examples:
            - "2026-07-30T12:00:00Z"
          format: date-time
          type: string
        dispositivo:
          description: Free-text description of the signing device, Texto 1..100 since Manual 004 v1.4 (§2.1.2, Obrigatório N).
          examples:
            - iPhone 15 Pro; iOS 18.4
          type: string
        documento_oficial_com_foto_frente_b64:
          description: Front face of the official photo ID, base64 JPEG. Required together with the verso when indicador_validacao_com_doc_oficial is true; each must decode to a JPEG of at least 250×250 px (§2.1.1, error PY). THE EXAMPLE IS TRUNCATED.
          examples:
            - /9j/4AAQSkZJRgABAQAAAQABAAD/2Q==
          type: string
        documento_oficial_com_foto_verso_b64:
          description: Back face of the official photo ID, base64 JPEG. Same requiredness and same 250×250 px floor as the frente (error PY). THE EXAMPLE IS TRUNCATED.
          examples:
            - /9j/4AAQSkZJRgABAQAAAQABAAD/2Q==
          type: string
        indicador_analfabetismo:
          description: Whether the worker is illiterate (Obrigatório S, error GA). true is the second §2.1.1 biometric exemption.
          examples:
            - false
          type: boolean
        indicador_assinatura_cert_digital_icp_brasil:
          description: Whether the CCB was signed with a qualified ICP-Brasil certificate (Obrigatório S, error GA). true is one of the three §2.1.1 biometric EXEMPTIONS — §6.5 states the qualified signature "substitui a necessidade de biometria facial" — so the biometric fields below may then be omitted.
          examples:
            - true
          type: boolean
        indicador_validacao_com_doc_oficial:
          description: "Selects which §2.1.1 evidence branch applies: false demands the base_biometrica + score pair, true demands both photo-ID faces. false is a DECISION the rail must see and is distinguishable from absent, so send it explicitly rather than omitting it."
          examples:
            - false
          type: boolean
        ip:
          description: The IP the worker signed from, IPv4 or IPv6 (Manual 004 §2.1.2, Obrigatório S, errors GA/GB). The example uses the RFC 5737 documentation range.
          examples:
            - 203.0.113.7
          type: string
        latitude:
          description: Signing latitude as an exact decimal string (§2.1.2, Obrigatório N). Crosses the rail as an unquoted Numérico and never passes through a float.
          examples:
            - "-23.5505"
          type: string
        longitude:
          description: Signing longitude as an exact decimal string (§2.1.2, Obrigatório N).
          examples:
            - "-46.6333"
          type: string
        nsu_contrato:
          description: "Número Sequencial Único of a contract closed through the IF's own attendance network (Manual 004 §2.1.2: Numérico, Tamanho 18, Obrigatório N, error OT). Up to 18 digits — the column is a maximum, and the manual's own example for this field is 98765. Kept as digits end to end. PRESENT means biometrics are exempt AND tipo_autenticacao becomes mandatory (error NS)."
          examples:
            - "1234567890"
          pattern: ^([0-9]{1,18})?$
          type: string
        registro_biometrico_facial_b64:
          description: The 2D facial-biometric record, base64 (Obrigatório N at the rail, but demanded by §2.1.1 for every flow that is NOT biometrics-exempt). THE EXAMPLE IS TRUNCATED — it shows a JPEG's base64 encoding, not a usable record.
          examples:
            - /9j/4AAQSkZJRgABAQAAAQABAAD/2Q==
          type: string
        score:
          description: The biometric match score as an EXACT decimal string, required together with base_biometrica (§2.1.1, error BK). It crosses the rail as an unquoted Numérico published to seven decimals and never passes through a float.
          examples:
            - "0.9999986"
          type: string
        signature_evidence_ref:
          description: Opaque provider evidence reference for the worker signature. Required when the averbação was sent with the booking block, refused 422 when it was sent without it.
          examples:
            - signature-evidence-1
          maxLength: 128
          type: string
        tipo_autenticacao:
          description: Authentication channel used, one of the published codes 1..6 (Manual 004 §2.1.2, error GE). Mandatory whenever nsu_contrato is informed; omit it, or send an empty string, when it is not.
          examples:
            - "1"
          pattern: ^([1-6])?$
          type: string
      required:
        - data_hora_assinatura
        - artifacts
        - ip
        - indicador_assinatura_cert_digital_icp_brasil
        - indicador_analfabetismo
      type: object
    CapabilitiesResponse:
      additionalProperties: false
      properties:
        capabilities:
          items:
            $ref: "#/components/schemas/Capability"
          type: array
      required:
        - capabilities
      type: object
    Capability:
      additionalProperties: false
      properties:
        available:
          description: Whether this deployment composed the family. A console reads THIS to decide whether a control is offered.
          type: boolean
        name:
          description: The operation family. It names the family and never the deployment flag behind it.
          enum:
            - averbacao
            - averbacao_recovery
            - exclusao
            - correcoes
            - desembolso
            - cessao
            - leilao
            - portal
            - trilho
          type: string
        reason:
          description: Which mechanism decided. 'enabled' is the only value that appears beside available true; the other three each name a distinct thing an operator would have to change.
          enum:
            - enabled
            - flag_off
            - portal_store_absent
            - rail_client_absent
          type: string
      required:
        - name
        - available
        - reason
      type: object
    CededCredit:
      additionalProperties: false
      properties:
        cedido_at:
          description: When the cessão was durably registered, in UTC.
          format: date-time
          type: string
        credit_key:
          description: "The auction credit's business key: the same idempotency_key the bid was submitted under. Absent for a contract averbado directly, without a bid."
          type: string
        fundo_ref:
          description: "The fund this credit was ceded to, byte for byte. Always the fund this read was fenced on: the credential's fund on the fund's own route, the fund resolved from the path against the caller's tenant on the bancarizador's route."
          type: string
        id_solicitacao:
          description: The rail's pre-auction solicitação this credit came from. Absent for a contract averbado directly, without a bid.
          type: string
        numero_contrato:
          description: The ceded contract's number.
          type: string
      required:
        - numero_contrato
        - fundo_ref
        - cedido_at
      type: object
    CessaoRegistrationRequest:
      additionalProperties: false
      properties:
        fundo_ref:
          description: "The fund this credit was ceded to. Matched byte for byte against the credit's own attribution — no trim, case fold, or normalization."
          examples:
            - "  Fundo: Árvore/Classe A — série № 7  "
          type: string
        idempotency_key:
          description: The credit's own business key — the SAME idempotency_key the bid was submitted and accepted under. Bounded at 128 CHARACTERS, the same unit the bid submission surface and its database CHECK already use — never bytes, which a multibyte key would reach first.
          examples:
            - idem-bid-2026-08-12-0001
          maxLength: 128
          minLength: 1
          type: string
      required:
        - idempotency_key
        - fundo_ref
      type: object
    CessaoRegistrationResponse:
      additionalProperties: false
      properties:
        cedido:
          description: "Always true on a successful response: cedido is fail-closed, and this operation only ever succeeds by making it true."
          type: boolean
        cedido_at:
          description: When the cessão was durably registered, strict RFC 3339 UTC.
          examples:
            - "2026-08-12T12:00:00Z"
          type: string
        fundo_ref:
          description: The fund this credit is ceded to.
          type: string
      required:
        - fundo_ref
        - cedido
        - cedido_at
      type: object
    ClockResponse:
      additionalProperties: false
      properties:
        now:
          description: The gateway's current instant, RFC 3339 UTC.
          examples:
            - "2026-10-28T18:04:05.123456Z"
          format: date-time
          type: string
      required:
        - now
      type: object
    ConsentAuthorizationBody:
      additionalProperties: false
      properties:
        canalAutorizacaoDigital:
          description: "Digital authorization channel. Published enumeration (Manual 002 §3.1.1 p.9): 1 = ATM, 2 = Agência, 3 = Web Cliente, 4 = Web Correspondente, 5 = Mobile."
          enum:
            - "1"
            - "2"
            - "3"
            - "4"
            - "5"
          examples:
            - "2"
          type: string
        dataHoraAutorizacaoDigital:
          description: Instant the worker authorized, RFC 3339. Rendered to the rail's ddMMyyyyHHmmss by the adapter.
          examples:
            - "2025-05-14T10:00:00Z"
          format: date-time
          type: string
        nsuAutorizacaoDigital:
          description: Unique sequential number of the authorization (Número, up to 19 digits). Kept as digits end to end — 19 digits overflow a signed 64-bit integer at the top of the range.
          examples:
            - "1234567890123456789"
          pattern: ^[0-9]{1,19}$
          type: string
      required:
        - canalAutorizacaoDigital
        - dataHoraAutorizacaoDigital
        - nsuAutorizacaoDigital
      type: object
    ContractCorrectionChainItem:
      additionalProperties: false
      properties:
        content_length:
          description: Size in bytes of the corrected resource.
          examples:
            - 184320
          format: int64
          type: integer
        content_type:
          description: Media type of the corrected resource.
          examples:
            - application/pdf
          type: string
        correction_id:
          description: The gateway's identity for this correction. It is also the published event id.
          examples:
            - 0192f1a0-0000-7000-8000-00000000c010
          type: string
        correction_type:
          description: What this correction corrects.
          enum:
            - ccb
            - disbursement
          examples:
            - disbursement
          type: string
        file_name:
          description: Original file name of the corrected resource.
          examples:
            - comprovante-pagamento.pdf
          type: string
        gateway_received_at:
          description: When the gateway took custody, at second resolution in UTC.
          examples:
            - "2026-08-14T09:12:33Z"
          format: date-time
          type: string
        is_head:
          description: True for the one correction in its chain that nothing supersedes.
          examples:
            - true
          type: boolean
        payment_reference:
          description: The payment this correction repairs. Null on a CCB correction, always present on a disbursement one.
          examples:
            - PIX-2026-08-14-000123
          type:
            - string
            - "null"
        resource_digest_sha256:
          description: Lowercase hex SHA-256 the gateway computed over the corrected bytes.
          examples:
            - 3b1f2c9d5a47e08b6c1d4f2a8e7b0c93d6a51f84b2c7e903a1d5f6b8c2e4079a
          type: string
        resource_uri:
          description: Same-origin relative path serving the corrected resource under M2M bearer auth.
          examples:
            - /v1/consignado/contracts/99999999999AN1/corrections/0192f1a0-0000-7000-8000-00000000c010
          type: string
        source_authority:
          description: Who is authoritative for the corrected value. Always client on this gateway.
          examples:
            - client
          type: string
        supersedes_event_id:
          description: "The event id this correction supersedes: the corrected disbursement confirmation, or the previous correction. Null on a first CCB correction, meaning the original contract fact."
          examples:
            - 0192f1a0-0000-7000-8000-00000000b7de
          type:
            - string
            - "null"
      required:
        - correction_id
        - correction_type
        - payment_reference
        - source_authority
        - resource_uri
        - resource_digest_sha256
        - supersedes_event_id
        - file_name
        - content_type
        - content_length
        - gateway_received_at
        - is_head
      type: object
    ContractCorrectionRequest:
      additionalProperties: false
      properties:
        content_type:
          description: Media type of the corrected resource. Its media type must be application/pdf or application/zip — parameters are permitted — and the bytes are sniffed against it.
          examples:
            - application/pdf
          maxLength: 128
          type: string
        correction_type:
          description: What this correction corrects. Selects which fact is published; the payload shape is identical for both.
          enum:
            - ccb
            - disbursement
          examples:
            - ccb
          type: string
        file_name:
          description: Original file name of the corrected resource.
          examples:
            - ccb-corrigida.pdf
          maxLength: 255
          type: string
        payment_reference:
          description: The payment_reference of the confirmed disbursement this correction repairs. Required when correction_type is disbursement, and must be empty otherwise.
          examples:
            - E32074986202608011200A1B2C3D4E5F
          maxLength: 256
          type: string
        resource_base64:
          description: Canonical base64 of the corrected resource. The gateway computes the SHA-256 itself; no client-declared digest is accepted.
          examples:
            - JVBERi0xLjcKJSVFT0Y=
          maxLength: 8388608
          type: string
      required:
        - content_type
        - correction_type
        - file_name
        - payment_reference
        - resource_base64
      type: object
    ContractCorrectionResponse:
      additionalProperties: false
      properties:
        correction_id:
          description: The gateway's identity for this correction. It is also the published event id.
          examples:
            - 1f5b9c26-6f5a-4f77-9c1c-5d1c0f0a9b21
          type: string
        correction_type:
          description: What was corrected.
          examples:
            - ccb
          type: string
        gateway_received_at:
          description: When the gateway took custody, strict RFC 3339 UTC.
          examples:
            - "2026-08-29T12:00:05Z"
          type: string
        numero_contrato:
          description: The rail contract number, echoed from the path.
          examples:
            - 99999999999AN1
          type: string
        resource_digest_sha256:
          description: Lowercase hex SHA-256 the gateway computed over the corrected bytes.
          examples:
            - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
          type: string
        resource_uri:
          description: Same-origin relative path serving the corrected resource under M2M bearer auth.
          examples:
            - /v1/consignado/contracts/99999999999AN1/corrections/1f5b9c26-6f5a-4f77-9c1c-5d1c0f0a9b21
          type: string
        source_authority:
          description: Who is authoritative for the corrected value. Always client on this gateway.
          examples:
            - client
          type: string
        supersedes_event_id:
          description: "The event id this correction supersedes: the corrected disbursement confirmation, or the previous correction. ABSENT on a first CCB correction, meaning the original contract fact."
          examples:
            - 7c2a1b40-11f4-4a1e-9a44-1f4d7cbb8e02
          type: string
      required:
        - correction_id
        - numero_contrato
        - correction_type
        - source_authority
        - resource_uri
        - resource_digest_sha256
        - gateway_received_at
      type: object
    ContractCorrectionsChain:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/ContractCorrectionChainItem"
          type: array
        truncated:
          description: True when the item ceiling was reached or a chain link points outside this answer, so older corrections were not returned.
          examples:
            - false
          type: boolean
      required:
        - items
        - truncated
      type: object
    ContractImportBooking:
      additionalProperties: false
      properties:
        annual_rate:
          description: valorTaxaAnual as a PERCENT-per-year decimal string. "23.87" is 23.87 %/year — the effective compounding of monthly_rate 1.80.
          examples:
            - "23.87"
          type: string
        artifacts:
          $ref: "#/components/schemas/AverbacaoSignedArtifacts"
        base_biometrica:
          description: Identifier of the government biometric base the facial record was matched against. Required together with score when indicador_validacao_com_doc_oficial is false (§2.1.1, error BK). Manual 004 publishes no enumeration for it, so the value is relayed verbatim.
          examples:
            - SERPRO
          type: string
        cet_annual:
          description: valorCETAnual — Custo Efetivo Total as a PERCENT-per-year decimal string (the effective compounding of cet_monthly).
          examples:
            - "25.34"
          type: string
        cet_monthly:
          description: valorCETMensal — Custo Efetivo Total as a PERCENT-per-month decimal string. Sits above monthly_rate because it absorbs IOF and fees.
          examples:
            - "1.90"
          type: string
        cnpj_operador:
          description: "CNPJ of the operator responsible for the operation — banking correspondent, cooperado or similar (Manual 003 §3.1.1 p.9, Obrigatório NÃO). An absent value is a legitimate \"no intermediary operator\": the adapter drops the field rather than sending an empty string."
          examples:
            - "98765432000188"
          type: string
        codigo_inscricao_empregador:
          description: "Employer inscription TYPE code. Manual 003 §3.1.1 p.10 publishes exactly two: 1 = CNPJ, 2 = CPF. REQUIRED on the wire (Obrigatório Sim, error SG); a value outside the enumeration is refused 422 before the rail is called."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        contract_id:
          description: The CLIENT's own contract identity, echoed back on the response and used to correlate the emitted confirmed/rejected fact. Never minted here. 1..128 bytes of UTF-8 without leading or trailing spaces. With the booking block, one with control characters is refused 422 BOOKING_FIELD_INVALID before the rail is called, and so is one outside those bounds on a contract import.
          examples:
            - contract-1
          type: string
        cpf:
          description: Worker CPF, exactly 11 digits — a CPF is eleven digits by definition (Manual 002 v1.15 §3.1.1 p.8 types the request field Número, 11 algarismos). In the BODY, never a path or query parameter.
          examples:
            - "12345678901"
          pattern: ^[0-9]{11}$
          type: string
        dados_cadastrais:
          $ref: "#/components/schemas/DadosCadastrais"
          description: "Optional worker, employer, origination and disbursement-account record. Part of the semantic digest. Rendered once at averbação and stored with nome_trabalhador; that rendering, not the request bytes, is what the dados-cadastrais route serves and the digest covers. Provisional until the contract confirms: a documentation that sends its own dados_cadastrais replaces this block whole. Never sent to Dataprev. contract.registered carries only the SHA-256 of the final cadastro."
        data_fim_contrato:
          description: Contract end date, RFC 3339 UTC. A value other than data_primeiro_desconto plus (installment_count - 1) months does not block the averbação.
          examples:
            - "2027-07-30T00:00:00Z"
          format: date-time
          type: string
        data_hora_assinatura:
          description: Instant the worker signed the CCB, RFC 3339 UTC (Manual 004 §2.1.2, Obrigatório S, error GA). It may be days after the averbação. With the averbação's booking block, an instant after its formalization_deadline is refused 422 FORMALIZATION_DEADLINE_EXCEEDED and one more than five minutes ahead of the gateway's clock 422 DECLARED_DATES_OUT_OF_ORDER, compared to the second, before Dataprev is called. Rendered to the rail's ddMMyyyyHHmmss by the adapter.
          examples:
            - "2026-07-30T12:00:00Z"
          format: date-time
          type: string
        data_inicio_contrato:
          description: "Contract start date, RFC 3339 UTC. With the booking block, data_fim_contrato, data_primeiro_desconto and expected_disbursement_date must not fall before it, and expected_disbursement_date must be before data_primeiro_desconto, compared as UTC calendar dates: the averbação route refuses that order 422 DECLARED_DATES_OUT_OF_ORDER before the rail is called."
          examples:
            - "2026-07-30T00:00:00Z"
          format: date-time
          type: string
        data_primeiro_desconto:
          description: Date of the first payroll deduction, RFC 3339 UTC; its UTC calendar date is what the rail and the Lerian lender receive. With the booking block, a date that is not a banking business day rolls to the next one, or back to the month's last one when the next falls in another month; the rolled date must be after expected_disbursement_date, or the averbação route refuses it 422 DECLARED_DATES_OUT_OF_ORDER before the rail is called.
          examples:
            - "2026-08-30T00:00:00Z"
          format: date-time
          type: string
        dispositivo:
          description: Free-text description of the signing device, Texto 1..100 since Manual 004 v1.4 (§2.1.2, Obrigatório N).
          examples:
            - iPhone 15 Pro; iOS 18.4
          type: string
        documento_oficial_com_foto_frente_b64:
          description: Front face of the official photo ID, base64 JPEG. Required together with the verso when indicador_validacao_com_doc_oficial is true; each must decode to a JPEG of at least 250×250 px (§2.1.1, error PY). THE EXAMPLE IS TRUNCATED.
          examples:
            - /9j/4AAQSkZJRgABAQAAAQABAAD/2Q==
          type: string
        documento_oficial_com_foto_verso_b64:
          description: Back face of the official photo ID, base64 JPEG. Same requiredness and same 250×250 px floor as the frente (error PY). THE EXAMPLE IS TRUNCATED.
          examples:
            - /9j/4AAQSkZJRgABAQAAAQABAAD/2Q==
          type: string
        expected_disbursement_date:
          description: Expected loan disbursement date in YYYY-MM-DD. Required for every booking, including originations without numero_proposta. A date outside 2026 to 2099 is refused 422 CONTRACT_NOT_BOOKABLE by the averbação route before the rail is called.
          examples:
            - "2026-08-01"
          maxLength: 10
          type: string
        first_deduction_competencia:
          description: "Payroll competência of the first deduction, yyyyMM. With the booking block, data_primeiro_desconto must fall in this month or a later one: an earlier month is refused 422 FIRST_DEDUCTION_BEFORE_COMPETENCIA by the averbação route before the rail is called."
          examples:
            - "202608"
          type: string
        formalization_deadline:
          description: "UTC deadline by which the accepted contract must complete formalization. The documentation's data_hora_assinatura must not be after it, compared to the second: POST .../ccb-attachment refuses that 422 FORMALIZATION_DEADLINE_EXCEEDED before Dataprev is called."
          examples:
            - "2026-08-02T12:00:00Z"
          format: date-time
          type: string
        fundo_ref:
          description: |-
            OPTIONAL opaque UTF-8 fund reference, bounded to 128 bytes. It is preserved byte-for-byte without trimming, case folding, normalization, parsing, or a local character whitelist. NOT a rail field — the fund has no relationship with the rail, so it never crosses the wire; it is persisted and published unchanged. With the booking block, a value of only spaces is refused 422 BOOKING_FIELD_INVALID by the averbação route before the rail is called.

            VERIFIED against your credential. A fund, or a third party acting for one, may only name the fund its own credential carries: a different value is refused before the rail is called, and an omitted value is filled in from the credential. The comparison is exact bytes, so padding, letter case and accent composition are part of the fund's identity — send the reference exactly as it was issued to you. A bancarizador carries no fund of its own and may name one here; its value is taken as given, unchanged, and a present value must name a fund that still accepts new credit: one the tenant registered in this gateway, or one of the tenant's Lender fund registry, named by its Lender id (the lowercase UUID text of assignment_fund_id).

            OMIT it entirely and the contract is simply not attributed to any fund: nothing is looked up, nothing is refused, and the operation persists no fund at all. Which fund bought the credit is YOUR bookkeeping, not the rail's - the fund has no relationship with Dataprev.
          examples:
            - "  Fundo: Árvore/Classe A — série № 7  "
          maxLength: 128
          type: string
        indicador_analfabetismo:
          description: Whether the worker is illiterate (Obrigatório S, error GA). true is the second §2.1.1 biometric exemption.
          examples:
            - false
          type: boolean
        indicador_assinatura_cert_digital_icp_brasil:
          description: Whether the CCB was signed with a qualified ICP-Brasil certificate (Obrigatório S, error GA). true is one of the three §2.1.1 biometric EXEMPTIONS — §6.5 states the qualified signature "substitui a necessidade de biometria facial" — so the biometric fields below may then be omitted.
          examples:
            - true
          type: boolean
        indicador_validacao_com_doc_oficial:
          description: "Selects which §2.1.1 evidence branch applies: false demands the base_biometrica + score pair, true demands both photo-ID faces. false is a DECISION the rail must see and is distinguishable from absent, so send it explicitly rather than omitting it."
          examples:
            - false
          type: boolean
        installment_amount:
          description: valorParcela — the instalment amount (decimal string, BRL).
          examples:
            - "201.75"
          type: string
        installment_count:
          description: totalParcelas — the number of instalments. With the booking block, more than 96 is refused 422 CONTRACT_NOT_BOOKABLE by the averbação route before the rail is called.
          examples:
            - 12
          format: int64
          type: integer
        iof_amount:
          description: valorIOF — the IOF charged (decimal string, BRL).
          examples:
            - "10.00"
          type: string
        ip:
          description: The IP the worker signed from, IPv4 or IPv6 (Manual 004 §2.1.2, Obrigatório S, errors GA/GB). The example uses the RFC 5737 documentation range.
          examples:
            - 203.0.113.7
          type: string
        latitude:
          description: Signing latitude as an exact decimal string (§2.1.2, Obrigatório N). Crosses the rail as an unquoted Numérico and never passes through a float.
          examples:
            - "-23.5505"
          type: string
        liberated_amount:
          description: "valorLiberado — \"o valor líquido repassado ao trabalhador após descontos\" (Manual 003 §3.1.1 p.9, Obrigatório Sim, errors BL/BQ), also required on the winning proposta (Manual 001 §3.1.2 p.10). DISTINCT from principal_amount and NOT derivable from it: the Manual 001 p.13 example quotes valorEmprestimo 2160.00 / valorIOF 10.00 with valorLiberado 2000.00. Never computed here."
          examples:
            - "2000.00"
          type: string
        loan_product_version:
          description: Immutable version of the loan product whose terms governed this contract, as a UUID. A value that is not a UUID, or the nil UUID, is refused 422 BOOKING_FIELD_INVALID by the averbação route before the rail is called. The averbação route also refuses, 422 RATE_OUTSIDE_PRODUCT_RANGE before the rail is called, a monthly_rate that times 12 falls outside the annual rate range the Lender published for this version; a version this gateway has not seen is not checked.
          examples:
            - 0f9d1a7c-3b52-4c8e-9a1d-2f6b8c4e5d70
          maxLength: 128
          type: string
        longitude:
          description: Signing longitude as an exact decimal string (§2.1.2, Obrigatório N).
          examples:
            - "-46.6333"
          type: string
        margin_snapshot:
          $ref: "#/components/schemas/AverbacaoMarginSnapshot"
        matricula:
          description: "The worker's payroll registration at the employer (Texto 1..30, errors OT/SI). REQUIRED on the wire: Manual 004 v1.6 §2.1.2 marks it Obrigatório S on the CCB attach and the attach reuses this one value."
          examples:
            - M-1
          maxLength: 30
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        monthly_rate:
          description: "valorTaxaMensal as a PERCENT-per-month decimal string. \"1.80\" is 1.80 %/month, NOT the fraction 0.018. With the booking block, the four rates must be greater than zero, annual_rate above monthly_rate, cet_annual above cet_monthly, each CET at least its interest rate, and monthly_rate times 12 at most 1000: the averbação route refuses otherwise 422 DECLARED_TERMS_INCONSISTENT before the rail is called."
          examples:
            - "1.80"
          type: string
        nome_trabalhador:
          description: "The worker's full name as it appears on the contract (Texto 1..90, errors AO/OT). REQUIRED: Manual 003 §3.1.1 marks nomeTrabalhador Obrigatório Sim, so a blank name is refused 422 before the rail is called."
          examples:
            - MARIA DA SILVA
          maxLength: 90
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        nsu_contrato:
          description: "Número Sequencial Único of a contract closed through the IF's own attendance network (Manual 004 §2.1.2: Numérico, Tamanho 18, Obrigatório N, error OT). Up to 18 digits — the column is a maximum, and the manual's own example for this field is 98765. Kept as digits end to end. PRESENT means biometrics are exempt AND tipo_autenticacao becomes mandatory (error NS)."
          examples:
            - "1234567890"
          pattern: ^([0-9]{1,18})?$
          type: string
        numero_contrato:
          description: "The rail contract number, minted by the CLIENT: 2 to 15 letters or digits, without spaces, accents or symbols. It MUST equal the numero_contrato path parameter — a mismatch is refused 422 so a caller cannot address one contract and averbar another."
          examples:
            - 99999999999AN1
          maxLength: 15
          minLength: 2
          pattern: ^[A-Za-z0-9]+$
          type: string
        numero_inscricao_empregador:
          description: Employer inscription NUMBER matching codigo_inscricao_empregador (Texto 14 since Manual 004 v1.6, error SH). REQUIRED on the wire.
          examples:
            - "12345678000199"
          type: string
        numero_proposta:
          description: "The optional proposal identifier this gateway minted for the winning bid. Absent means the origination did not pass through this gateway's auction. Present values are matched exactly: leading or trailing whitespace is refused, never normalized into another identity."
          examples:
            - "12345678901234567890"
          maxLength: 20
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        origination_fee_amount:
          description: "OPTIONAL origination fee the client charges on this contract, in BRL as a canonical decimal with exactly two places (\"10.00\", \"0.00\"). Omitted means zero. It must be below principal_amount and is sent only with the booking block. It is the client's definitive declaration: the gateway never derives it from the other terms and it is carried unchanged on consignado.contract.registered. NOT a rail field: it never reaches Dataprev."
          examples:
            - "10.00"
          maxLength: 20
          type: string
        perc_verba_rescisoria_garantia:
          description: Percentage of the rescission verbas pledged as collateral (decimal string, PERCENT). This rides the SEPARATE employer verba-rescisória track, not the FGTS-guarantee execution API.
          examples:
            - "10.00"
          type: string
        preparation:
          $ref: "#/components/schemas/AverbacaoPreparation"
          description: "OPTIONAL references to a preparation the client obtained from the Lerian lender before averbação: the quote, the CCB instrument issued from it and the SHA-256 of that original CCB. All three are required when the object is sent, and it is sent only with the booking block. They are the client's declarations: the gateway checks their shape, never looks them up, and carries them unchanged on consignado.contract.registered. NOT a rail field: it never reaches Dataprev."
        principal_amount:
          description: "valorEmprestimo — the amount lent (decimal string, BRL). DISTINCT from liberated_amount and not derivable from it: the Manual 001 §3.1.2 p.13 example quotes valorEmprestimo 2160.00 / valorIOF 10.00 with valorLiberado 2000.00. With the booking block, principal_amount, liberated_amount and installment_amount must be greater than zero, and neither liberated_amount nor iof_amount may exceed principal_amount: the averbação route refuses otherwise 422 DECLARED_TERMS_INCONSISTENT before the rail is called."
          examples:
            - "2160.00"
          type: string
        registro_biometrico_facial_b64:
          description: The 2D facial-biometric record, base64 (Obrigatório N at the rail, but demanded by §2.1.1 for every flow that is NOT biometrics-exempt). THE EXAMPLE IS TRUNCATED — it shows a JPEG's base64 encoding, not a usable record.
          examples:
            - /9j/4AAQSkZJRgABAQAAAQABAAD/2Q==
          type: string
        score:
          description: The biometric match score as an EXACT decimal string, required together with base_biometrica (§2.1.1, error BK). It crosses the rail as an unquoted Numérico published to seven decimals and never passes through a float.
          examples:
            - "0.9999986"
          type: string
        signature_evidence_ref:
          description: Opaque provider evidence reference for the worker signature. Required when the averbação was sent with the booking block, refused 422 when it was sent without it.
          examples:
            - signature-evidence-1
          maxLength: 128
          type: string
        tem_garantias:
          description: Whether the contract pledges FGTS collateral. REQUIRED — it is the gate the three collateral values below are conditional on, and false is an authoritative "no collateral" rather than an absence. False with any of them, or true with none, is refused 422 by the averbação route before the rail is called (Dataprev rule FI).
          examples:
            - true
          type: boolean
        tipo_autenticacao:
          description: Authentication channel used, one of the published codes 1..6 (Manual 004 §2.1.2, error GE). Mandatory whenever nsu_contrato is informed; omit it, or send an empty string, when it is not.
          examples:
            - "1"
          pattern: ^([1-6])?$
          type: string
        valor_multa_rescisoria_garantia_fgts:
          description: Rescission-penalty portion pledged as collateral (decimal string, BRL). Conditional on tem_garantias; omit rather than send 0.
          examples:
            - "400.25"
          type: string
        valor_saldo_disponivel_garantia_fgts:
          description: "Consignable FGTS balance pledged as collateral (decimal string, BRL). Conditional on tem_garantias. OMIT it when there is no FGTS collateral: the rail reads a sent 0 as an invalid guarantee value."
          examples:
            - "1000.50"
          type: string
      required:
        - contract_id
        - numero_contrato
        - cpf
        - principal_amount
        - installment_amount
        - installment_count
        - annual_rate
        - cet_monthly
        - cet_annual
        - iof_amount
        - first_deduction_competencia
        - matricula
        - nome_trabalhador
        - codigo_inscricao_empregador
        - numero_inscricao_empregador
        - data_inicio_contrato
        - data_fim_contrato
        - data_primeiro_desconto
        - monthly_rate
        - liberated_amount
        - tem_garantias
        - data_hora_assinatura
        - artifacts
        - ip
        - indicador_assinatura_cert_digital_icp_brasil
        - indicador_analfabetismo
      type: object
    ContractImportRegistration:
      additionalProperties: false
      properties:
        averbado_at:
          description: When the rail accepted the averbação, RFC 3339. Must sit within one minute of the contract's aceito_em (dataHoraInclusaoEmprestimo) as the rail read publishes it.
          examples:
            - "2026-09-04T22:34:00Z"
          format: date-time
          type: string
        hash_operacao:
          description: The rail's hashOperacao for the CCB attachment (Manual 004 §2.1).
          examples:
            - "28884503139"
          pattern: ^[0-9]{1,64}$
          type: string
        response_code:
          description: The rail's response code for the averbação.
          examples:
            - BD
          pattern: ^[A-Z0-9]{2,8}$
          type: string
      required:
        - averbado_at
        - response_code
        - hash_operacao
      type: object
    ContractImportRequest:
      additionalProperties: false
      properties:
        booking:
          $ref: "#/components/schemas/ContractImportBooking"
          description: "OPTIONAL. The lender booking of this contract: the body the averbação route takes, with the FULL booking block and an EMPTY numero_proposta, plus the documentation the CCB-attachment route takes — both documents, signature_evidence_ref, data_hora_assinatura and the signature evidence — in one object. Its numero_contrato must equal the path, and its cpf, matricula, codigo_inscricao_empregador and numero_inscricao_empregador must equal what Dataprev publishes for the contract (an employer published as its 8-digit CNPJ root is sent as that root). Its money terms, first_deduction_competencia, contract dates and guarantee must equal the rail read wherever the read publishes them. Nothing in it reaches Dataprev. Requires registration."
        parcelas_pagas:
          default: 0
          description: How many monthly competências of this contract have ALREADY amortized under whoever averbou it. It must lie between 0 and the contract's own total de parcelas as the rail reports it; anything outside that is refused 422. Leave it at 0 only for a contract that has genuinely not been discounted yet. The saldo devedor treats as paid only the parcelas already due on the import day; this count decides when the contract reaches quitado — a value higher than reality ends the reports early, a lower one never reaches quitado, and the full count reports 0.00.
          examples:
            - 7
          format: int64
          minimum: 0
          type: integer
        registration:
          $ref: "#/components/schemas/ContractImportRegistration"
          description: OPTIONAL. The rail's acknowledgement of the averbação somebody else performed, as you received it. Requires booking.
      type: object
    ContractImportResponse:
      additionalProperties: false
      properties:
        competencia_inicio_desconto:
          description: The first payroll competência the discount runs in, as the rail's verbatim AAAAMM literal.
          examples:
            - "202601"
          type: string
        numero_contrato:
          description: The contract that was imported.
          examples:
            - "199971600000"
          type: string
        numero_parcelas:
          description: The contract's total de parcelas, as the rail reports it. Read back, never supplied.
          examples:
            - 24
          format: int64
          type: integer
        origem:
          description: Always "importado" on this route — the provenance stamped on the obligation, distinguishing it forever from one this gateway averbou.
          enum:
            - importado
          examples:
            - importado
          type: string
        parcelas_pagas:
          description: The amortized count recorded on the obligation — the value sent with the request.
          examples:
            - 7
          format: int64
          type: integer
        saldo_devedor_dispatch_scheduled:
          description: "True when this request minted the obligation and scheduled its first M015 saldo devedor report durably alongside it; it does NOT mean the report has been delivered to Dataprev — the outbox does that afterwards. False only on an import with booking whose contract already held an obligation: that obligation was left untouched and parcelas_pagas was not applied."
          examples:
            - true
          type: boolean
        situacao_emprestimo:
          description: The rail's own situação código for the contract at the moment it was imported (Manual 005 §3.2.2 p.17). Only 0, 7, 8 and 17 are importable.
          examples:
            - 0
          format: int64
          type: integer
        valor_parcela:
          description: The instalment, as the rail reports it, verbatim (BRL decimal string).
          examples:
            - "1116.31"
          type: string
      required:
        - numero_contrato
        - origem
        - numero_parcelas
        - valor_parcela
        - competencia_inicio_desconto
        - parcelas_pagas
        - situacao_emprestimo
        - saldo_devedor_dispatch_scheduled
      type: object
    ContratoIdentityBody:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          description: "Employer inscription type: 1 = CNPJ, 2 = CPF."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        cpf:
          description: Worker CPF, exactly 11 digits. In the BODY, never a path or query parameter.
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        matricula:
          examples:
            - 99999999999-A
          minLength: 1
          type: string
        numeroInscricaoEmpregador:
          examples:
            - "42422253000101"
          minLength: 1
          type: string
      required:
        - cpf
        - matricula
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
      type: object
    ContratoOperationResponse:
      additionalProperties: false
      properties:
        hashOperacao:
          description: The rail's own operation identity, surfaced as its exact decimal digits (the rail types it Numérico). Manual 003 publishes no response table for these operations, so it MAY be absent on a 2xx — a 2xx is itself the success signal, do not branch on this field being present.
          examples:
            - "33908101"
          type: string
      type: object
    ContratoTermsBody:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          description: "Employer inscription type: 1 = CNPJ, 2 = CPF."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        competenciaInicioDesconto:
          description: "First deduction competência, yyyyMM. Obrigatório=Não at the rail: omitted, the rail fills it automatically. Relayed verbatim — sending an empty string would be an invalid value rather than an absence, so an omitted field is dropped from the wire."
          examples:
            - "202608"
          type: string
        cpf:
          description: Worker CPF, exactly 11 digits. In the BODY, never a path or query parameter.
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        matricula:
          examples:
            - 99999999999-A
          minLength: 1
          type: string
        nomeTrabalhador:
          examples:
            - Trabalhador 99999999999
          minLength: 1
          type: string
        numeroInscricaoEmpregador:
          examples:
            - "42422253000101"
          minLength: 1
          type: string
        numeroParcelas:
          description: Number of instalments.
          examples:
            - 11
          format: int64
          minimum: 1
          type: integer
        valorParcela:
          description: Instalment amount (decimal string, BRL, at most 2 decimals). A decimal string end to end — a money field never becomes a binary float on the way to the rail.
          examples:
            - "444.96"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - nomeTrabalhador
        - numeroParcelas
        - valorParcela
        - cpf
        - matricula
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
      type: object
    CreateFundoRequest:
      additionalProperties: false
      properties:
        cnpj:
          description: "OPTIONAL. The fund's CNPJ, the key the lender names this fund by when it cedes a contract to it. Numeric or alphanumeric (IN RFB 2.229/2024): twelve letters or digits and two check digits, accepted with or without the mask (12.ABC.345/01DE-35 or 12ABC34501DE35) and stored unmasked and uppercase; anything else is refused. Unique per tenant. Check digits are not verified."
          examples:
            - 12ABC34501DE35
          maxLength: 18
          type: string
        endereco_entrega_cotacao:
          description: Delivery address for the quote-request package. Stored and returned; the gateway does not use it.
          type: string
        fundo_ref:
          description: "The fund's opaque business key, preserved byte for byte: no trim, case fold, or normalization. It is the SAME value the averbação's own fundo_ref must match exactly."
          type: string
        template_ccb:
          description: The fund's CCB template reference. Stored and returned; the gateway does not use it.
          type: string
      required:
        - fundo_ref
        - endereco_entrega_cotacao
        - template_ccb
      type: object
    CreateOriginadorRequest:
      additionalProperties: false
      properties:
        originadorRef:
          description: "The originator's opaque business key, preserved byte for byte: no trim, case fold, or normalization. 1 to 128 bytes."
          type: string
        portalBaseUrl:
          description: "Optional default formalization portal base URL for this originator. Since the URL travels on each bid, registering one here is not required: it only answers for bids this originator places that carry no portalBaseUrl of their own, and a bid that carries one always wins. Omit it, or send it empty, to register no portal at all. A value that IS sent must be an absolute HTTPS URL with no credentials and no fragment, at most 255 bytes — the same shape rule as the tenant's own custodied portal."
          maxLength: 255
          type: string
      required:
        - originadorRef
      type: object
    CreateRequest:
      additionalProperties: false
      properties:
        endpoint:
          type: string
        event_majors:
          additionalProperties:
            format: int64
            type: integer
          description: Per-event-type schema major, overriding schema_major for the types it names.
          examples:
            - loan_application.disbursed: 2
          type: object
        event_types:
          items:
            type: string
          type:
            - array
            - "null"
        name:
          type: string
        plan_tier:
          type: string
        schema_major:
          format: int64
          type: integer
        sink_kind:
          type: string
      required:
        - name
        - sink_kind
        - endpoint
      type: object
    CreateResponse:
      additionalProperties: false
      properties:
        signingSecret:
          type: string
        subscription:
          $ref: "#/components/schemas/Subscription"
      required:
        - subscription
        - signingSecret
      type: object
    CredentialStatusResponse:
      additionalProperties: false
      properties:
        certFingerprint:
          description: SHA-256 hex fingerprint of the stored certificate (absent when none).
          examples:
            - 3b1f...c0
          type: string
        certNotAfter:
          description: RFC 3339 cert expiry (UTC); absent when no cert is stored.
          examples:
            - "2027-01-01T00:00:00Z"
          format: date-time
          type: string
        certPresent:
          description: Whether a client certificate is stored for the tenant.
          type: boolean
        codigoSolicitante:
          description: "Dataprev codigoSolicitante: the institution's BACEN COMPE code (3 digits, zero-padded, 001-999). Public, non-secret; absent when none is stored."
          examples:
            - "341"
          type: string
        oauthPresent:
          description: Whether OAuth2 client_credentials are stored for the tenant.
          type: boolean
        portalBaseUrl:
          description: Base URL of the tenant's worker portal. Public, non-secret; absent when none is stored.
          examples:
            - https://portal.example.com/formalizacao
          type: string
        provider:
          description: External rail the credentials belong to.
          examples:
            - dataprev
          type: string
        revokedAt:
          description: Credential revocation timestamp (RFC 3339, UTC); absent when credentials were never revoked.
          examples:
            - "2026-07-14T15:30:00Z"
          format: date-time
          type: string
        updatedAt:
          description: Last-update timestamp (RFC 3339, UTC).
          examples:
            - "2026-06-23T12:00:00Z"
          format: date-time
          type: string
      required:
        - provider
        - certPresent
        - oauthPresent
        - updatedAt
      type: object
    DadosCadastrais:
      additionalProperties: false
      properties:
        dados_bancarios:
          $ref: "#/components/schemas/DadosCadastraisBancarios"
          description: "The worker's own disbursement account. When present it carries at least one complete set: banco + agencia + conta, or chave_pix + tipo_chave_pix."
        empregador:
          $ref: "#/components/schemas/DadosCadastraisEmpregador"
          description: Employer record. Required when the averbação's codigo_inscricao_empregador is 1 (CNPJ), refused when it is 2 (a person employer). The CNPJ is numero_inscricao_empregador and is not repeated here.
        originacao:
          $ref: "#/components/schemas/DadosCadastraisOriginacao"
        trabalhador:
          $ref: "#/components/schemas/DadosCadastraisTrabalhador"
      required:
        - trabalhador
        - originacao
      type: object
    DadosCadastraisBancarios:
      additionalProperties: false
      properties:
        agencia:
          description: Branch, without check digit.
          examples:
            - "1234"
          pattern: ^[0-9]{1,5}$
          type: string
        banco:
          description: COMPE bank code.
          examples:
            - "341"
          pattern: ^[0-9]{3}$
          type: string
        chave_pix:
          description: Pix key. A CPF key must equal the averbação's cpf; a TELEFONE key is E.164.
          examples:
            - "12345678901"
          maxLength: 77
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        conta:
          description: Account, without check digit.
          examples:
            - "56789"
          pattern: ^[0-9]{1,20}$
          type: string
        conta_digito:
          description: Account check digit.
          examples:
            - "0"
          pattern: ^[0-9X]{1,2}$
          type: string
        tipo_chave_pix:
          description: Pix key kind.
          enum:
            - CPF
            - EMAIL
            - TELEFONE
            - EVP
          examples:
            - CPF
          type: string
        tipo_conta:
          description: Account kind; absent means CORRENTE to the destination.
          enum:
            - CORRENTE
            - POUPANCA
            - PAGAMENTO
          examples:
            - CORRENTE
          type: string
      type: object
    DadosCadastraisDocument:
      additionalProperties: false
      properties:
        dados_cadastrais:
          $ref: "#/components/schemas/DadosCadastrais"
          description: "The client's cadastro block: the documentation's when it sent one, else the averbação's; absent when neither carried one."
        nome_trabalhador:
          description: The worker's name, as sent on the averbação.
          type: string
      required:
        - nome_trabalhador
      type: object
    DadosCadastraisEmpregador:
      additionalProperties: false
      properties:
        cnae_principal:
          description: Main CNAE code.
          examples:
            - "4743100"
          pattern: ^[0-9]{7}$
          type: string
        cnae_principal_descricao:
          description: Official CNAE description.
          examples:
            - Comércio varejista de vidros
          maxLength: 178
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        data_inicio_atividade:
          description: Activity start date, YYYY-MM-DD.
          examples:
            - "2013-04-01"
          format: date
          type: string
        endereco:
          $ref: "#/components/schemas/DadosCadastraisEnderecoEmpregador"
        natureza_juridica:
          description: CONCLA legal-nature code.
          examples:
            - "2062"
          pattern: ^[0-9]{4}$
          type: string
        natureza_juridica_descricao:
          description: Official CONCLA description.
          examples:
            - Sociedade Empresária Limitada
          maxLength: 150
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        nome_fantasia:
          description: Trade name; when Receita has none, repeat razao_social and set nome_fantasia_ausente.
          examples:
            - Vidraçaria Exemplo
          maxLength: 150
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        nome_fantasia_ausente:
          description: True when nome_fantasia repeats razao_social because Receita has no trade name.
          examples:
            - false
          type: boolean
        opcao_mei:
          description: Whether the employer opted into MEI.
          examples:
            - false
          type: boolean
        porte_receita:
          description: Receita company-size code.
          enum:
            - "00"
            - "01"
            - "03"
            - "05"
          examples:
            - "01"
          type: string
        qtd_empregados_clt:
          description: CLT headcount.
          examples:
            - 187
          format: int64
          minimum: 0
          type: integer
        razao_social:
          description: Legal name.
          examples:
            - VIDRACARIA EXEMPLO LTDA
          maxLength: 150
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
      required:
        - razao_social
        - nome_fantasia
        - data_inicio_atividade
        - natureza_juridica
        - natureza_juridica_descricao
      type: object
    DadosCadastraisEndereco:
      additionalProperties: false
      properties:
        bairro:
          description: District.
          examples:
            - Laranjeiras
          maxLength: 100
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        cep:
          description: Postal code, eight digits, no hyphen.
          examples:
            - "22240003"
          pattern: ^[0-9]{8}$
          type: string
        cidade:
          description: City.
          examples:
            - Rio de Janeiro
          maxLength: 100
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        complemento:
          description: Address complement.
          examples:
            - apto 41
          maxLength: 100
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        logradouro:
          description: Street.
          examples:
            - Rua das Laranjeiras
          maxLength: 150
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        numero:
          description: Street number; S/N is valid.
          examples:
            - "120"
          maxLength: 20
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        uf:
          description: State.
          examples:
            - RJ
          pattern: ^[A-Z]{2}$
          type: string
      required:
        - logradouro
        - numero
        - bairro
        - cidade
        - uf
        - cep
      type: object
    DadosCadastraisEnderecoEmpregador:
      additionalProperties: false
      properties:
        bairro:
          description: District.
          examples:
            - Centro
          maxLength: 100
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        cep:
          description: Postal code, eight digits, no hyphen.
          examples:
            - "20040020"
          pattern: ^[0-9]{8}$
          type: string
        complemento:
          description: Address complement.
          examples:
            - sala 5
          maxLength: 100
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        logradouro:
          description: Street.
          examples:
            - Avenida Rio Branco
          maxLength: 150
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        municipio:
          description: Official municipality name.
          examples:
            - Rio de Janeiro
          maxLength: 100
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        municipio_ibge:
          description: IBGE municipality code.
          examples:
            - "3304557"
          pattern: ^[0-9]{7}$
          type: string
        numero:
          description: Street number.
          examples:
            - "1"
          maxLength: 20
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        uf:
          description: State.
          examples:
            - RJ
          pattern: ^[A-Z]{2}$
          type: string
      required:
        - cep
        - logradouro
        - numero
        - bairro
        - municipio_ibge
        - municipio
        - uf
      type: object
    DadosCadastraisOriginacao:
      additionalProperties: false
      properties:
        autorizacao_consulta_scr:
          description: Whether the worker authorized an SCR (BACEN credit registry) inquiry.
          examples:
            - true
          type: boolean
        data_solicitacao:
          description: Request date, YYYY-MM-DD.
          examples:
            - "2026-09-04"
          format: date
          type: string
        id_contrato_interno:
          description: The client's internal contract identifier.
          examples:
            - WNG-2026-31892162
          maxLength: 64
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        id_decisao_credito:
          description: Stable identifier of the credit decision that approved the contract.
          examples:
            - CAI-DEC-2026-09-04-7f3a19
          maxLength: 64
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        lote_id:
          description: Stable batch identifier, unique per batch.
          examples:
            - CAI-2026-09-17-001
          pattern: ^[A-Za-z0-9_.-]{1,64}$
          type: string
        numero_ccb:
          description: CCB number; absent means equal to numero_contrato.
          examples:
            - DIDI2090
          maxLength: 30
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        referencias_externas:
          description: Identifiers owned by third-party systems.
          items:
            $ref: "#/components/schemas/DadosCadastraisReferenciaExterna"
          maxItems: 10
          type:
            - array
            - "null"
      required:
        - lote_id
        - id_contrato_interno
        - id_decisao_credito
      type: object
    DadosCadastraisRG:
      additionalProperties: false
      properties:
        data_emissao:
          description: Issue date, YYYY-MM-DD.
          examples:
            - "2010-03-15"
          format: date
          type: string
        numero:
          description: RG number.
          examples:
            - "12345678"
          maxLength: 20
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        orgao_emissor:
          description: Issuing body.
          examples:
            - DETRAN
          maxLength: 20
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        uf_emissor:
          description: Issuing state.
          examples:
            - RJ
          pattern: ^[A-Z]{2}$
          type: string
      required:
        - numero
        - orgao_emissor
        - uf_emissor
      type: object
    DadosCadastraisReferenciaExterna:
      additionalProperties: false
      properties:
        sistema:
          description: Owning system.
          examples:
            - REGISTRADORA_X
          pattern: ^[A-Z0-9_]{1,32}$
          type: string
        tipo:
          description: Identifier kind.
          examples:
            - ipoc
          maxLength: 64
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        valor:
          description: Identifier value.
          examples:
            - IPOC-000123
          maxLength: 128
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
      required:
        - sistema
        - tipo
        - valor
      type: object
    DadosCadastraisTrabalhador:
      additionalProperties: false
      properties:
        categoria_esocial:
          description: eSocial worker category.
          examples:
            - "101"
          pattern: ^[0-9]{3}$
          type: string
        cbo:
          description: CBO occupation code.
          examples:
            - "354815"
          pattern: ^[0-9]{6}$
          type: string
        cbo_descricao:
          description: Official CBO description.
          examples:
            - Agente de viagem
          maxLength: 150
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        data_admissao:
          description: Admission date, YYYY-MM-DD.
          examples:
            - "2024-06-10"
          format: date
          type: string
        data_nascimento:
          description: Birth date, YYYY-MM-DD.
          examples:
            - "1970-09-04"
          format: date
          type: string
        email:
          description: E-mail address.
          examples:
            - fulano.de.tal@example.com
          format: email
          maxLength: 254
          type: string
        endereco:
          $ref: "#/components/schemas/DadosCadastraisEndereco"
        estado_civil:
          description: Marital status.
          enum:
            - SOLTEIRO
            - CASADO
            - DIVORCIADO
            - VIUVO
            - UNIAO_ESTAVEL
            - SEPARADO
          examples:
            - SOLTEIRO
          type: string
        nome_mae:
          description: Mother's name.
          examples:
            - Beltrana de Tal
          maxLength: 150
          minLength: 1
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        renda_base:
          description: Base income, BRL decimal string with at most two places.
          examples:
            - "2201.17"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        rg:
          $ref: "#/components/schemas/DadosCadastraisRG"
        sexo:
          description: Sex.
          enum:
            - M
            - F
          examples:
            - M
          type: string
        telefone_celular:
          description: Mobile phone with area code, digits only.
          examples:
            - "21900000000"
          pattern: ^[0-9]{10,11}$
          type: string
        vinculo_ativo:
          description: Whether the employment relationship is active.
          examples:
            - true
          type: boolean
      required:
        - data_nascimento
        - nome_mae
        - sexo
        - estado_civil
        - renda_base
        - cbo
        - vinculo_ativo
        - endereco
      type: object
    DataprevCodigoDescricao:
      additionalProperties: false
      properties:
        codigo:
          description: The rail's code, relayed verbatim.
          examples:
            - 1
          format: int64
          type: integer
        descricao:
          description: The rail's own label for the code, relayed verbatim so an unmapped code stays diagnosable.
          examples:
            - CNPJ
          type: string
      required:
        - codigo
        - descricao
      type: object
    DataprevCodigoDescricaoResponse:
      additionalProperties: false
      properties:
        codigo:
          examples:
            - 1
          format: int64
          type: integer
        descricao:
          examples:
            - CNPJ
          type: string
      required:
        - codigo
        - descricao
      type: object
    DataprevConsultarEmprestimoResponse:
      additionalProperties: false
      properties:
        aceito_em:
          description: dataHoraInclusaoEmprestimo — the instant the rail recorded the loan, RFC 3339 UTC. The rail publishes it as a ddMMyyyyHHmmss Texto (the Manual 005 example sends "18022026152224").
          examples:
            - "2026-02-18T15:22:24Z"
          format: date-time
          type: string
        atualizado_em:
          description: dataHoraAtualizacao — when the rail last changed this contract (RFC 3339 UTC).
          examples:
            - "2026-02-18T15:22:24Z"
          format: date-time
          type: string
        cetAnual:
          description: valorCetAnual — Custo Efetivo Total as a PERCENT-per-year decimal string (the effective compounding of cet_mensal).
          examples:
            - "25.34"
          type: string
        cet_mensal:
          description: "valorCetMensal — Custo Efetivo Total as a PERCENT-per-month decimal string. NOTE the rail's casing: the RESPONSE spells it valorCetMensal while the inclusão REQUEST spells it valorCETMensal."
          examples:
            - "1.90"
          type: string
        cnpj_empregador_completo:
          description: "The rail's cnpjEmpregadorCompleto flag, relayed verbatim. UNVERIFIABLE-UNTIL-HOMOLOG: the source pins its form (Booleano) and not its meaning, so it is passed through and NOT interpreted. Absent means the rail sent no flag — never read absence as false."
          examples:
            - true
          type: boolean
        cnpj_operador:
          description: The operator CNPJ the rail holds for this contract (Texto 14; the Manual 005 example sends "31061847000100").
          examples:
            - "31061847000100"
          type: string
        codigo_inscricao_empregador:
          description: "The employer-inscription TYPE code as decimal digits (Manual 005 §3.2.2 p.16: \"1\" CNPJ, \"2\" CPF) — the same shape the averbação write carries it in, so it can be persisted or re-sent without reshaping. Empty means the rail published no readable pair; it never means code 0."
          examples:
            - "1"
          type: string
        competencia_fim_desconto:
          description: Last payroll competência the discount runs in, as the rail's verbatim AAAAMM literal.
          examples:
            - "202609"
          type: string
        competencia_inicio_desconto:
          description: First payroll competência the discount runs in, as the rail's verbatim AAAAMM literal — never reparsed into a date.
          examples:
            - "202601"
          type: string
        contrato:
          description: The contract number the loan was averbado under (rail field contrato, Texto).
          examples:
            - "199971600000"
          type: string
        cpf:
          description: The worker the contract belongs to, 11 digits. The rail publishes it as a Número (the Manual 005 example sends 99971699990), so the adapter restores any digit JSON dropped.
          examples:
            - "99971699990"
          type: string
        data_fim_contrato:
          description: Last day of the contract (RFC 3339 UTC). Absent when the rail omitted it.
          examples:
            - "2027-01-20T00:00:00Z"
          format: date-time
          type: string
        data_inicio_contrato:
          description: First day of the contract (RFC 3339 UTC). Absent when the rail omitted it.
          examples:
            - "2026-02-20T00:00:00Z"
          format: date-time
          type: string
        data_primeiro_desconto:
          description: Date of the first payroll discount (RFC 3339 UTC). Absent when the rail omitted it.
          examples:
            - "2026-01-20T00:00:00Z"
          format: date-time
          type: string
        excluido_em:
          description: dataHoraExclusao — when the contract was excluded (RFC 3339 UTC). Absent on a contract that was not excluded.
          examples:
            - "2026-03-01T09:00:00Z"
          format: date-time
          type: string
        garantia:
          $ref: "#/components/schemas/DataprevSolicitacaoGarantia"
        garantia_present:
          description: "Whether the 2xx actually carried a garantia block, under EITHER the singular or plural rail key. Gate on THIS, never on garantia.tem_garantias: temGarantias=false is an authoritative \"this averbado contract has NO collateral\" and is indistinguishable from the zero value of an absent block."
          examples:
            - true
          type: boolean
        if_concessora:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: The institution that granted the loan, code and the rail's own label. Absent when the rail sent no pair.
        info_contrato_enviada_em:
          description: dataHoraEnvioInfoContrato — when the contract information was sent to the rail (RFC 3339 UTC).
          examples:
            - "2026-02-19T08:30:00Z"
          format: date-time
          type: string
        inscricao_empregador:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: "Which kind of identity numero_inscricao_empregador is (Manual 005 §3.2.2 p.16: 1 CNPJ, 2 CPF), code and the rail's own label. Absent when the rail sent no pair."
        matricula:
          description: The worker's payroll registration at the employer (Texto). The rail DOES publish it on this read — row 1 of the Manual 005 p.15 field table, and the §3.2.3.2 example sends "MATCEN716".
          examples:
            - MATCEN716
          type: string
        motivo_exclusao:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: "Why the contract was excluded (Manual 005 §3.2.2 p.17: 1 desistência do empréstimo, 2 falecimento, 3 liquidação antecipada, 7 ação judicial, 8 exclusão por fraude, 9 outros). Absent on a contract that was not excluded."
        nome_empregador:
          description: The employer's name as the rail holds it (Texto).
          examples:
            - EMPREGADOR TESTE LTDA
          type: string
        nome_trabalhador:
          description: The worker's name as the rail holds it (Texto).
          examples:
            - Teste Homo_716999
          type: string
        numero_inscricao_empregador:
          description: The employer inscription the contract belongs to (Texto — CNPJ, CEI or CAEPF).
          examples:
            - "42422253000101"
          type: string
        numero_proposta:
          description: "The read's numeroProposta (Manual 005 §3.2.2 p.15, Texto): the proposta that owns this contract. The win classification compares it against the one you minted."
          examples:
            - "12345678901234567890"
          type: string
        origem_averbacao:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: "How the contract came to be averbado (Manual 005 §3.2.2 p.16: 0 Averbação banco, 1 troca de titularidade, 2 portabilidade, 3 refinanciamento, 4 reversão de refinanciamento, 5 renegociação, 6 renegociação de legado, 7 tombamento compulsório). Code 0 is LIVE: absence is the absent pair, never a zero."
        origem_exclusao:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: "Who excluded the contract (Manual 005 §3.2.2 p.16: 1 APS, 2 Banco, 3 Sistema, 4 troca de titularidade, 5 portabilidade, 6 reversão de refinanciamento, 7 refinanciamento). Absent on a contract that was not excluded."
        outcome:
          description: "The adapter-derived win classification, never a fabricated win. It compares numero_proposta against the proposal you supplied: won means the rail's contract belongs to YOUR proposta, lost means it belongs to another, pending means the classification has no subject (you omitted numero_proposta) or the rail's situação was absent. The rail's own verdict is always in situacao_emprestimo / situacao_descricao."
          enum:
            - pending
            - won
            - lost
          examples:
            - won
          type: string
        portabilidade_codigo_origem:
          description: "informacoesPortabilidade.codigoOrigem — the institution the contract was ported FROM, as the rail's verbatim literal. Never re-parsed as a number: an institution code with a leading zero does not survive that."
          examples:
            - "237"
          type: string
        portabilidade_codigo_proponente:
          description: informacoesPortabilidade.codigoProponente — the institution that proposed the portability, verbatim.
          examples:
            - "999"
          type: string
        portabilidade_numero_unico_averbacao:
          description: informacoesPortabilidade.numeroUnicoAverbacao — the rail-minted identifier of the portability averbação. Relayed, never parsed.
          examples:
            - "20260731000000123"
          type: string
        portabilidade_numero_unico_exclusao:
          description: informacoesPortabilidade.numeroUnicoExclusao — the rail-minted identifier of the exclusion that closed the origin contract. Relayed, never parsed.
          examples:
            - "20260731000000456"
          type: string
        portabilidade_situacao:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: informacoesPortabilidade.situacao — the state of the portability itself, code and label verbatim from the rail. Absent when the contract has no portability history; the code is never synthesised.
        portabilidade_valor_pago:
          description: informacoesPortabilidade.valorPago — the amount paid to settle the origin contract (decimal string, BRL). Empty means the rail sent nothing; it never means zero.
          examples:
            - "12500.00"
          type: string
        proposal_ref:
          description: The handoff's dedupe key, sourced from the read's numeroProposta — the identifier THIS gateway minted and the rail echoes. There is no propostaRef key on this rail.
          examples:
            - "12345678901234567890"
          type: string
        qtd_escrituracoes:
          description: The rail's count of escriturações on this contract, verbatim. The escrituração DETAIL is not duplicated here — it reaches you as consignado.reconciliation.received — so this count is how you detect a short feed. "0" is a live count; empty means the rail sent none.
          examples:
            - "0"
          type: string
        qtd_pagamentos:
          description: "The rail's count of repasse payments on this contract, verbatim. Same purpose as qtd_escrituracoes: the detail arrives as consignado.reconciliation.received."
          examples:
            - "0"
          type: string
        quantidade_parcelas:
          description: totalParcelas — the number of instalments.
          examples:
            - 24
          format: int64
          type: integer
        situacao_bloqueio_garantia:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: "State of the FGTS collateral BLOCK (Manual 005 §3.2.2 p.17: 0 Pendente de bloqueio, 1 Bloqueio Realizado, 2 Falha de bloqueio, 3 Bloqueio em reprocessamento, 4 Bloqueio rejeitado). A contract quoting FGTS collateral whose block failed or was rejected is effectively unsecured. Code 0 is LIVE: absence is the absent pair, never a zero."
        situacao_descricao:
          description: situacaoEmprestimo.descricao — the rail's own label for the code above, relayed verbatim so an unmapped code is still diagnosable.
          examples:
            - Ativo
          type: string
        situacao_emprestimo:
          description: "situacaoEmprestimo.codigo, surfaced verbatim. Manual 005 §3.2.2 p.17 publishes the full table: 0 Ativo, 2 Excluído, 3 Encerrado, 7 Contrato suspenso, 8 Suspenso banco, 15 Encerrado por término do vínculo, 16 Encerrado com renegociação, 17 Contrato suspenso por antecipação de parcela. Meaningful ONLY when situacao_present is true."
          examples:
            - 0
          format: int64
          type: integer
        situacao_present:
          description: "Whether the 2xx actually carried situacaoEmprestimo.codigo. false on a 2xx is a malformed or unexpected read: the outcome is forced to pending rather than guessed."
          examples:
            - true
          type: boolean
        taxaAnual:
          description: valorTaxaAnual as a PERCENT-per-year decimal string. "23.87" is 23.87 %/year, NOT the fraction 0.2387.
          examples:
            - "23.87"
          type: string
        taxa_mensal:
          description: valorTaxaMensal as a PERCENT-per-month decimal string. "1.80" is 1.80 %/month, NOT the fraction 0.018.
          examples:
            - "1.80"
          type: string
        valor_iof:
          description: valorIOF — the IOF charged (decimal string, BRL). Unlike the CET pair, this key is spelled identically on both the request and the response.
          examples:
            - "100.00"
          type: string
        valor_liberado:
          description: valorLiberado — the net amount released to the worker (decimal string, BRL). The rail DOES publish it on this read (Manual 005 p.17 field table, example 20000). It is NOT derivable from valor_principal minus valor_iof.
          examples:
            - "20000.00"
          type: string
        valor_parcela:
          description: The instalment amount (decimal string, BRL).
          examples:
            - "1116.31"
          type: string
        valor_principal:
          description: valorEmprestimo — the amount actually lent (decimal string, BRL).
          examples:
            - "21600.00"
          type: string
        valor_troco:
          description: valorTroco — the change returned to the worker (decimal string, BRL).
          examples:
            - "100.00"
          type: string
      required:
        - outcome
        - situacao_emprestimo
        - situacao_present
        - situacao_descricao
        - proposal_ref
        - numero_proposta
        - contrato
        - matricula
        - numero_inscricao_empregador
        - cpf
        - valor_principal
        - valor_liberado
        - valor_parcela
        - quantidade_parcelas
        - taxaAnual
        - taxa_mensal
        - cet_mensal
        - cetAnual
        - valor_iof
        - garantia
        - garantia_present
        - aceito_em
      type: object
    DataprevEscrituracao:
      additionalProperties: false
      properties:
        analise:
          $ref: "#/components/schemas/DataprevEscrituracaoAnalise"
          description: Dataprev's OWN pre-computed reconciliation verdict for this record, relayed verbatim. The gateway does not re-derive it.
        codigo_inscricao_empregador:
          description: "The employer inscription type the rail named: 1 = CNPJ, 2 = CPF (Manual 005 §3.3.2, inscricaoEmpregador.codigo)."
          examples:
            - "1"
          type: string
        competencia:
          description: "The record's OWN payroll competência, yyyyMM, from the wire's periodoReferencia (Manual 005 §3.3.2 p.21, Número). It is the record's attribution key: one query window routinely spans two payroll months, so never attribute a record to the competência you queried."
          examples:
            - "202607"
          type: string
        cpf:
          description: The worker the record belongs to, 11 digits. Re-padded from the rail's JSON Número.
          examples:
            - "99971699990"
          type: string
        matricula:
          description: The worker's payroll registration on the bond the discount was taken from (Manual 005 §3.3.2 p.21, Texto). With cpf it names the employment bond — which is precisely what this record's own vinculo_correto verdict is about. Empty when the rail did not publish it.
          examples:
            - MATCEN716
          type: string
        numero_contrato:
          description: The contract the escrituração record belongs to.
          examples:
            - "199971600000"
          type: string
        numero_inscricao_empregador:
          description: "The employer inscription number exactly as the rail sent it (Manual 005 §3.3.2): a CNPJ root or a full CNPJ, never padded."
          examples:
            - "42422253000101"
          type: string
        tipo_evento_esocial:
          $ref: "#/components/schemas/DataprevTipoEventoESocial"
          description: The eSocial event-kind block. It is a SIBLING of analise on the wire (Manual 005 §3.3.2), not a field inside it.
        valor_parcela:
          description: The instalment amount actually DISCOUNTED from payroll (decimal string, BRL). Its source wire field is valorParcelaDesconto (Manual 005 §3.3.2) — NOT the contract's emprestimo.valorParcela, which is what the contract expected.
          examples:
            - "1116.31"
          type: string
      required:
        - numero_contrato
        - cpf
        - matricula
        - competencia
        - valor_parcela
        - analise
        - tipo_evento_esocial
      type: object
    DataprevEscrituracaoAnalise:
      additionalProperties: false
      properties:
        dados_correspondentes:
          description: The rail's AGGREGATE verdict that the escriturated data corresponds to the averbado contract.
          examples:
            - true
          type: boolean
        existe_numero_contrato_escriturado:
          description: The rail's verdict that the contract number was found escriturado.
          examples:
            - true
          type: boolean
        existe_trabalhador_escriturado:
          description: The rail's verdict that the worker was found escriturado for the competência.
          examples:
            - true
          type: boolean
        instituicao_financeira_correta:
          description: The rail's verdict that the lending institution matches.
          examples:
            - true
          type: boolean
        valor_parcela_correta:
          description: The rail's verdict that the escriturated instalment matches the averbado contract. false is the reconciliation signal that payroll discounted an amount other than the contracted one.
          examples:
            - true
          type: boolean
        vinculo_correto:
          description: The rail's verdict that the employment vínculo matches.
          examples:
            - true
          type: boolean
      required:
        - existe_trabalhador_escriturado
        - existe_numero_contrato_escriturado
        - vinculo_correto
        - instituicao_financeira_correta
        - valor_parcela_correta
        - dados_correspondentes
      type: object
    DataprevEscrituracoesResponse:
      additionalProperties: false
      properties:
        escrituracoes:
          description: The escrituração records included in the window. Each carries its OWN competência — there is no envelope-level competência because one window routinely spans two payroll months. An empty list is the rail's answer, not an error.
          items:
            $ref: "#/components/schemas/DataprevEscrituracao"
          type:
            - array
            - "null"
      required:
        - escrituracoes
      type: object
    DataprevListPortabilidadeSolicitacoesResponse:
      additionalProperties: false
      properties:
        descartadas:
          items:
            $ref: "#/components/schemas/DataprevPortabilidadeSolicitacaoDescartada"
          type:
            - array
            - "null"
        has_more:
          type: boolean
        page:
          format: int64
          type: integer
        size:
          format: int64
          type: integer
        solicitacoes:
          items:
            $ref: "#/components/schemas/DataprevPortabilidadeSolicitacao"
          type: array
      required:
        - solicitacoes
        - page
        - size
        - has_more
      type: object
    DataprevListSolicitacoesResponse:
      additionalProperties: false
      properties:
        has_more:
          description: Whether at least one further page exists. Derived from the rail's total-pages / total-elements metadata, so a caller never has to re-derive pagination arithmetic.
          examples:
            - true
          type: boolean
        page:
          description: The 1-based page index this response represents, echoing the requested page.
          examples:
            - 1
          format: int64
          type: integer
        size:
          description: The page size this response represents. The RAIL owns it — Manual 001 v1.9 §3.2.1 p.15 publishes it as a system parameter of 250 results per page.
          examples:
            - 250
          format: int64
          type: integer
        solicitacoes:
          description: The worker loan requests on this page. An empty list is the rail's answer, not an error.
          items:
            $ref: "#/components/schemas/DataprevSolicitacao"
          type:
            - array
            - "null"
      required:
        - solicitacoes
        - page
        - size
        - has_more
      type: object
    DataprevPortabilidadeSolicitacao:
      additionalProperties: false
      properties:
        cpf:
          type: string
        data_hora_validade_solicitacao:
          format: date-time
          type: string
        elegivel_emprestimo:
          type: boolean
        id_solicitacao:
          type: string
        margem_disponivel:
          type: string
        matricula:
          type: string
        nome_trabalhador:
          type: string
        numero_inscricao_empregador:
          type: string
      required:
        - id_solicitacao
        - data_hora_validade_solicitacao
        - cpf
        - matricula
        - nome_trabalhador
        - numero_inscricao_empregador
        - margem_disponivel
      type: object
    DataprevPortabilidadeSolicitacaoDescartada:
      additionalProperties: false
      properties:
        id_solicitacao:
          type: string
        id_solicitacao_raw:
          type: string
      required:
        - id_solicitacao_raw
      type: object
    DataprevRepasseRecord:
      additionalProperties: false
      properties:
        codigo_inscricao_empregador:
          description: "The employer inscription type the rail named: 1 = CNPJ, 2 = CPF (Manual 005 §3.4.2). Absent when the rail did not publish it."
          examples:
            - "1"
          type: string
        codigo_trf:
          description: The handle of the transfer to the financial institution.
          examples:
            - TRF00098765
          type: string
        competencia:
          description: "The registro's OWN payroll competência, yyyyMM (Manual 005 §3.4.2). It can differ from the queried window: the 21/10/2025 semantic flip changed what this field means, and data_hora_inclusao_dataprev is the disambiguator. Both are surfaced so a consumer can branch — the flip logic is NOT applied here."
          examples:
            - "202607"
          type: string
        cpf:
          description: The worker the repassed money moved for, 11 digits, re-padded from the rail's JSON Número (Manual 005 §3.4.2 p.27). A repasse whose numero_contrato matches nothing in the consumer's book is the exception this read exists to raise; without this it names nobody. Empty when the rail did not publish it.
          examples:
            - "99971699990"
          type: string
        data_hora_inclusao_dataprev:
          description: "When Dataprev recorded the registro, RFC 3339 UTC. It is the disambiguator for the 21/10/2025 competência semantic flip (Manual 005 §3.4.2): branch on it together with competencia. Surfaced only; not applied here."
          examples:
            - "2026-07-17T03:12:44Z"
          format: date-time
          type: string
        data_hora_pagamento_guia:
          description: When the EMPLOYER paid the guia, RFC 3339 UTC (Manual 005 §3.4.2). This is the instant the §3.4 D+2 repasse deadline actually runs from — but it is only published once the repasse arrives, so a missing-repasse alarm cannot be anchored on it. Zero when the rail published none.
          examples:
            - "2026-06-02T09:00:00Z"
          format: date-time
          type: string
        data_repasse_if:
          description: The rail's transfer instant to the financial institution, RFC 3339 UTC (CEF D+2).
          examples:
            - "2026-07-17T00:00:00Z"
          format: date-time
          type: string
        id:
          description: "The append-only identity of the repasse registro (Manual 005 §3.4.2) and its dedupe subject: one idempotent event is emitted per id, so at-least-once delivery and a restart re-emit are a no-op. Immutable per registro."
          examples:
            - repasse-000123456
          type: string
        matricula:
          description: The worker's payroll registration on the bond the repassed instalment was discounted from (Manual 005 §3.4.2 p.27, Texto). Empty when the rail did not publish it.
          examples:
            - MATCEN716
          type: string
        numero_contrato:
          description: The contract this repasse settles — the reconciliation key against the expected schedule. The SAME contract can appear in N registros.
          examples:
            - "199971600000"
          type: string
        numero_guia:
          description: The payment-guia handle. A guia paid twice yields TWO registros carrying the same numero_guia — that is money to return, and whether it is a duplicidade to claw back is the consumer's call, not the gateway's.
          examples:
            - "000000012345678"
          type: string
        numero_inscricao_empregador:
          description: The employer inscription number exactly as the rail sent it (Manual 005 §3.4.2), never padded. Absent when the rail did not publish it.
          examples:
            - "42422253000101"
          type: string
        status_repasse:
          description: ALWAYS EMPTY from the real rail. Manual 005 §3.4.2 publishes no situacao/PAGO/PENDENTE field on consultar-repasse-pagamentos — the mere EXISTENCE of a registro IS the liquidation, so do not wait for a status here. The key is retained only because it is a shipped cross-repo field on consignado.reconciliation.received; dropping it needs a coordinated migration.
          examples:
            - ""
          type: string
        valor_atualizacao_monetaria:
          description: Monetary restatement applied to the instalment, when any (decimal string, BRL). Absent when there is none.
          examples:
            - "3.47"
          type: string
        valor_juros_de_mora:
          description: Late-payment interest, when the rail charged any (decimal string, BRL). Absent when there is none.
          examples:
            - "11.16"
          type: string
        valor_multa:
          description: Late-payment penalty, when the rail charged one (decimal string, BRL). Absent when there is none.
          examples:
            - "22.33"
          type: string
        valor_parcela_paga:
          description: The instalment amount actually repassed (decimal string, BRL).
          examples:
            - "1116.31"
          type: string
        verbas_rescisorias:
          description: Marks a termination-benefit CANDIDATE, not trusted guarantee cash. It does NOT identify FGTS balance or penalty cash, recovery authority, ordering, or terminality — do not infer any of those from this flag.
          examples:
            - false
          type: boolean
      required:
        - id
        - numero_contrato
        - cpf
        - matricula
        - numero_guia
        - valor_parcela_paga
        - codigo_trf
        - data_repasse_if
        - data_hora_pagamento_guia
        - data_hora_inclusao_dataprev
        - status_repasse
        - verbas_rescisorias
      type: object
    DataprevRepasseResponse:
      additionalProperties: false
      properties:
        registros:
          description: The per-registro repasse records included in the window, each with its own competência. This read returns records, NOT a competência aggregate. An empty list is the rail's answer, not an error.
          items:
            $ref: "#/components/schemas/DataprevRepasseRecord"
          type:
            - array
            - "null"
      required:
        - registros
      type: object
    DataprevSolicitacao:
      additionalProperties: false
      properties:
        codigo_solicitante:
          description: "The instituição financeira code whose credential produced this read, echoed so a consumer bids under the same code (Manual 001 §3.1.2 p.10). Verbatim: it carries no shape or domain guarantee."
          examples:
            - "999"
          type: string
        cpf:
          description: The worker the request belongs to, 11 digits. Re-padded from the rail's JSON Número, which drops a leading zero.
          examples:
            - "99971699990"
          type: string
        data_admissao:
          description: The worker's admission date at the employer (Manual 001 §3.2.2 p.17, a ddMMyyyy Texto on the wire). Absent when the rail did not publish it.
          examples:
            - "2004-09-25T00:00:00Z"
          format: date-time
          type: string
        data_nascimento:
          description: The worker's date of birth (Manual 001 §3.2.2 p.17, a ddMMyyyy Texto on the wire). Absent when the rail did not publish it.
          examples:
            - "1981-09-25T00:00:00Z"
          format: date-time
          type: string
        elegivel_emprestimo:
          description: Whether the rail flags the worker eligible for the leilão loan. false is a signal a bid manager can decline on. Absent when the rail element carried no verdict — absence is NOT a refusal.
          examples:
            - true
          type: boolean
        garantia:
          $ref: "#/components/schemas/DataprevSolicitacaoGarantia"
          description: The solicitação's FGTS-collateral eligibility block. This is the SOURCE view — the collateral the worker HAS — distinct from the collateral a proposta OFFERS.
        id_solicitacao:
          description: The rail's identifier for the worker loan request — the subject a bid is submitted against.
          examples:
            - "9876543210"
          type: string
        inscricao_empregador:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: The employer-inscription TYPE pair. Manual 001 §3.2.2 p.17 Obs.1 allows the employer inscription to be a CPF or a CNPJ, so the discriminator is not derivable from the number. Absent when the rail published no readable code — never a synthesised codigo 0.
        margem_disponivel:
          description: The FREE consignable margin the rail reports for this request (decimal string, BRL) — the ceiling an instalment must fit under. It arrives without a consent step, unlike the worker-margin read.
          examples:
            - "1500.00"
          type: string
        matricula:
          description: The worker's payroll registration at the employer (Manual 001 §3.2.2 p.17, Texto; bounded 1..30 by Manual 003 §3.1.1). Together with cpf and numero_inscricao_empregador it IS the worker's employment link on this rail — there is no separate vínculo identifier.
          examples:
            - MATCEN716
          type: string
        nome_trabalhador:
          description: The worker's name (Manual 001 v1.9 element).
          examples:
            - MARIA DA SILVA
          type: string
        numero_inscricao_empregador:
          description: The employer inscription the solicitação belongs to (Texto — CNPJ, CEI or CAEPF).
          examples:
            - "42422253000101"
          type: string
        pessoa_exposta_politicamente:
          $ref: "#/components/schemas/DataprevCodigoDescricao"
          description: "The politically-exposed-person pair, relayed verbatim and never interpreted: Manual 001 §3.2.2 p.17 types it \"Código e Descrição\" and does not enumerate the codes."
        prazo_meses:
          description: The number of instalments the worker requested.
          examples:
            - 24
          format: int64
          type: integer
        validadeLeilao:
          description: The instant this request's leilão window closes, RFC 3339 UTC. The rail's leilão is valid 24h — a bid after this instant is not considered.
          examples:
            - "2026-07-31T12:00:00Z"
          format: date-time
          type: string
        valor_solicitado:
          description: The principal the worker requested (decimal string, BRL).
          examples:
            - "20000.00"
          type: string
      required:
        - id_solicitacao
        - cpf
        - margem_disponivel
        - valor_solicitado
        - prazo_meses
        - validadeLeilao
      type: object
    DataprevSolicitacaoGarantia:
      additionalProperties: false
      properties:
        perc_verba_rescisoria_garantia:
          description: Percentage of the rescission verbas pledged as collateral (decimal string, PERCENT). It rides the SEPARATE employer verba-rescisória track, not the FGTS-guarantee execution API.
          examples:
            - "10.00"
          type: string
        tem_garantias:
          description: "Whether the worker has FGTS guarantees available. CAUTION: false is an authoritative rail statement of \"no collateral\" and is INDISTINGUISHABLE from the zero value of an absent block — on the contract read, gate on garantia_present instead, never on this flag alone."
          examples:
            - true
          type: boolean
        valor_multa_rescisoria_garantia_fgts:
          description: The rescission-penalty portion available as collateral (decimal string, BRL).
          examples:
            - "400.25"
          type: string
        valor_saldo_disponivel_garantia_fgts:
          description: The FGTS balance available as collateral (decimal string, BRL).
          examples:
            - "1000.50"
          type: string
      required:
        - tem_garantias
      type: object
    DataprevTipoEventoESocial:
      additionalProperties: false
      properties:
        codigo:
          description: "The eSocial event kind: 0 = periódico, 1 = não-periódico (desligamento/rescisório)."
          examples:
            - 0
          format: int64
          type: integer
        descricao:
          description: The rail's own label for the event kind.
          examples:
            - Periódico
          type: string
      required:
        - codigo
        - descricao
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: "Stable, machine-readable product error code. One of the enumerated values: the CLT-NNNN catalog codes for the general refusal classes; the named command conflicts, which a client branches on to tell one conflict from another; the four terminal refusals IDEMPOTENCY_STATE_UNRECOGNISED, IDEMPOTENCY_RECORD_UNREADABLE, IDEMPOTENCY_OUTCOME_UNRECORDED and IDEMPOTENCY_REPLAY_UNAVAILABLE (422), which tell the client to reconcile the original request and never retry under a new key; IDEMPOTENCY_KEY_REUSE (422): the key is spent on a different request, so send a new key; the codes a single surface answers, named after it (FUNDO_*, CESSAO_*, REGISTRO_B3_*, ...); and the 5xx codes naming an upstream (DATAPREV_*, STREAMING_HUB_*, TENANT_MANAGER_*, the Access Manager's AUT-0033 and AUT-1021) or an unknown outcome, whose detail is client-readable."
          enum:
            - AUT-0033
            - AUT-1021
            - AVERBACAO_ARTIFACT_CONFLICT
            - AVERBACAO_CLAIM_CONFLICT
            - AVERBACAO_DOCUMENTATION_CONFLICT
            - AVERBACAO_EXCLUDED
            - AVERBACAO_HELD_BY_ANOTHER_SENDER
            - AVERBACAO_NOT_ACCEPTED
            - AVERBACAO_OPERATIONS_INTERNAL
            - AVERBACAO_OPERATIONS_INVALID_CURSOR
            - AVERBACAO_OPERATIONS_INVALID_QUERY
            - AVERBACAO_OPERATIONS_UNKNOWN_STATUS
            - AVERBACAO_OPERATION_NOT_FOUND
            - BID_NO_PROPOSTA_LEFT
            - BID_ORIGINADOR_INACTIVE
            - BID_ORIGINADOR_UNKNOWN
            - BID_PROPOSAL_SLOT_TAKEN
            - BID_SOLICITACAO_TAKEN
            - BID_SOLICITACAO_UNKNOWN
            - BID_SUBMISSIONS_INTERNAL
            - BID_SUBMISSIONS_INVALID_CURSOR
            - BID_SUBMISSIONS_UNKNOWN_SITUATION
            - BOOKING_FIELD_INVALID
            - CEDED_CREDIT_INTERNAL
            - CEDED_CREDIT_NO_FUND_ENTITLEMENT
            - CEDED_CREDIT_UNAVAILABLE
            - CESSAO_CEDED_TO_OTHER_FUND
            - CESSAO_CREDIT_NOT_ACCEPTED
            - CESSAO_CREDIT_NOT_FOUND
            - CESSAO_CREDIT_NOT_WITNESSED
            - CESSAO_CREDIT_PENDING
            - CESSAO_FUNDO_NOT_ATTRIBUTED
            - CESSAO_INTERNAL
            - CESSAO_INVALID_INPUT
            - CESSAO_UNAVAILABLE
            - CESSAO_UNWIRED
            - CLT-0001
            - CLT-0002
            - CLT-0003
            - CLT-0004
            - CLT-0005
            - CLT-0006
            - CLT-0007
            - CLT-0008
            - CLT-0009
            - CLT-0010
            - CLT-0011
            - CONTRACT_ALREADY_REGISTERED
            - CONTRACT_NOT_BOOKABLE
            - CURSOR_EXPIRED
            - CURSOR_FENCE_MISMATCH
            - DATAPREV_CREDENTIAL_REJECTED
            - DATAPREV_CREDENTIAL_REQUIRED
            - DATAPREV_CREDENTIAL_REVOKED
            - DATAPREV_INVALID_RESPONSE
            - DATAPREV_TIMEOUT
            - DATAPREV_UNAVAILABLE
            - DECLARED_DATES_OUT_OF_ORDER
            - DECLARED_TERMS_INCONSISTENT
            - DISBURSEMENT_CONFIRMATIONS_INTERNAL
            - DISBURSEMENT_CONFIRMATIONS_INVALID_CURSOR
            - DISBURSEMENT_PAYMENT_CONFLICT
            - EVENT_DELIVERY_INTERNAL
            - EXCLUSION_AUTHORITY_CONFLICT
            - EXCLUSION_BOOKING_IDENTITY_INCOMPLETE
            - EXCLUSION_DOCUMENTATION_UNDERWAY
            - EXCLUSION_OPERATIONS_INTERNAL
            - EXCLUSION_OPERATIONS_INVALID_CURSOR
            - EXCLUSION_OPERATIONS_INVALID_QUERY
            - EXCLUSION_OPERATIONS_UNKNOWN_STATUS
            - EXCLUSION_OPERATION_NOT_FOUND
            - FGTS_EXECUTION_ALREADY_REFUSED
            - FGTS_EXECUTION_CONTRACT_TAKEN
            - FGTS_EXECUTION_OUTCOME_UNRESOLVED
            - FGTS_EXECUTION_PAYLOAD_MISMATCH
            - FIRST_DEDUCTION_BEFORE_COMPETENCIA
            - FORMALIZATION_DEADLINE_EXCEEDED
            - FUNDO_CNPJ_CONFLICT
            - FUNDO_DEACTIVATED
            - FUNDO_INTERNAL
            - FUNDO_INVALID_ID
            - FUNDO_INVALID_INPUT
            - FUNDO_NOT_FOUND
            - FUNDO_NOT_REGISTERED
            - FUNDO_REF_CONFLICT
            - FUNDO_UNAVAILABLE
            - IDEMPOTENCY_KEY_REUSE
            - IDEMPOTENCY_OUTCOME_UNRECORDED
            - IDEMPOTENCY_RECORD_UNREADABLE
            - IDEMPOTENCY_REPLAY_UNAVAILABLE
            - IDEMPOTENCY_STATE_UNRECOGNISED
            - INVALID_CONTRACT_NUMBER
            - INVALID_CURSOR
            - INVALID_EVENTS_INVALID_CURSOR
            - INVALID_EVENT_NOT_FOUND
            - INVALID_EVENT_NOT_REQUEUEABLE
            - INVALID_PAGE_LIMIT
            - INVENTORY_UNAVAILABLE
            - MARGIN_SNAPSHOT_INCONSISTENT
            - ORIGINADOR_INTERNAL
            - ORIGINADOR_INVALID_ID
            - ORIGINADOR_INVALID_INPUT
            - ORIGINADOR_NOT_FOUND
            - ORIGINADOR_REF_CONFLICT
            - ORIGINADOR_UNAVAILABLE
            - OUTCOME_UNKNOWN
            - PORTABILIDADE_WINDOW_EXPIRED
            - RAIL_COMMANDS_INTERNAL
            - RAIL_COMMANDS_INVALID_CURSOR
            - RAIL_COMMANDS_TENANT_REQUIRED
            - RAIL_COMMANDS_UNKNOWN_FILTER
            - RAIL_COMMAND_ALREADY_REFUSED
            - RAIL_COMMAND_ANSWER_NOT_RETAINED
            - RAIL_COMMAND_CLAIM_CONFLICT
            - RAIL_COMMAND_OUTCOME_UNRESOLVED
            - RAIL_COMMAND_PAYLOAD_MISMATCH
            - RATE_OUTSIDE_PRODUCT_RANGE
            - REGISTRATION_NOT_FOUND
            - REGISTRO_B3_AVERBACAO_NAO_CONFIRMADA
            - REGISTRO_B3_CONTRATO_NAO_ENCONTRADO
            - REGISTRO_B3_DATA_REGISTRO_INVALIDA
            - REGISTRO_B3_INTERNAL
            - REGISTRO_B3_JA_INFORMADO
            - REGISTRO_B3_NAO_INFORMADO
            - REGISTRO_B3_UNAVAILABLE
            - REGISTRO_B3_UNWIRED
            - REPASSE_EXPECTATIONS_INTERNAL
            - REPASSE_EXPECTATIONS_INVALID_CURSOR
            - REPASSE_EXPECTATIONS_UNKNOWN_SITUATION
            - REVERSAO_WINDOW_EXPIRED
            - SALDO_DEVEDOR_INTERNAL
            - SALDO_DEVEDOR_INVALID_CURSOR
            - SALDO_DEVEDOR_NOT_FOUND
            - SALDO_DEVEDOR_TENANT_REQUIRED
            - SALDO_DEVEDOR_UNAVAILABLE
            - STREAMING_HUB_TIMEOUT
            - STREAMING_HUB_UNAVAILABLE
            - TENANT_MANAGER_TIMEOUT
            - TENANT_MANAGER_UNAVAILABLE
            - THROUGHPUT_HISTORY_INTERNAL
            - THROUGHPUT_HISTORY_INVALID_CURSOR
            - THROUGHPUT_HISTORY_TENANT_REQUIRED
            - THROUGHPUT_HISTORY_UNAVAILABLE
            - THROUGH_REQUIRED
            - UNKNOWN_QUERY_PARAMETER
          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."
      type: object
    DisbursementConfirmationItem:
      additionalProperties: false
      properties:
        amount:
          description: The canonical BRL decimal string the client asserted, byte for byte.
          examples:
            - "1234.56"
          type: string
        confirmation_id:
          description: The gateway's identity for this confirmation.
          examples:
            - 1f5b9c26-6f5a-4f77-9c1c-5d1c0f0a9b21
          type: string
        confirmed_at:
          description: When THIS GATEWAY stamped the confirmation, in UTC. It is the ordering column.
          examples:
            - "2026-08-14T09:12:33Z"
          format: date-time
          type: string
        numero_contrato:
          description: The contract the client says it paid against.
          examples:
            - 99999999999AN1
          type: string
        orphan:
          description: True when this deployment holds no averbado contract under numero_contrato. Derived on every read, never stored.
          examples:
            - true
          type: boolean
        paid_at:
          description: When the CLIENT says the money left, in UTC. Declared, never observed, which is why it never orders this read.
          examples:
            - "2026-08-14T09:05:00Z"
          format: date-time
          type: string
        payload_digest:
          description: Lowercase hex SHA-256 over the canonical published payload.
          examples:
            - 3b1f2c9d5a47e08b6c1d4f2a8e7b0c93d6a51f84b2c7e903a1d5f6b8c2e4079a
          type: string
        payment_reference:
          description: The client's own identifier for the payment.
          examples:
            - PIX-2026-08-14-000123
          type: string
      required:
        - confirmation_id
        - numero_contrato
        - amount
        - paid_at
        - payment_reference
        - confirmed_at
        - payload_digest
        - orphan
      type: object
    DisbursementConfirmationRequest:
      additionalProperties: false
      properties:
        amount:
          description: "The BRL amount already paid to the worker, as a canonical positive decimal string matching ^[1-9][0-9]*\\.[0-9]{2}$ (at most 13 bytes). A string, never a JSON number: money never passes through a float."
          examples:
            - "2000.00"
          maxLength: 13
          type: string
        paid_at:
          description: "When the money was paid, strict RFC 3339 UTC with a literal Z (2026-08-01T12:00:00Z). Exactly one spelling per instant: a +00:00 offset, a lowercase z, fractional seconds or a missing zone are refused, never normalized."
          examples:
            - "2026-08-01T12:00:00Z"
          maxLength: 20
          type: string
        payment_reference:
          description: The client's opaque payment reference — a Pix EndToEndId, a TED protocol number, an internal settlement id. Valid UTF-8, 1..256 bytes, preserved byte for byte with no trimming, case folding or normalization.
          examples:
            - E32074986202608011200A1B2C3D4E5F
          maxLength: 256
          type: string
      required:
        - amount
        - paid_at
        - payment_reference
      type: object
    DisbursementConfirmationResponse:
      additionalProperties: false
      properties:
        amount:
          description: The confirmed amount, echoed verbatim.
          examples:
            - "2000.00"
          type: string
        confirmation_id:
          description: The gateway's identity for this immutable confirmation.
          examples:
            - 1f5b9c26-6f5a-4f77-9c1c-5d1c0f0a9b21
          type: string
        confirmed_at:
          description: When the gateway durably recorded the confirmation, strict RFC 3339 UTC.
          examples:
            - "2026-08-01T12:00:05Z"
          type: string
        numero_contrato:
          description: The rail contract number the confirmation was addressed to, echoed from the path.
          examples:
            - 99999999999AN1
          type: string
        paid_at:
          description: When the money was paid, echoed verbatim.
          examples:
            - "2026-08-01T12:00:00Z"
          type: string
        payment_reference:
          description: The client's payment reference, echoed verbatim.
          examples:
            - E32074986202608011200A1B2C3D4E5F
          type: string
      required:
        - confirmation_id
        - numero_contrato
        - amount
        - paid_at
        - payment_reference
        - confirmed_at
      type: object
    DisbursementConfirmationsPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/DisbursementConfirmationItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
      required:
        - items
        - page
      type: object
    EmploymentTerminationRecord:
      additionalProperties: false
      properties:
        effective_at:
          description: When the status took effect (UTC).
          examples:
            - "2026-07-15T00:00:00Z"
          format: date-time
          type: string
        numero_contrato:
          description: The contract whose employment link ended.
          examples:
            - "199971600000"
          type: string
        reason_code:
          description: The rail's reason code, when it published one.
          examples:
            - ""
          type: string
        record_id:
          description: Per-record identity inside the channel; (report_ref, record_id) is the idempotency subject.
          examples:
            - "199971600000"
          type: string
        report_ref:
          description: The logical feed channel this record came from.
          examples:
            - terminacao-vinculo
          type: string
        status:
          description: The employment status the record reports.
          enum:
            - suspended
            - terminated
          examples:
            - terminated
          type: string
      required:
        - report_ref
        - record_id
        - numero_contrato
        - status
        - effective_at
      type: object
    EndpointResponse:
      additionalProperties: false
      properties:
        endpoint:
          description: "The full delivery destination as stored, unmasked: the webhook URL with its path and query, the queue URL with its account id, the exchange/routing-key pair, the bus name, or the synthesized pull:// URL."
          examples:
            - https://hooks.example.com/ingest
          type: string
      required:
        - endpoint
      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
    EventDeliveryBucket:
      additionalProperties: false
      properties:
        count:
          description: How many events stand in this status.
          examples:
            - 3
          format: int64
          type: integer
        oldest_created_at:
          description: Creation instant of the oldest event in this status, in UTC. Null exactly when the count is zero.
          examples:
            - "2026-08-14T09:12:33Z"
          format: date-time
          type:
            - string
            - "null"
        status:
          description: The outbox_event_status label, carried verbatim from the database enum.
          enum:
            - PENDING
            - PROCESSING
            - PUBLISHED
            - FAILED
            - INVALID
          examples:
            - PENDING
          type: string
      required:
        - status
        - count
        - oldest_created_at
      type: object
    EventDeliverySummary:
      additionalProperties: false
      properties:
        buckets:
          items:
            $ref: "#/components/schemas/EventDeliveryBucket"
          type: array
      required:
        - buckets
      type: object
    ExclusaoPortabilidadeBody:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          description: "Employer inscription type: 1 CNPJ, 2 CPF."
          examples:
            - "1"
          pattern: ^[12]$
          type: string
        codigoProponente:
          description: COMPE/CBC of the DESTINATION institution taking the contract. Caller input, because this gateway cannot know it.
          examples:
            - "994"
          maxLength: 3
          minLength: 1
          pattern: ^[0-9]{1,3}$
          type: string
        cpfTrabalhador:
          description: Worker CPF, 11 digits.
          examples:
            - "99999999999"
          maxLength: 11
          minLength: 11
          pattern: ^[0-9]{11}$
          type: string
        matricula:
          description: Matrícula assigned to the worker by the employer.
          examples:
            - 99999999999-A
          maxLength: 30
          minLength: 1
          type: string
        numeroInscricaoEmpregador:
          description: Employer inscription number, Texto per the manual (the mirrored Swagger still types this int64).
          examples:
            - "99999999999881"
          maxLength: 14
          minLength: 1
          type: string
        numeroUnico:
          description: "Número único identificador da portabilidade (NSU oriundo da CIP). A digit STRING: Manual 008 publishes exactly 21 algarismos, which overflows every conventional numeric type, so it stays text end to end."
          examples:
            - "123456789012345678901"
          maxLength: 21
          minLength: 21
          pattern: ^[0-9]{21}$
          type: string
        ultimaParcelaPaga:
          description: Last instalment already paid on the contract being excluded. Optional; omit it rather than sending 0 when unknown.
          examples:
            - 5
          format: int64
          maximum: 999
          minimum: 0
          type: integer
      required:
        - numeroUnico
        - codigoProponente
        - cpfTrabalhador
        - matricula
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
      type: object
    ExclusaoPortabilidadeResponse:
      additionalProperties: false
      properties:
        codigoSucesso:
          description: The rail's own success code.
          examples:
            - "00"
          type: string
        competenciaExclusao:
          description: Payroll competência in which the exclusion takes effect, yyyyMM.
          examples:
            - 202609
          format: int64
          type: integer
        hashOperacao:
          description: The rail's own identity for this operation. Texto on this operation, unlike the other exclusion operations where the same field name is Número.
          examples:
            - "34006311"
          type: string
        mensagem:
          description: The rail's own message.
          examples:
            - Exclusao realizada com sucesso
          type: string
        numeroContrato:
          description: The contract this exclusion removed from the origin institution.
          examples:
            - 99999999999AP1
          type: string
        submittedAt:
          description: When this gateway durably authorized the rail call, RFC 3339 UTC.
          examples:
            - "2026-08-29T12:00:00Z"
          format: date-time
          type: string
        ultimaParcelaPaga:
          description: "Last instalment the rail reports as paid on the excluded contract. Omitted when the acknowledgement carries no entry for the commanded contract: 0 is a live value (exclusion before any instalment was paid), so absence must not fabricate it."
          examples:
            - 5
          format: int64
          type: integer
      required:
        - numeroContrato
        - submittedAt
        - codigoSucesso
        - mensagem
        - competenciaExclusao
        - hashOperacao
      type: object
    ExclusionAuditEntry:
      additionalProperties: false
      properties:
        event_type:
          type: string
        evidence:
          description: The evidence document exactly as it was written. Its shape varies by event_type.
        from_status:
          type:
            - string
            - "null"
        occurred_at:
          format: date-time
          type: string
        to_status:
          enum:
            - claimed
            - invoking
            - confirmed
            - rejected
            - outcome_unknown
          type: string
      required:
        - from_status
        - to_status
        - event_type
        - occurred_at
        - evidence
      type: object
    ExclusionAuditTrail:
      additionalProperties: false
      properties:
        entries:
          items:
            $ref: "#/components/schemas/ExclusionAuditEntry"
          type: array
        truncated:
          description: True when the trail reached the entry ceiling and older transitions were not returned.
          type: boolean
      required:
        - entries
        - truncated
      type: object
    ExclusionCommandRequest:
      additionalProperties: false
      properties:
        motivo_exclusao:
          description: "The client's declared reason for removing the contract from the rail, as one of the closed codes Manual 003 §3.3.1 publishes: 1 desistência do empréstimo, 2 falecimento, 3 liquidação antecipada, 7 ação judicial, 8 exclusão por fraude, 9 outros. A string, never a JSON number. Mandatory on every request: the gateway never declares a reason on the client's behalf, and an absent or unpublished code is refused locally before the rail is called."
          enum:
            - "1"
            - "2"
            - "3"
            - "7"
            - "8"
            - "9"
          examples:
            - "1"
          type: string
      required:
        - motivo_exclusao
      type: object
    ExclusionOperationItem:
      additionalProperties: false
      properties:
        claimed_at:
          format: date-time
          type: string
        evidence_source:
          description: The proof that terminated the operation. Null while the operation is not terminal.
          enum:
            - exclude_response
            - provider_status
            - operator_evidence
            - m005_observation
            - null
          type:
            - string
            - "null"
        numero_contrato:
          type: string
        outcome_at:
          format: date-time
          type:
            - string
            - "null"
        provider_message:
          type:
            - string
            - "null"
        provider_reference:
          type:
            - string
            - "null"
        reason_code:
          type:
            - string
            - "null"
        request_ref:
          type: string
        status:
          description: The situation the operation is durably parked in.
          enum:
            - claimed
            - invoking
            - confirmed
            - rejected
            - outcome_unknown
          type: string
        status_check_attempts:
          format: int64
          type: integer
        status_check_next_at:
          format: date-time
          type:
            - string
            - "null"
      required:
        - request_ref
        - numero_contrato
        - status
        - provider_reference
        - reason_code
        - provider_message
        - evidence_source
        - outcome_at
        - claimed_at
        - status_check_attempts
        - status_check_next_at
      type: object
    ExclusionOperationResponse:
      additionalProperties: false
      properties:
        evidenceSource:
          description: "Which proof produced the terminal state: exclude_response, operator_evidence or m005_observation. Empty until one did."
          examples:
            - exclude_response
          type: string
        message:
          description: The refusal message the REGISTRY published, or the gateway's account of the contract read that closed it. Present only on a rejected operation.
          examples:
            - motivo nao publicado
          type: string
        motivoExclusao:
          description: The client's declared Manual 003 §3.3.1 reason, echoed from the durable authority.
          enum:
            - "1"
            - "2"
            - "3"
            - "7"
            - "8"
            - "9"
          examples:
            - "1"
          type: string
        numeroContrato:
          description: The contract number the exclusion was addressed to.
          examples:
            - 99999999999AN1
          type: string
        outcomeAt:
          description: Instant the registry answered, RFC 3339 UTC. ABSENT until it did.
          examples:
            - "2026-08-05T12:00:00Z"
          format: date-time
          type: string
        providerReference:
          description: The registry's own receipt for the mutation. ABSENT when it minted none, which is the normal case under an m005_observation confirmation — absence is never a verdict.
          examples:
            - HASH-1
          type: string
        reasonCode:
          description: The refusal code the REGISTRY published, or contract_left_registry.situacao_N[.origem_N] when its contract read showed the contract already off the registry. Present only on a rejected operation.
          examples:
            - ME
          type: string
        status:
          description: "Durable operation status. confirmed means the contract came off the payroll; rejected means the exclusion did not run: the registry published a refusal, or its contract read showed the contract already off the registry by another way; claimed, invoking and outcome_unknown all mean the effect at the registry is NOT known yet and M005 reconciliation has to close it — none of the three is a failure to retry blindly."
          enum:
            - claimed
            - invoking
            - confirmed
            - rejected
            - outcome_unknown
          examples:
            - confirmed
          type: string
      required:
        - numeroContrato
        - motivoExclusao
        - status
      type: object
    ExclusionOperationsPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/ExclusionOperationItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
      required:
        - items
        - page
      type: object
    FgtsAuthorizedBond:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          examples:
            - "1"
          type: string
        cpf:
          description: Worker CPF, 11 digits — re-padded from the rail's JSON Número, which drops a leading zero.
          examples:
            - "99999999999"
          type: string
        elegivel:
          description: Whether the bond is eligible for a consignado. When false, motivoInelegibilidade carries the rail's reason. ABSENT when the rail element carried no verdict — absence is not a refusal.
          examples:
            - true
          type: boolean
        matricula:
          examples:
            - 99999999999-A
          type: string
        motivoInelegibilidade:
          description: Rail description of why the bond is ineligible, when it is.
          examples:
            - Vínculo com data de desligamento
          type: string
        numeroInscricaoEmpregador:
          examples:
            - "42422253000101"
          type: string
      required:
        - cpf
        - matricula
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
      type: object
    FgtsAutorizadosRequestBody:
      additionalProperties: false
      properties:
        authorization:
          $ref: "#/components/schemas/ConsentAuthorizationBody"
          description: Worker grupo-1 digital-authorization evidence.
        cpf:
          description: Worker CPF, exactly 11 digits. In the BODY, never a path or query parameter.
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        matricula:
          description: Employment registration used to open or reuse the worker consent.
          examples:
            - 99999999999-A
          minLength: 1
          type: string
      required:
        - cpf
        - matricula
        - authorization
      type: object
    FgtsAutorizadosResponse:
      additionalProperties: false
      properties:
        vinculos:
          description: Authorized employment bonds. An empty list means the rail returned none — it is not an error.
          items:
            $ref: "#/components/schemas/FgtsAuthorizedBond"
          type:
            - array
            - "null"
      required:
        - vinculos
      type: object
    FgtsGuaranteeExecutionRecordResponse:
      additionalProperties: false
      properties:
        claimedAt:
          description: Instant the gateway durably recorded the request, RFC 3339 UTC. It is written BEFORE the rail call, so it exists for every record here.
          examples:
            - "2026-07-30T12:00:00Z"
          format: date-time
          type: string
        dtPrevRepasse:
          description: Forecast repasse date (yyyy-MM-dd), as the rail published it. Absent when it published none.
          examples:
            - "2026-07-15"
          type: string
        numeroContrato:
          description: The contract the guarantee execution was addressed to.
          examples:
            - 99999999999AN1
          type: string
        protocolo:
          description: The rail's own receipt for the movement, up to 32 digits. A string so 32 digits survive without precision loss. Present only on an executed record.
          examples:
            - "12345678901234567890123456789012"
          type: string
        settledAt:
          description: Instant the record reached its terminal state, RFC 3339 UTC. ABSENT while the record is still claimed.
          examples:
            - "2026-07-30T12:00:04Z"
          format: date-time
          type: string
        status:
          description: Durable status. executed means the rail confirmed and the protocolo is the proof; refused means the rail PROVED it executed nothing, which releases the contract for a corrected request under a fresh key; claimed and unknown both mean the effect at the rail is NOT established, and Manual 017 publishes no operation that asks it — so neither is a retry, both are operator reconciliation.
          enum:
            - claimed
            - executed
            - unknown
            - refused
          examples:
            - executed
          type: string
      required:
        - numeroContrato
        - status
        - claimedAt
      type: object
    FgtsGuaranteeExecutionRequestBody:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        cpf:
          description: Worker CPF, exactly 11 digits. In the BODY, never a path or query parameter.
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        matricula:
          examples:
            - 99999999999-A
          minLength: 1
          type: string
        numeroContrato:
          description: Rail contract number.
          examples:
            - 99999999999AN1
          maxLength: 15
          minLength: 1
          type: string
        numeroInscricaoEmpregador:
          examples:
            - "42422253000101"
          minLength: 1
          type: string
        valorMultaRescisoriaGarantiaFgts:
          description: Rescission-penalty portion pledged as collateral (decimal string, BRL). Obrigatório=Não — omit rather than send 0.
          examples:
            - "100.00"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorSaldoDisponivelGarantiaFgts:
          description: "Consignable FGTS balance pledged as collateral (decimal string, BRL). Obrigatório=Não at the rail: OMIT it for a contract with no FGTS collateral. Sending 0 is not an absence — the rail reads it as an invalid guarantee value."
          examples:
            - "98587.56"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - numeroContrato
        - cpf
        - matricula
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
      type: object
    FgtsGuaranteeExecutionResponse:
      additionalProperties: false
      properties:
        dtPrevRepasse:
          description: Forecast repasse date (yyyy-MM-dd).
          examples:
            - "2026-07-15"
          type: string
        protocolo:
          description: Rail protocol number, up to 32 digits. A string so 32 digits survive without precision loss.
          examples:
            - "12345678901234567890123456789012"
          type: string
        replayed:
          description: true when this response was served from the durable record of an earlier identical request under the same X-Idempotency key, without touching the rail — the guarantee was executed once, and this is the recorded outcome. false means THIS call performed the execution.
          examples:
            - false
          type: boolean
      required:
        - protocolo
        - replayed
      type: object
    FgtsSaldoRequestBody:
      additionalProperties: false
      properties:
        authorization:
          $ref: "#/components/schemas/ConsentAuthorizationBody"
          description: Worker grupo-1 digital-authorization evidence used to open or reuse the data-consult consent.
        codigoInscricaoEmpregador:
          description: "Employer inscription type. Manual 003 §3.1.1 p.10 and Manual 002 §3.3.1 p.14 publish exactly two codes: 1 = CNPJ, 2 = CPF."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        cpf:
          description: "Worker CPF, exactly 11 digits (Manual 002 §3.2.2 p.12: Número, 11 algarismos). In the BODY, never a path or query parameter."
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        matricula:
          description: Employment registration at the employer.
          examples:
            - 99999999999-A
          minLength: 1
          type: string
        numeroInscricaoEmpregador:
          description: Employer inscription number matching codigoInscricaoEmpregador.
          examples:
            - "42422253000101"
          minLength: 1
          type: string
      required:
        - cpf
        - matricula
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
        - authorization
      type: object
    FgtsSaldoResponse:
      additionalProperties: false
      properties:
        dataHoraConsulta:
          description: Instant the rail computed the balance, RFC 3339 UTC. It is the balance's as-of moment, not the moment you called.
          examples:
            - "2026-07-30T12:00:00Z"
          format: date-time
          type: string
        valorMultaRescisoriaConsignado:
          description: Rescission-penalty portion (decimal string, BRL).
          examples:
            - "400.25"
          type: string
        valorSaldoDisponivelConsignado:
          description: Consignable FGTS balance (decimal string, BRL).
          examples:
            - "1000.50"
          type: string
      required:
        - dataHoraConsulta
        - valorSaldoDisponivelConsignado
        - valorMultaRescisoriaConsignado
      type: object
    Fundo:
      additionalProperties: false
      properties:
        ativo:
          type: boolean
        cnpj:
          type: string
        created_at:
          format: date-time
          type: string
        deactivated_at:
          format: date-time
          type: string
        endereco_entrega_cotacao:
          type: string
        fundo_ref:
          type: string
        id:
          type: string
        template_ccb:
          type: string
        updated_at:
          format: date-time
          type: string
      required:
        - id
        - fundo_ref
        - endereco_entrega_cotacao
        - template_ccb
        - ativo
        - created_at
        - updated_at
      type: object
    GetCalendarResponse:
      additionalProperties: false
      properties:
        competencia_atual:
          description: The rail's own current competência, yyyyMM (Número). It can differ from competencia_consulta on ANY call.
          examples:
            - "202603"
          type: string
        competencia_consulta:
          description: "The competência this read resolved to: your competencia filter, or the rail's current competência when you omitted it."
          examples:
            - "202410"
          type: string
        data_fim_competencia:
          description: End date of competencia_consulta (yyyy-MM-dd).
          examples:
            - "2024-09-20"
          type: string
        data_inicio_competencia:
          description: Start date of competencia_consulta (yyyy-MM-dd).
          examples:
            - "2024-08-21"
          type: string
      required:
        - competencia_atual
        - competencia_consulta
        - data_inicio_competencia
        - data_fim_competencia
      type: object
    GetResponse:
      additionalProperties: false
      properties:
        subscription:
          $ref: "#/components/schemas/SubscriptionRead"
      required:
        - subscription
      type: object
    InvalidEventItem:
      additionalProperties: false
      properties:
        attempts:
          description: How many dispatch attempts were spent before the row went terminal.
          examples:
            - 5
          format: int64
          type: integer
        created_at:
          description: When the fact was written, in UTC.
          examples:
            - "2026-08-14T09:12:33Z"
          format: date-time
          type: string
        definition_key:
          description: The fact's definition key. Empty on a row that does not carry a published fact.
          examples:
            - consignado.averbacao.confirmed
          type: string
        event_id:
          description: The fact's CloudEvents id, the one consumers deduplicate on. Empty on a row that does not carry a published fact.
          examples:
            - 00000000-0000-724f-a88c-bc9e1812cb16
          type: string
        event_type:
          description: The stable relay type the dispatcher routed on, not the business fact's name.
          examples:
            - lerian.streaming.publish
          type: string
        id:
          description: The outbox row's own identity, the id POST /v1/consignado/event-delivery/invalid/{id}/requeue takes to put this fact back in the dispatcher's queue.
          examples:
            - 0192f1a0-0000-7000-8000-00000000d301
          type: string
        last_error_class:
          description: The class of the last recorded failure. Never the error message, which can carry a tenant identifier, a contract number or a rail payload.
          enum:
            - serialization
            - broker_refused
            - broker_unreachable
            - tenant_unresolved
            - unclassified
          examples:
            - serialization
          type: string
        subject:
          description: "The fact's CloudEvents subject: the contract, request or record the fact is about. Empty for reconciliation and repasse facts, whose subject can carry an employer's CPF, and on a row that does not carry a published fact."
          examples:
            - contract-1
          type: string
        updated_at:
          description: When the row last changed status, in UTC.
          examples:
            - "2026-08-14T09:18:02Z"
          format: date-time
          type: string
      required:
        - id
        - event_type
        - definition_key
        - subject
        - event_id
        - attempts
        - last_error_class
        - created_at
        - updated_at
      type: object
    InvalidEventsPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/InvalidEventItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
      required:
        - items
        - page
      type: object
    KeysetPageMetadata:
      additionalProperties: false
      properties:
        after:
          description: The cursor this page resumed from, echoed back. Null when the read started at the beginning.
          examples:
            - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOToxMjozM1oiLCJrIjpbImMwMDEyIl19
          type:
            - string
            - "null"
        has_more:
          description: Whether at least one further page exists.
          examples:
            - true
          type: boolean
        next_after:
          description: The cursor for the page after this one. Null exactly when has_more is false.
          examples:
            - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOTowNzo1MVoiLCJrIjpbImMwMDM3Il19
          type:
            - string
            - "null"
      required:
        - after
        - next_after
        - has_more
      type: object
    LegadoContratoRenegociacao:
      additionalProperties: false
      properties:
        codigoIF:
          description: COMPE/CBC of the institution that holds this legado contract, 1 to 3 digits (§3.3.1).
          examples:
            - "999"
          maxLength: 3
          pattern: ^[0-9]{1,3}$
          type: string
        numeroContrato:
          description: "The legado contract's own number: 1 to 20 characters, livre escolha da instituição. This is not the new-contract 15-character alphanumeric-only field and cannot be blank or whitespace-only."
          examples:
            - 99999999999AL1
          maxLength: 20
          minLength: 1
          pattern: ^\S(.*\S)?$
          type: string
        numeroUnico:
          description: "NU de portabilidade. Populated ONLY when codigoTipoRenegociacao is 2 (Portabilidade) — the manual's own §3.3.1: 'Preenchido somente em caso de Portabilidade'. Modelled as a decimal string: at 21 digits it overflows an int64."
          examples:
            - "123456"
          pattern: ^[0-9]{1,21}$
          type: string
      required:
        - codigoIF
        - numeroContrato
      type: object
    LegadoExcluirBody:
      additionalProperties: false
      properties:
        cpfTrabalhador:
          description: Worker CPF, exactly 11 digits.
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        motivoExclusao:
          description: "Reason for the exclusion: 1 desistência, 2 falecimento, 3 liquidação antecipada, 7 ação judicial, 8 fraude, 9 outros. The set has holes at 4, 5 and 6 — the manual's own apêndice §4.1."
          enum:
            - 1
            - 2
            - 3
            - 7
            - 8
            - 9
          examples:
            - 9
          format: int64
          type: integer
      required:
        - cpfTrabalhador
        - motivoExclusao
      type: object
    LegadoIncluirBody:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          description: "Employer inscription type: 1 CNPJ, 2 CPF. Required when codigoTipoContrato is 2 (folha)."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        codigoTipoContrato:
          description: 1 = empréstimo não consignado sem garantia; 2 = empréstimo com descontos em folha de pagamento. When 2, codigoInscricaoEmpregador, numeroInscricaoEmpregador and matricula become required (§3.1.1, a condition the official Swagger does not express).
          enum:
            - 1
            - 2
          examples:
            - 2
          format: int64
          type: integer
        cpfTrabalhador:
          description: Worker CPF, exactly 11 digits.
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        dataFimContrato:
          description: End date of the legado contract, RFC 3339 UTC.
          examples:
            - "2025-12-23T00:00:00Z"
          format: date-time
          type: string
        dataInicioContrato:
          description: Start date of the legado contract, RFC 3339 UTC.
          examples:
            - "2024-09-03T00:00:00Z"
          format: date-time
          type: string
        matricula:
          description: Matrícula assigned to the worker by the employer. Required when codigoTipoContrato is 2 (folha).
          examples:
            - 99999999999-A
          maxLength: 30
          type: string
        numeroContrato:
          description: Number of the legado contract, freely chosen by the institution.
          examples:
            - 99999999999AL1
          maxLength: 20
          minLength: 1
          type: string
        numeroInscricaoEmpregador:
          description: "Employer inscription number: 14 digits for CNPJ, 11 for CPF (matching codigoInscricaoEmpregador; §3.1.1's own '15 algarismos' is a stale maximum, see ports.ValidateNumeroInscricaoEmpregador). Required when codigoTipoContrato is 2 (folha)."
          examples:
            - "42422253000101"
          pattern: ^[0-9]{11,14}$
          type: string
        numeroParcelas:
          description: Total number of instalments of the legado loan.
          examples:
            - 15
          format: int64
          maximum: 999
          minimum: 1
          type: integer
        qtdParcelasPagas:
          description: Number of instalments already paid.
          examples:
            - 7
          format: int64
          maximum: 999
          minimum: 0
          type: integer
        valorCETMensal:
          description: valorCETMensal — Custo Efetivo Total, monthly percent decimal string.
          examples:
            - "0.5"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorEmprestimo:
          description: valorEmprestimo — the legado loan's principal (decimal string, BRL).
          examples:
            - "12000.00"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorParcela:
          description: valorParcela — the legado loan's instalment amount (decimal string, BRL).
          examples:
            - "831.34"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorSaldoDevedor:
          description: valorSaldoDevedor — present value of the remaining instalments, base date the day of the request (Manual 007 §3.1.1's OWN definition, not Manual 015's — decimal string, BRL).
          examples:
            - "6512.46"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaMensal:
          description: valorTaxaMensal — monthly interest rate, percent decimal string.
          examples:
            - "0.5"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - cpfTrabalhador
        - codigoTipoContrato
        - numeroContrato
        - dataInicioContrato
        - dataFimContrato
        - numeroParcelas
        - qtdParcelasPagas
        - valorEmprestimo
        - valorParcela
        - valorSaldoDevedor
        - valorTaxaMensal
        - valorCETMensal
      type: object
    LegadoOperationResponse:
      additionalProperties: false
      properties:
        idempotent:
          description: True when the rail answered its own HX (incluir)/HY (excluir) idempotency code rather than fresh confirmation. On excluir (HY) this means the contract is confirmed gone, which is sound. On incluir (HX) it means ONLY that this numeroContrato is already registered on the rail — the values THIS request carried (valorEmprestimo, valorParcela, etc.) were NOT compared against what is stored. To correct a legado registered with wrong values, exclude it (motivo 9) and include it again; do not rely on idempotent:true as proof the stored values match.
          examples:
            - false
          type: boolean
        mensagem:
          description: The rail's own message.
          examples:
            - Emprestimo legado incluido com sucesso
          type: string
        numeroContrato:
          description: The contract number the rail confirmed the operation against.
          examples:
            - 99999999999AL1
          type: string
      required:
        - mensagem
        - numeroContrato
        - idempotent
      type: object
    LegadoRenegociarBody:
      additionalProperties: false
      properties:
        cnpjOperador:
          description: CNPJ of the operator (correspondente, cooperado or similar) responsible for the operation, exactly 14 digits, unpunctuated. Optional (§3.3.1) — omitted entirely rather than sent malformed; competenciaInicioDesconto below is the other optional field on this body. Dataprev performs no documental validation of legado data (§2.2.1.3), so this shape guard is the only one the CNPJ gets before the rail is spent.
          examples:
            - "99999999999962"
          pattern: ^[0-9]{14}$
          type: string
        codigoInscricaoEmpregador:
          description: "Employer inscription type: 1 CNPJ, 2 CPF."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        codigoTipoRenegociacao:
          description: 1 = Padrão; 2 = Portabilidade. Portabilidade requires at least one contratoLegado carrying numeroUnico; Padrão forbids numeroUnico on every item.
          enum:
            - 1
            - 2
          examples:
            - 1
          format: int64
          type: integer
        competenciaInicioDesconto:
          description: Payroll competência of the first deduction, yyyyMM. Optional; the rail assumes the current competência when omitted.
          examples:
            - "202504"
          pattern: ^[0-9]{6}$
          type: string
        contratosLegados:
          description: Every legado contract folded into this renegociação (§3.3.1, Obrigatório=Sim).
          examples:
            -   - codigoIF: "999"
                  numeroContrato: 99999999999AL1
          items:
            $ref: "#/components/schemas/LegadoContratoRenegociacao"
          minItems: 1
          type:
            - array
            - "null"
        cpfTrabalhador:
          description: Worker CPF, exactly 11 digits.
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        dataFimContrato:
          description: End date of the NEW consignado contract, RFC 3339 UTC.
          examples:
            - "2026-06-23T00:00:00Z"
          format: date-time
          type: string
        dataInicioContrato:
          description: Start date of the NEW consignado contract, RFC 3339 UTC.
          examples:
            - "2025-04-03T00:00:00Z"
          format: date-time
          type: string
        dataPrimeiroDesconto:
          description: Date of the first payroll deduction of the NEW contract, RFC 3339 UTC.
          examples:
            - "2025-04-23T00:00:00Z"
          format: date-time
          type: string
        matricula:
          description: Matrícula assigned to the worker by the employer. Cannot be blank or whitespace-only.
          examples:
            - 99999999999-A
          maxLength: 30
          pattern: ^\S(.*\S)?$
          type: string
        nomeTrabalhador:
          description: Worker's full name (Manual 007 §3.3.1 publishes 90 characters — the mirrored Swagger's 100 is not the bound this gateway enforces). Cannot be blank or whitespace-only.
          examples:
            - Trabalhador 99999999999
          maxLength: 90
          pattern: ^\S(.*\S)?$
          type: string
        numeroContrato:
          description: "The NEW contract's number, minted by the CLIENT: 2 to 15 letters or digits, without spaces, accents or symbols."
          examples:
            - 99999999999AN1
          maxLength: 15
          minLength: 2
          pattern: ^[A-Za-z0-9]+$
          type: string
        numeroInscricaoEmpregador:
          description: "Employer inscription number: 14 digits for CNPJ, 11 for CPF (matching codigoInscricaoEmpregador; §3.3.1's own '15 algarismos' is a stale maximum, see ports.ValidateNumeroInscricaoEmpregador)."
          examples:
            - "42422253000101"
          pattern: ^[0-9]{11,14}$
          type: string
        numeroParcelas:
          description: Total number of instalments of the NEW contract.
          examples:
            - 15
          format: int64
          maximum: 999
          minimum: 1
          type: integer
        valorCETAnual:
          description: valorCETAnual — Custo Efetivo Total, annual percent decimal string.
          examples:
            - "4.91"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorCETMensal:
          description: valorCETMensal — Custo Efetivo Total, monthly percent decimal string.
          examples:
            - "0.4"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorEmprestimo:
          description: valorEmprestimo — the new contract's principal (decimal string, BRL).
          examples:
            - "12000.00"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorIOF:
          description: valorIOF — the IOF charged, in reais (decimal string, BRL). Required by the manual despite the mirrored Swagger's required list omitting it.
          examples:
            - "0.00"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorLiberado:
          description: valorLiberado — amount delivered to the worker (decimal string, BRL). Required by the manual despite the mirrored Swagger's required list omitting it.
          examples:
            - "12000.00"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorParcela:
          description: valorParcela — the new contract's instalment amount (decimal string, BRL).
          examples:
            - "825.10"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaAnual:
          description: valorTaxaAnual — annual interest rate, percent decimal string. Must stay below the original legado contract's own rate — a comparison this gateway holds no local record of and leaves to the rail.
          examples:
            - "4.91"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaMensal:
          description: valorTaxaMensal — monthly interest rate, percent decimal string.
          examples:
            - "0.4"
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - codigoInscricaoEmpregador
        - cpfTrabalhador
        - dataFimContrato
        - dataInicioContrato
        - dataPrimeiroDesconto
        - matricula
        - nomeTrabalhador
        - numeroContrato
        - numeroInscricaoEmpregador
        - numeroParcelas
        - codigoTipoRenegociacao
        - contratosLegados
        - valorCETAnual
        - valorCETMensal
        - valorEmprestimo
        - valorIOF
        - valorLiberado
        - valorParcela
        - valorTaxaAnual
        - valorTaxaMensal
      type: object
    LegadoRenegociarContratoErro:
      additionalProperties: false
      properties:
        codigoIF:
          description: COMPE/CBC of the legado contract that failed.
          examples:
            - "999"
          type: string
        erros:
          description: Why this specific legado contract failed.
          items:
            $ref: "#/components/schemas/LegadoRenegociarErro"
          type:
            - array
            - "null"
        numeroContrato:
          description: Number of the legado contract that failed.
          examples:
            - 99999999999AL1
          type: string
      required:
        - codigoIF
        - numeroContrato
        - erros
      type: object
    LegadoRenegociarErro:
      additionalProperties: false
      properties:
        codigo:
          description: The rail's own error code.
          examples:
            - RC
          type: string
        mensagem:
          description: The rail's own error message.
          examples:
            - Vinculo nao permite renegociacao de legado
          type: string
      required:
        - codigo
        - mensagem
      type: object
    LegadoRenegociarResponse:
      additionalProperties: false
      properties:
        codigo:
          description: "The rail's own outcome code — a closed enum of roughly 290 values including SUCESSO. NOT redundant with the 200 status: read this field."
          examples:
            - SUCESSO
          type: string
        competenciaInicioDesconto:
          description: Payroll competência of the first deduction, yyyyMM.
          examples:
            - "202504"
          type: string
        erros:
          description: Top-level errors, if any.
          items:
            $ref: "#/components/schemas/LegadoRenegociarErro"
          type:
            - array
            - "null"
        errosContratosPortados:
          description: Per-legado-contract failures, if any. A non-empty list here does NOT mean the new contract failed to averbate.
          items:
            $ref: "#/components/schemas/LegadoRenegociarContratoErro"
          type:
            - array
            - "null"
        mensagem:
          description: The rail's own message.
          examples:
            - Renegociacao efetuada com sucesso
          type: string
        numeroContrato:
          description: The new contract's number, as confirmed by the rail.
          examples:
            - 99999999999AN1
          type: string
      required:
        - codigo
        - mensagem
        - numeroContrato
        - competenciaInicioDesconto
      type: object
    ListCededCreditsResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/CededCredit"
          type: array
      required:
        - items
      type: object
    ListEmploymentTerminationsResponse:
      additionalProperties: false
      properties:
        next_continuation_token:
          description: Opaque handle for the next page. EMPTY means the current snapshot is drained — stop paging. Pass it back as continuation_token to fetch the next page; it is minted by this gateway and refused (422) if it is not one of ours.
          examples:
            - ""
          type: string
        records:
          description: The termination records on this page.
          items:
            $ref: "#/components/schemas/EmploymentTerminationRecord"
          type:
            - array
            - "null"
      required:
        - records
        - next_continuation_token
      type: object
    ListFundosResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/Fundo"
          type: array
      required:
        - items
      type: object
    ListOriginadoresResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/Originador"
          type: array
      required:
        - items
      type: object
    ListResponse:
      additionalProperties: false
      properties:
        next_cursor:
          type: string
        subscriptions:
          items:
            $ref: "#/components/schemas/SubscriptionRead"
          type:
            - array
            - "null"
      required:
        - subscriptions
      type: object
    ListVinculosNovosResponse:
      additionalProperties: false
      properties:
        vinculos:
          description: The workers with a new employment bond included in the window. An empty list is the rail's answer, not an error.
          items:
            $ref: "#/components/schemas/VinculoNovoRecord"
          type:
            - array
            - "null"
      required:
        - vinculos
      type: object
    MarginConsent:
      additionalProperties: false
      properties:
        canalAutorizacaoDigital:
          description: "Digital channel the worker authorized through (1=ATM, 2=Agência, 3=Web Cliente, 4=Web Correspondente, 5=Mobile). Published enumeration: Manual 002 v1.15 §3.1.1 p.9."
          enum:
            - "1"
            - "2"
            - "3"
            - "4"
            - "5"
          examples:
            - "5"
          type: string
        dataHoraAutorizacaoDigital:
          description: Instant the worker authorized (RFC 3339, UTC).
          examples:
            - "2026-07-30T12:00:00Z"
          format: date-time
          type: string
        nsuAutorizacaoDigital:
          description: "Authorization Número Sequencial Único, up to 19 digits (Manual 002 v1.15 §3.1.1 p.8: Número, 19 algarismos — a maximum, not an exact width). A STRING: 19 digits exceed a 64-bit integer."
          examples:
            - "1234567890123456789"
          pattern: ^[0-9]{1,19}$
          type: string
      required:
        - canalAutorizacaoDigital
        - dataHoraAutorizacaoDigital
        - nsuAutorizacaoDigital
      type: object
    MarginEmployer:
      additionalProperties: false
      properties:
        activityStartDate:
          description: The employer's activity start date, YYYY-MM-DD, a calendar date (Manual 002 v1.15 §3.3.2 p.15, dataInicioAtividadeEmpregador). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
          examples:
            - "2013-04-01"
          format: date
          type: string
        cnae:
          $ref: "#/components/schemas/MarginTableCode"
          description: The employer's main activity, CNAE as a 7-digit string and the rail's label (Manual 002 v1.15 §3.3.2 p.14, cnae). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
        name:
          description: The employer's name as eSocial holds it — not necessarily the Receita's razão social (Manual 002 v1.15 §3.3.2 p.15, nomeEmpregador). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
          examples:
            - Vidraçaria Exemplo Ltda
          type: string
      type: object
    MarginEmployment:
      additionalProperties: false
      properties:
        admissionDate:
          description: Admission date, YYYY-MM-DD, a calendar date (Manual 002 v1.15 §3.3.2 p.15, dataAdmissao). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
          examples:
            - "2024-06-10"
          format: date
          type: string
        cbo:
          $ref: "#/components/schemas/MarginTableCode"
          description: The occupation, CBO as a 6-digit string and the rail's label (Manual 002 v1.15 §3.3.2 p.14, cbo). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
      type: object
    MarginRequest:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          description: "Employer inscription TYPE code: 1 = CNPJ, 2 = CPF."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        consent:
          $ref: "#/components/schemas/MarginConsent"
          description: The worker's grupo-1 consent evidence. Relayed verbatim; never synthesized here.
        contractRef:
          description: Client-chosen correlation reference echoed onto the emitted consignado.margin.fetched fact.
          examples:
            - req-1
          type: string
        cpf:
          description: "Worker CPF, exactly 11 digits — a CPF is eleven digits by definition (Manual 002 v1.15 §3.1.1 p.8 types the request field Número, 11 algarismos). Body-only by design: a path or query CPF lands in proxy and ingress logs."
          examples:
            - "12345678901"
          pattern: ^[0-9]{11}$
          type: string
        matricula:
          description: Employment bond matrícula (Texto 1..30, Manual 002 v1.15 §3.3.1, errors OT/SI).
          examples:
            - M-1
          maxLength: 30
          type: string
        numeroInscricaoEmpregador:
          description: "Employer inscription number, relayed verbatim as Texto. Required: Manual 002 v1.15 §3.3.1 marks it Obrigatório on the worker data read."
          examples:
            - "12345678000199"
          minLength: 1
          type: string
      required:
        - cpf
        - matricula
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
        - consent
      type: object
    MarginResponse:
      additionalProperties: false
      properties:
        activeOrSuspendedLoans:
          description: "How many consignados already sit active or suspended on this bond. Manual 002 v1.15 §3.3.2 p.17 publishes the ceiling: 9 per employment bond, so a bond at 9 takes no tenth however much margin it shows. Absent when the rail said nothing; 0 is a live count."
          examples:
            - 2
          format: int64
          type: integer
        asOf:
          description: Instant the gateway observed this margin (UTC).
          examples:
            - "2026-07-30T12:00:00Z"
          format: date-time
          type: string
        availableMargin:
          description: Available consignable margin (decimal string, BRL). Never a float.
          examples:
            - "1234.56"
          type: string
        availableRemuneration:
          description: Disposable remuneration base (decimal string, BRL). Never a float.
          examples:
            - "5000.00"
          type: string
        blockType:
          $ref: "#/components/schemas/RailCodeDescription"
          description: "The consignado block on this employment bond (Manual 002 v1.15 §3.3.2 table p.18: 0 no block, 1 blocked by the worker, 2 blocked by the MTE). A blocked bond can show a POSITIVE margin and still take no consignado, so this is not derivable from availableMargin. Code 0 is a live value."
        contractRef:
          description: The correlation reference the request supplied.
          examples:
            - req-1
          type: string
        eligible:
          description: "The rail's own eligibility verdict for this worker. ABSENT when the read carried no verdict — which is NOT the same statement as false. Decode into a nullable boolean: collapsing absence into false recreates a refusal the rail never made."
          examples:
            - true
          type: boolean
        employer:
          $ref: "#/components/schemas/MarginEmployer"
          description: "The employer's registration data as eSocial holds it (Manual 002 v1.15 §3.3.2). Absent when the rail sent none of it. It carries no trade name and no legal nature: Dataprev publishes neither."
        employment:
          $ref: "#/components/schemas/MarginEmployment"
          description: The employment bond's registration data (Manual 002 v1.15 §3.3.2). Absent when the rail sent none of it.
        grossPay:
          description: The worker's gross pay for the period the margin was computed against (decimal string, BRL). The denominator the margin is a slice of. Absent when the rail did not publish it — never "0".
          examples:
            - "7000.00"
          type: string
        ineligibilityReason:
          $ref: "#/components/schemas/RailCodeDescription"
          description: "WHY the rail refused (Manual 002 v1.15 §3.3.2 code table p.16: 1 legacy loan in eSocial, 2 legacy loan reported by the institution, 3 zero remuneration, 4 bond has a termination date, 5 no remuneration in the last competência, 6 invalid labour regime, 7 invalid worker category, 8 bond whose previous loan closed on termination, 9 employer not in the programme). The codes are not one kind: 3 and 5 clear with the next payroll competência, 4 never clears."
        severanceAvailablePercent:
          description: The share of severance pay available as collateral on this bond (Manual 002 v1.15 §3.3.2 p.17, NÚMERO(3,2)) — a PERCENT PER the manual, as an exact decimal string relayed verbatim and never converted. 40.00 means forty percent, not 0.40.
          examples:
            - "40.00"
          type: string
        terminationDate:
          description: The BOND's termination date (Manual 002 v1.15 §3.3.2 p.15). A bond with one has no future payroll for an instalment to be discounted from. Absent when the bond is not terminated.
          examples:
            - "2026-06-30T00:00:00Z"
          format: date-time
          type: string
        terminationReasonCode:
          description: The eSocial termination-reason code, relayed VERBATIM and never interpreted. Manual 002 v1.15 §3.3.2 p.15 types it "Número, 2 algarismos" and points at the eSocial "Motivos de Desligamento" table rather than reproducing it; JSON has no leading-zero literal, so a code beginning with 0 arrives one digit short and travels that way. Zero-pad to the published width before looking it up.
          examples:
            - "2"
          type: string
        worker:
          $ref: "#/components/schemas/MarginWorker"
          description: The worker's registration data as Dataprev returns it on this read (Manual 002 v1.15 §3.3.2). Absent when the rail sent none of it.
      required:
        - availableMargin
        - availableRemuneration
        - asOf
      type: object
    MarginTableCode:
      additionalProperties: false
      properties:
        code:
          description: The table code as a fixed-width digit string, leading zeros kept.
          examples:
            - "076"
          type: string
        description:
          description: The rail's own label for the code, relayed verbatim. Absent when the rail sent none.
          examples:
            - Brasil
          type: string
      required:
        - code
      type: object
    MarginWorker:
      additionalProperties: false
      properties:
        birthDate:
          description: Birth date, YYYY-MM-DD, a calendar date (Manual 002 v1.15 §3.3.2 p.15, dataNascimento). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
          examples:
            - "1990-09-04"
          format: date
          type: string
        categoryCode:
          description: The eSocial worker-category code as a 3-digit string (Manual 002 v1.15 §3.3.2 p.15, codigoCategoriaTrabalhador; the eSocial Categorias de Trabalhadores table). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
          examples:
            - "101"
          pattern: ^[0-9]{3}$
          type: string
        motherName:
          description: The worker's mother's name (Manual 002 v1.15 §3.3.2 p.15, nomeMae). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
          examples:
            - Beltrana de Tal
          type: string
        name:
          description: The worker's name (Manual 002 v1.15 §3.3.2 p.15, nome). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
          examples:
            - Fulano de Tal
          type: string
        nationality:
          $ref: "#/components/schemas/MarginTableCode"
          description: Nationality, ISO 3166-1 numeric as a 3-digit string ("076" is Brazil) and the rail's label (Manual 002 v1.15 §3.3.2 p.15, paisNacionalidade). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder.
        sex:
          $ref: "#/components/schemas/RailCodeDescription"
          description: "The worker's sex, code and the rail's own label (Manual 002 v1.15 §3.3.2 p.16 and table: 1 Masculino, 3 Feminino, 9 Não Informado). Absent when the rail sent nothing readable — never an empty string, a zero or a placeholder."
      type: object
    Originador:
      additionalProperties: false
      properties:
        ativo:
          type: boolean
        createdAt:
          format: date-time
          type: string
        deactivatedAt:
          format: date-time
          type: string
        id:
          type: string
        originadorRef:
          type: string
        portalBaseUrl:
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - id
        - originadorRef
        - ativo
        - createdAt
        - updatedAt
      type: object
    OriginadorAverbacaoRequest:
      additionalProperties: false
      properties:
        annual_rate:
          description: valorTaxaAnual as a PERCENT-per-year decimal string. "23.87" is 23.87 %/year — the effective compounding of monthly_rate 1.80.
          examples:
            - "23.87"
          type: string
        cet_annual:
          description: valorCETAnual — Custo Efetivo Total as a PERCENT-per-year decimal string (the effective compounding of cet_monthly).
          examples:
            - "25.34"
          type: string
        cet_monthly:
          description: valorCETMensal — Custo Efetivo Total as a PERCENT-per-month decimal string. Sits above monthly_rate because it absorbs IOF and fees.
          examples:
            - "1.90"
          type: string
        cnpj_operador:
          description: "CNPJ of the operator responsible for the operation — banking correspondent, cooperado or similar (Manual 003 §3.1.1 p.9, Obrigatório NÃO). An absent value is a legitimate \"no intermediary operator\": the adapter drops the field rather than sending an empty string."
          examples:
            - "98765432000188"
          type: string
        codigo_inscricao_empregador:
          description: "Employer inscription TYPE code. Manual 003 §3.1.1 p.10 publishes exactly two: 1 = CNPJ, 2 = CPF. REQUIRED on the wire (Obrigatório Sim, error SG); a value outside the enumeration is refused 422 before the rail is called."
          enum:
            - "1"
            - "2"
          examples:
            - "1"
          type: string
        contract_id:
          description: The CLIENT's own contract identity, echoed back on the response and used to correlate the emitted confirmed/rejected fact. Never minted here. 1..128 bytes of UTF-8 without leading or trailing spaces. With the booking block, one with control characters is refused 422 BOOKING_FIELD_INVALID before the rail is called, and so is one outside those bounds on a contract import.
          examples:
            - contract-1
          type: string
        cpf:
          description: Worker CPF, exactly 11 digits — a CPF is eleven digits by definition (Manual 002 v1.15 §3.1.1 p.8 types the request field Número, 11 algarismos). In the BODY, never a path or query parameter.
          examples:
            - "12345678901"
          pattern: ^[0-9]{11}$
          type: string
        dados_cadastrais:
          $ref: "#/components/schemas/DadosCadastrais"
          description: "Optional worker, employer, origination and disbursement-account record. Part of the semantic digest. Rendered once at averbação and stored with nome_trabalhador; that rendering, not the request bytes, is what the dados-cadastrais route serves and the digest covers. Provisional until the contract confirms: a documentation that sends its own dados_cadastrais replaces this block whole. Never sent to Dataprev. contract.registered carries only the SHA-256 of the final cadastro."
        data_fim_contrato:
          description: Contract end date, RFC 3339 UTC. A value other than data_primeiro_desconto plus (installment_count - 1) months does not block the averbação.
          examples:
            - "2027-07-30T00:00:00Z"
          format: date-time
          type: string
        data_inicio_contrato:
          description: "Contract start date, RFC 3339 UTC. With the booking block, data_fim_contrato, data_primeiro_desconto and expected_disbursement_date must not fall before it, and expected_disbursement_date must be before data_primeiro_desconto, compared as UTC calendar dates: the averbação route refuses that order 422 DECLARED_DATES_OUT_OF_ORDER before the rail is called."
          examples:
            - "2026-07-30T00:00:00Z"
          format: date-time
          type: string
        data_primeiro_desconto:
          description: Date of the first payroll deduction, RFC 3339 UTC; its UTC calendar date is what the rail and the Lerian lender receive. With the booking block, a date that is not a banking business day rolls to the next one, or back to the month's last one when the next falls in another month; the rolled date must be after expected_disbursement_date, or the averbação route refuses it 422 DECLARED_DATES_OUT_OF_ORDER before the rail is called.
          examples:
            - "2026-08-30T00:00:00Z"
          format: date-time
          type: string
        expected_disbursement_date:
          description: Expected loan disbursement date in YYYY-MM-DD. Required for every booking, including originations without numero_proposta. A date outside 2026 to 2099 is refused 422 CONTRACT_NOT_BOOKABLE by the averbação route before the rail is called.
          examples:
            - "2026-08-01"
          maxLength: 10
          type: string
        first_deduction_competencia:
          description: "Payroll competência of the first deduction, yyyyMM. With the booking block, data_primeiro_desconto must fall in this month or a later one: an earlier month is refused 422 FIRST_DEDUCTION_BEFORE_COMPETENCIA by the averbação route before the rail is called."
          examples:
            - "202608"
          type: string
        formalization_deadline:
          description: "UTC deadline by which the accepted contract must complete formalization. The documentation's data_hora_assinatura must not be after it, compared to the second: POST .../ccb-attachment refuses that 422 FORMALIZATION_DEADLINE_EXCEEDED before Dataprev is called."
          examples:
            - "2026-08-02T12:00:00Z"
          format: date-time
          type: string
        fundo_id:
          description: OPTIONAL fund the credit is attributed to, named by its register id as returned in the id field of GET /v1/consignado/fundos, in place of fundo_ref, which this route refuses 422. The gateway attributes that fund's reference exactly as fundo_ref does on the principal's route; an id the tenant does not register is refused 422. Omit it and the contract is attributed to no fund.
          examples:
            - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
          format: uuid
          type: string
        fundo_ref:
          description: |-
            OPTIONAL opaque UTF-8 fund reference, bounded to 128 bytes. It is preserved byte-for-byte without trimming, case folding, normalization, parsing, or a local character whitelist. NOT a rail field — the fund has no relationship with the rail, so it never crosses the wire; it is persisted and published unchanged. With the booking block, a value of only spaces is refused 422 BOOKING_FIELD_INVALID by the averbação route before the rail is called.

            VERIFIED against your credential. A fund, or a third party acting for one, may only name the fund its own credential carries: a different value is refused before the rail is called, and an omitted value is filled in from the credential. The comparison is exact bytes, so padding, letter case and accent composition are part of the fund's identity — send the reference exactly as it was issued to you. A bancarizador carries no fund of its own and may name one here; its value is taken as given, unchanged, and a present value must name a fund that still accepts new credit: one the tenant registered in this gateway, or one of the tenant's Lender fund registry, named by its Lender id (the lowercase UUID text of assignment_fund_id).

            OMIT it entirely and the contract is simply not attributed to any fund: nothing is looked up, nothing is refused, and the operation persists no fund at all. Which fund bought the credit is YOUR bookkeeping, not the rail's - the fund has no relationship with Dataprev.
          examples:
            - "  Fundo: Árvore/Classe A — série № 7  "
          maxLength: 128
          type: string
        installment_amount:
          description: valorParcela — the instalment amount (decimal string, BRL).
          examples:
            - "201.75"
          type: string
        installment_count:
          description: totalParcelas — the number of instalments. With the booking block, more than 96 is refused 422 CONTRACT_NOT_BOOKABLE by the averbação route before the rail is called.
          examples:
            - 12
          format: int64
          type: integer
        iof_amount:
          description: valorIOF — the IOF charged (decimal string, BRL).
          examples:
            - "10.00"
          type: string
        liberated_amount:
          description: "valorLiberado — \"o valor líquido repassado ao trabalhador após descontos\" (Manual 003 §3.1.1 p.9, Obrigatório Sim, errors BL/BQ), also required on the winning proposta (Manual 001 §3.1.2 p.10). DISTINCT from principal_amount and NOT derivable from it: the Manual 001 p.13 example quotes valorEmprestimo 2160.00 / valorIOF 10.00 with valorLiberado 2000.00. Never computed here."
          examples:
            - "2000.00"
          type: string
        loan_product_version:
          description: Immutable version of the loan product whose terms governed this contract, as a UUID. A value that is not a UUID, or the nil UUID, is refused 422 BOOKING_FIELD_INVALID by the averbação route before the rail is called. The averbação route also refuses, 422 RATE_OUTSIDE_PRODUCT_RANGE before the rail is called, a monthly_rate that times 12 falls outside the annual rate range the Lender published for this version; a version this gateway has not seen is not checked.
          examples:
            - 0f9d1a7c-3b52-4c8e-9a1d-2f6b8c4e5d70
          maxLength: 128
          type: string
        margin_snapshot:
          $ref: "#/components/schemas/AverbacaoMarginSnapshot"
        matricula:
          description: "The worker's payroll registration at the employer (Texto 1..30, errors OT/SI). REQUIRED on the wire: Manual 004 v1.6 §2.1.2 marks it Obrigatório S on the CCB attach and the attach reuses this one value."
          examples:
            - M-1
          maxLength: 30
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        monthly_rate:
          description: "valorTaxaMensal as a PERCENT-per-month decimal string. \"1.80\" is 1.80 %/month, NOT the fraction 0.018. With the booking block, the four rates must be greater than zero, annual_rate above monthly_rate, cet_annual above cet_monthly, each CET at least its interest rate, and monthly_rate times 12 at most 1000: the averbação route refuses otherwise 422 DECLARED_TERMS_INCONSISTENT before the rail is called."
          examples:
            - "1.80"
          type: string
        nome_trabalhador:
          description: "The worker's full name as it appears on the contract (Texto 1..90, errors AO/OT). REQUIRED: Manual 003 §3.1.1 marks nomeTrabalhador Obrigatório Sim, so a blank name is refused 422 before the rail is called."
          examples:
            - MARIA DA SILVA
          maxLength: 90
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        numero_contrato:
          description: "The rail contract number, minted by the CLIENT: 2 to 15 letters or digits, without spaces, accents or symbols. It MUST equal the numero_contrato path parameter — a mismatch is refused 422 so a caller cannot address one contract and averbar another."
          examples:
            - 99999999999AN1
          maxLength: 15
          minLength: 2
          pattern: ^[A-Za-z0-9]+$
          type: string
        numero_inscricao_empregador:
          description: Employer inscription NUMBER matching codigo_inscricao_empregador (Texto 14 since Manual 004 v1.6, error SH). REQUIRED on the wire.
          examples:
            - "12345678000199"
          type: string
        numero_proposta:
          description: "The optional proposal identifier this gateway minted for the winning bid. Absent means the origination did not pass through this gateway's auction. Present values are matched exactly: leading or trailing whitespace is refused, never normalized into another identity."
          examples:
            - "12345678901234567890"
          maxLength: 20
          pattern: ^[^\x00-\x1F\x7F-\x9F]*$
          patternDescription: free of control characters
          type: string
        origination_fee_amount:
          description: "OPTIONAL origination fee the client charges on this contract, in BRL as a canonical decimal with exactly two places (\"10.00\", \"0.00\"). Omitted means zero. It must be below principal_amount and is sent only with the booking block. It is the client's definitive declaration: the gateway never derives it from the other terms and it is carried unchanged on consignado.contract.registered. NOT a rail field: it never reaches Dataprev."
          examples:
            - "10.00"
          maxLength: 20
          type: string
        perc_verba_rescisoria_garantia:
          description: Percentage of the rescission verbas pledged as collateral (decimal string, PERCENT). This rides the SEPARATE employer verba-rescisória track, not the FGTS-guarantee execution API.
          examples:
            - "10.00"
          type: string
        preparation:
          $ref: "#/components/schemas/AverbacaoPreparation"
          description: "OPTIONAL references to a preparation the client obtained from the Lerian lender before averbação: the quote, the CCB instrument issued from it and the SHA-256 of that original CCB. All three are required when the object is sent, and it is sent only with the booking block. They are the client's declarations: the gateway checks their shape, never looks them up, and carries them unchanged on consignado.contract.registered. NOT a rail field: it never reaches Dataprev."
        principal_amount:
          description: "valorEmprestimo — the amount lent (decimal string, BRL). DISTINCT from liberated_amount and not derivable from it: the Manual 001 §3.1.2 p.13 example quotes valorEmprestimo 2160.00 / valorIOF 10.00 with valorLiberado 2000.00. With the booking block, principal_amount, liberated_amount and installment_amount must be greater than zero, and neither liberated_amount nor iof_amount may exceed principal_amount: the averbação route refuses otherwise 422 DECLARED_TERMS_INCONSISTENT before the rail is called."
          examples:
            - "2160.00"
          type: string
        tem_garantias:
          description: Whether the contract pledges FGTS collateral. REQUIRED — it is the gate the three collateral values below are conditional on, and false is an authoritative "no collateral" rather than an absence. False with any of them, or true with none, is refused 422 by the averbação route before the rail is called (Dataprev rule FI).
          examples:
            - true
          type: boolean
        valor_multa_rescisoria_garantia_fgts:
          description: Rescission-penalty portion pledged as collateral (decimal string, BRL). Conditional on tem_garantias; omit rather than send 0.
          examples:
            - "400.25"
          type: string
        valor_saldo_disponivel_garantia_fgts:
          description: "Consignable FGTS balance pledged as collateral (decimal string, BRL). Conditional on tem_garantias. OMIT it when there is no FGTS collateral: the rail reads a sent 0 as an invalid guarantee value."
          examples:
            - "1000.50"
          type: string
      required:
        - contract_id
        - numero_contrato
        - cpf
        - principal_amount
        - installment_amount
        - installment_count
        - annual_rate
        - cet_monthly
        - cet_annual
        - iof_amount
        - first_deduction_competencia
        - matricula
        - nome_trabalhador
        - codigo_inscricao_empregador
        - numero_inscricao_empregador
        - data_inicio_contrato
        - data_fim_contrato
        - data_primeiro_desconto
        - monthly_rate
        - liberated_amount
        - tem_garantias
      type: object
    PingResponse:
      additionalProperties: false
      properties:
        errorClass:
          description: Coarse error class; empty on success.
          type: string
        outcome:
          description: Delivery outcome.
          examples:
            - ok
          type: string
        statusCode:
          description: Sink HTTP status code.
          examples:
            - 200
          format: int64
          type: integer
      required:
        - outcome
        - statusCode
        - errorClass
      type: object
    PortabilidadeAverbacaoRequest:
      additionalProperties: false
      properties:
        cnpjOperador:
          description: OPTIONAL correspondent/cooperado CNPJ.
          examples:
            - "12345678000199"
          maxLength: 14
          type: string
        codigoInscricaoEmpregador:
          description: 1 CNPJ, 2 CPF.
          examples:
            - "1"
          pattern: ^[12]$
          type: string
        competenciaInicioDesconto:
          description: OPTIONAL. yyyyMM.
          examples:
            - "202602"
          pattern: ^[0-9]{6}$
          type: string
        cpfTrabalhador:
          description: Worker CPF, 11 digits.
          examples:
            - "99999999999"
          pattern: ^[0-9]{11}$
          type: string
        dataExclusaoOrigem:
          description: OPTIONAL. Origin exclusion date the client tracks, NEVER sent to Dataprev. When present, the gateway's own 20-calendar-day pre-rail refusal is judged against it. When absent, this averbação is submitted as occurring BEFORE the origin exclusion (Manual 008 §4 permits either order).
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        dataFimContrato:
          description: Contract end date.
          examples:
            - "2031-01-01T00:00:00Z"
          format: date-time
          type: string
        dataInicioContrato:
          description: Contract start date.
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        dataPrimeiroDesconto:
          description: First payroll discount date.
          examples:
            - "2026-02-01T00:00:00Z"
          format: date-time
          type: string
        matricula:
          description: Worker registration number at the employer.
          examples:
            - 99999999999-A
          maxLength: 30
          minLength: 1
          type: string
        nomeTrabalhador:
          description: Worker's full name. Manual 008 §5.3.1 publishes 90 characters; the mirrored Swagger publishes maxLength 100 for the same field — the wider bound is accepted here so a value the rail itself would honour is never rejected first.
          examples:
            - Trabalhador 99999999999
          maxLength: 100
          minLength: 1
          type: string
        numeroContrato:
          description: "Contract number being averbado, minted by the CLIENT: 2 to 15 letters or digits, without spaces, accents or symbols (Manual 008 §5.3.1 and its note [2]; the Swagger's maxLength 20 is not followed)."
          examples:
            - "199971600000"
          maxLength: 15
          minLength: 2
          pattern: ^[A-Za-z0-9]+$
          type: string
        numeroInscricaoEmpregador:
          description: Employer inscription number.
          examples:
            - "99999999999881"
          maxLength: 15
          minLength: 1
          type: string
        numeroParcelas:
          description: Number of instalments.
          examples:
            - 48
          format: int64
          maximum: 999
          minimum: 1
          type: integer
        numeroProposta:
          description: OPTIONAL. Manual-only field of undocumented referent — see the operation description.
          examples:
            - 7K9M2P4R6T8V3W5X2Y4Z
          maxLength: 20
          type: string
        percVerbaRescisoriaGarantia:
          description: OPTIONAL severance-pay percentage pledged as collateral.
          examples:
            - "15.00"
          maxLength: 6
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        temGarantias:
          description: Whether this averbação pledges FGTS collateral. True with none of the three collateral values below is refused 422 before the rail is called (Dataprev rule FI).
          examples:
            - false
          type: boolean
        valorCETAnual:
          description: Annual total effective cost in percent.
          examples:
            - "11.00"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorCETMensal:
          description: Monthly total effective cost in percent.
          examples:
            - "0.90"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorEmprestimo:
          description: Principal plus financed costs as an exact decimal string.
          examples:
            - "2160.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorMultaRescisoriaGarantiaFgts:
          description: OPTIONAL rescission-penalty amount pledged as collateral.
          examples:
            - "300.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorPago:
          description: Settlement amount for the ORIGINAL contract(s) being ported — a field unique to this averbação.
          examples:
            - "2000.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorParcela:
          description: Instalment amount as an exact decimal string.
          examples:
            - "180.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorSaldoDisponivelGarantiaFgts:
          description: OPTIONAL consignable FGTS balance pledged as collateral.
          examples:
            - "600.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaAnual:
          description: Annual interest rate in percent.
          examples:
            - "10.00"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaMensal:
          description: Monthly interest rate in percent.
          examples:
            - "0.80"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - numeroContrato
        - cpfTrabalhador
        - matricula
        - nomeTrabalhador
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
        - dataPrimeiroDesconto
        - dataInicioContrato
        - dataFimContrato
        - numeroParcelas
        - valorParcela
        - valorEmprestimo
        - valorPago
        - valorTaxaAnual
        - valorTaxaMensal
        - valorCETAnual
        - valorCETMensal
        - temGarantias
      type: object
    PortabilidadeAverbacaoResponseBody:
      additionalProperties: false
      properties:
        codigoSucesso:
          description: Bounded rail outcome code, relayed verbatim. Free-form provider text is never returned.
          examples:
            - BD
          maxLength: 32
          pattern: ^[A-Za-z0-9_-]*$
          type: string
        competenciaInicioDesconto:
          description: First payroll-discount competência (yyyyMM) echoed by Dataprev.
          examples:
            - 202602
          format: int64
          type: integer
        mensagem:
          description: Rail message, relayed verbatim.
          examples:
            - Averbacao realizada com sucesso
          type: string
        numeroContrato:
          description: Contract number echoed by Dataprev.
          examples:
            - "199971600000"
          type: string
        numeroUnico:
          description: The portability identity addressed by this averbação.
          examples:
            - "100000000000000000001"
          type: string
        submittedAt:
          description: UTC instant the gateway submitted this averbação.
          examples:
            - "2026-01-15T00:00:00Z"
          format: date-time
          type: string
      required:
        - numeroUnico
        - submittedAt
        - codigoSucesso
        - numeroContrato
        - competenciaInicioDesconto
      type: object
    PortabilidadeCodigoDescricaoResponse:
      additionalProperties: false
      properties:
        codigo:
          description: The rail's code, relayed verbatim.
          examples:
            - 1
          format: int64
          type: integer
        descricao:
          description: The rail's own label for the code, relayed verbatim.
          examples:
            - Encerrado por prazo
          type: string
      required:
        - codigo
        - descricao
      type: object
    PortabilidadeConsultaRequestBody:
      additionalProperties: false
      properties:
        classificador_situacao:
          description: "OPTIONAL filter: 0 Aberto, 1 Encerrado por prazo, 2 Encerrado por averbação, 3 Encerrado por alteração do Número Único."
          examples:
            - "1"
          pattern: ^[0-3]?$
          type: string
        codigo_inscricao_empregador:
          description: "OPTIONAL filter: 1 CNPJ, 2 CPF."
          examples:
            - "1"
          pattern: ^[12]?$
          type: string
        codigo_origem:
          description: "OPTIONAL filter: the origin institution's code."
          examples:
            - "899"
          type: string
        data_fim_operacao:
          description: "OPTIONAL filter: operation window end."
          examples:
            - "2026-02-01T00:00:00Z"
          format: date-time
          type: string
        data_inicio_operacao:
          description: "OPTIONAL filter: operation window start."
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        matricula:
          description: "OPTIONAL filter: worker registration number."
          examples:
            - 99999999999-A
          maxLength: 30
          type: string
        numero_inscricao_empregador:
          description: "OPTIONAL filter: employer inscription number."
          examples:
            - "99999999999881"
          maxLength: 15
          type: string
        numero_unico:
          description: "OPTIONAL filter: the portability's NSU."
          examples:
            - "100000000000000000001"
          maxLength: 21
          pattern: ^[0-9]{0,21}$
          type: string
        page:
          default: 1
          description: 1-based page number, relayed to the rail's nroPagina.
          examples:
            - 1
          format: int64
          minimum: 1
          type: integer
      type: object
    PortabilidadeConsultaResponseBody:
      additionalProperties: false
      properties:
        has_more:
          description: Whether a further page exists.
          examples:
            - false
          type: boolean
        page:
          description: 1-based page number, echoed from the rail.
          examples:
            - 1
          format: int64
          type: integer
        registros:
          items:
            $ref: "#/components/schemas/PortabilidadeEfetivacaoResponse"
          type:
            - array
            - "null"
        size:
          description: Page size the rail is paginating with.
          examples:
            - 10
          format: int64
          type: integer
      required:
        - registros
        - page
        - size
        - has_more
      type: object
    PortabilidadeEfetivacaoResponse:
      additionalProperties: false
      properties:
        classificadorSituacao:
          $ref: "#/components/schemas/PortabilidadeCodigoDescricaoResponse"
          description: 0 Aberto, 1 Encerrado por prazo, 2 Encerrado por averbação, 3 Encerrado por alteração do Número Único — relayed verbatim, never re-derived.
        codigoInscricaoEmpregador:
          description: 1 CNPJ, 2 CPF. ABSENT when the rail's value was unreadable — never reported as 0, which is not a published code.
          examples:
            - 1
          format: int64
          type: integer
        codigoProponente:
          $ref: "#/components/schemas/PortabilidadeCodigoDescricaoResponse"
        contratosExcluidos:
          items:
            $ref: "#/components/schemas/PortabilidadeExclusaoRegistradaResponse"
          type:
            - array
            - "null"
        cpfTrabalhador:
          description: Worker CPF, relayed verbatim in the response BODY — never a path or query parameter.
          examples:
            - "99999999999"
          type: string
        dataAverbacao:
          description: "UTC instant of the averbação, when it has occurred. Absent until then: omitempty never elides a zero time.Time, omitzero does."
          examples:
            - "2026-01-05T00:00:00Z"
          format: date-time
          type: string
        dataInclusaoPortabilidade:
          description: UTC instant the portability was included on the rail.
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        matricula:
          description: Worker registration number.
          examples:
            - 99999999999-A
          type: string
        numeroContratoAverbado:
          description: The destination contract number, once averbado.
          examples:
            - "199971600000"
          type: string
        numeroInscricaoEmpregador:
          description: Employer inscription number.
          examples:
            - "99999999999881"
          type: string
        numeroUnico:
          description: The portability's NSU.
          examples:
            - "100000000000000000001"
          type: string
        numeroUnicoNovo:
          description: The new NSU, when this portability was redirected by an alteration of the number único.
          examples:
            - "100000000000000000002"
          type: string
      required:
        - numeroUnico
        - cpfTrabalhador
        - matricula
        - numeroInscricaoEmpregador
        - dataInclusaoPortabilidade
      type: object
    PortabilidadeExclusaoRegistradaResponse:
      additionalProperties: false
      properties:
        codigoOrigem:
          $ref: "#/components/schemas/PortabilidadeCodigoDescricaoResponse"
        dataExclusao:
          description: UTC instant of the origin exclusion.
          examples:
            - "2026-01-02T00:00:00Z"
          format: date-time
          type: string
        numeroContratoExcluido:
          description: The origin contract number this portability excluded.
          examples:
            - "199971600001"
          type: string
        ultimaParcelaPaga:
          description: Last instalment paid on the excluded contract. 0 is a live value (exclusion before any instalment was paid), so the field is always present.
          examples:
            - 3
          format: int64
          type: integer
      required:
        - numeroContratoExcluido
        - dataExclusao
        - ultimaParcelaPaga
      type: object
    PortabilityAuctionContactRequest:
      additionalProperties: false
      properties:
        contato:
          description: Client-supplied contact value.
          examples:
            - bidder@example.com
          maxLength: 4000
          minLength: 1
          type: string
        tipo:
          description: "Client contact type: 0 URL, 1 WhatsApp, 2 phone, 3 email, 4 other."
          examples:
            - 3
          format: int64
          maximum: 4
          minimum: 0
          type: integer
      required:
        - tipo
        - contato
      type: object
    PortabilityAuctionResponseRequest:
      additionalProperties: false
      properties:
        contatos:
          description: Client contacts.
          items:
            $ref: "#/components/schemas/PortabilityAuctionContactRequest"
          maxItems: 4
          type:
            - array
            - "null"
        dataHoraValidadeProposta:
          description: This proposal's own validity instant — a SEPARATE validity from dataHoraValidadeSolicitacao above, informed by the client (Manual 011 v1.6 §3.2.1).
          examples:
            - "2030-01-01T10:00:00Z"
          format: date-time
          type: string
        dataHoraValidadeSolicitacao:
          description: The portability solicitação's own validity instant, echoed from the consignado.portability_proposal.received fact (Manual 011 v1.6 §3.1.3). Authoritative per record; judged against the gateway's clock before the rail is called.
          examples:
            - "2025-10-30T23:45:29Z"
          format: date-time
          type: string
        numeroParcelas:
          description: Number of instalments.
          examples:
            - 12
          format: int64
          maximum: 999
          minimum: 1
          type: integer
        numeroProposta:
          description: Proposal identifier this gateway mints.
          examples:
            - 7K9M2P4R6T8V3W5X2Y4Z
          maxLength: 20
          minLength: 1
          type: string
        percVerbaRescisoriaGarantia:
          description: Optional severance-pay percentage pledged as collateral.
          examples:
            - "15.00"
          maxLength: 6
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        temGarantias:
          description: Whether this proposal pledges FGTS collateral.
          examples:
            - false
          type: boolean
        valorCETAnual:
          description: Annual total effective cost in percent.
          examples:
            - "11.00"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorCETMensal:
          description: Monthly total effective cost in percent.
          examples:
            - "0.90"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorEmprestimo:
          description: Principal plus financed costs as an exact decimal string.
          examples:
            - "2160.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorMultaRescisoriaGarantiaFgts:
          description: Optional rescission-penalty amount pledged as collateral.
          examples:
            - "300.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorParcela:
          description: Instalment amount as an exact decimal string.
          examples:
            - "180.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorSaldoDisponivelGarantiaFgts:
          description: Optional consignable FGTS balance pledged as collateral.
          examples:
            - "600.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaAnual:
          description: Annual interest rate in percent.
          examples:
            - "10.00"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaMensal:
          description: Monthly interest rate in percent.
          examples:
            - "0.80"
          maxLength: 10
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - dataHoraValidadeSolicitacao
        - numeroProposta
        - dataHoraValidadeProposta
        - numeroParcelas
        - valorEmprestimo
        - valorParcela
        - valorTaxaAnual
        - valorTaxaMensal
        - valorCETAnual
        - valorCETMensal
        - temGarantias
      type: object
    PortabilityAuctionResponseResponse:
      additionalProperties: false
      properties:
        accepted:
          description: True only when the rail's codigo equalled the observed success code.
          examples:
            - true
          type: boolean
        codigo:
          description: Bounded rail outcome code, relayed verbatim. Free-form provider text is never returned.
          examples:
            - BD
          maxLength: 32
          pattern: ^[A-Za-z0-9_-]*$
          type: string
        dataHoraValidadeProposta:
          description: Proposal validity echoed by Dataprev.
          examples:
            - "2030-01-01T10:00:00Z"
          format: date-time
          type: string
        hashOperacao:
          description: Opaque rail audit identifier, when published.
          examples:
            - "34027710"
          type: string
        idSolicitacaoProposta:
          description: The solicitação identity addressed by this response.
          examples:
            - "221"
          type: string
        numeroProposta:
          description: Proposal identifier echoed by Dataprev.
          examples:
            - 7K9M2P4R6T8V3W5X2Y4Z
          type: string
        submittedAt:
          description: UTC instant the gateway submitted this proposal.
          examples:
            - "2025-10-28T00:00:00Z"
          format: date-time
          type: string
      required:
        - idSolicitacaoProposta
        - submittedAt
        - accepted
        - codigo
        - numeroProposta
        - dataHoraValidadeProposta
      type: object
    PutCertificateRequest:
      additionalProperties: false
      properties:
        certPem:
          description: PEM-encoded ICP-Brasil A1 client certificate chain.
          maxLength: 1048576
          minLength: 1
          type: string
        keyPem:
          description: PEM-encoded private key for the client certificate.
          maxLength: 1048576
          minLength: 1
          type: string
      required:
        - certPem
        - keyPem
      type: object
    PutCodigoSolicitanteRequest:
      additionalProperties: false
      properties:
        codigoSolicitante:
          description: "The institution's BACEN COMPE code: exactly 3 digits, zero-padded (Manual 002 v1.15 §3.1.1 p.8), in the range 001-999 (Manual 001 §3.1.2 p.10). COMPE 55 is published as 055; 000 is not a code."
          examples:
            - "341"
          pattern: ^(00[1-9]|0[1-9][0-9]|[1-9][0-9][0-9])$
          type: string
      required:
        - codigoSolicitante
      type: object
    PutCustodyRequest:
      additionalProperties: false
      properties:
        certPem:
          description: PEM-encoded ICP-Brasil A1 client certificate chain.
          maxLength: 1048576
          minLength: 1
          type: string
        clientId:
          description: OAuth2 client_credentials client id.
          maxLength: 512
          minLength: 1
          type: string
        clientSecret:
          description: OAuth2 client_credentials client secret.
          maxLength: 4096
          minLength: 1
          type: string
        keyPem:
          description: PEM-encoded private key for the client certificate.
          maxLength: 1048576
          minLength: 1
          type: string
      required:
        - certPem
        - keyPem
        - clientId
        - clientSecret
      type: object
    PutOAuthRequest:
      additionalProperties: false
      properties:
        clientId:
          description: OAuth2 client_credentials client id.
          maxLength: 512
          minLength: 1
          type: string
        clientSecret:
          description: OAuth2 client_credentials client secret.
          maxLength: 4096
          minLength: 1
          type: string
      required:
        - clientId
        - clientSecret
      type: object
    PutPortalBaseURLRequest:
      additionalProperties: false
      properties:
        portalBaseUrl:
          description: Base URL of the tenant's worker portal. Must use HTTPS, contain no credentials or fragment, and be at most 255 characters. When a tenant registers one, the gateway injects it as the type 0 contact of each bid proposal that carries no portalBaseUrl of its own and names no originador with a registered portal. Registering a portal is optional.
          examples:
            - https://portal.example.com/formalizacao
          format: uri
          maxLength: 255
          pattern: ^https://[^/?#@]+([/?][^#]*)?$
          type: string
      required:
        - portalBaseUrl
      type: object
    PutThroughputRequest:
      additionalProperties: false
      properties:
        requestsPerSecond:
          description: The outbound Dataprev rail rate to set for this tenant, in requests per second, within the rail's 0..25 contract. Zero is a deliberate self-service pause and stops this tenant's outbound rail; it is accepted, not refused. Setting the value the tenant already holds succeeds without recording a transition.
          examples:
            - 10
          format: int64
          type: integer
      required:
        - requestsPerSecond
      type: object
    RailCodeDescription:
      additionalProperties: false
      properties:
        code:
          description: The rail's code, relayed verbatim.
          examples:
            - 5
          format: int64
          type: integer
        description:
          description: The rail's own label for the code, relayed verbatim.
          examples:
            - Sem remuneração na última competência
          type: string
      required:
        - code
        - description
      type: object
    RailCommandItem:
      additionalProperties: false
      properties:
        command:
          description: The rail mutation this durable row authorized.
          enum:
            - refinanciamento
            - reversao_refinanciamento
            - renegociacao
            - exclusao_portabilidade
            - antecipacao_incluir
            - antecipacao_excluir
            - legado_incluir
            - legado_renegociar
            - legado_excluir
            - suspensao
            - reativacao
            - alteracao_termos
          examples:
            - refinanciamento
          type: string
        id:
          description: The durable row's own identity and the tiebreaker that makes this book's order total.
          examples:
            - 7abc2d1e-4f56-4a3b-98c0-1d2e3f4a5b6c
          type: string
        invocation_deadline_at:
          description: The invocation window's close, in UTC. Always strictly after invoking_at.
          examples:
            - "2026-08-14T09:13:03Z"
          format: date-time
          type: string
        invoking_at:
          description: The row's own claim instant in UTC, frozen by the ledger's mutation trigger, and the leading column of this book's order.
          examples:
            - "2026-08-14T09:12:33Z"
          format: date-time
          type: string
        numero_contrato:
          description: The contract the mutation was aimed at, which for the contract-minting commands is the NEW contract.
          examples:
            - 99999999999AN1
          type: string
        outcome_at:
          description: When the answer was established, in UTC. Null until one was.
          examples:
            - "2026-08-14T09:14:10Z"
          format: date-time
          type:
            - string
            - "null"
        response_code:
          description: The rail's answer code. Null on an invoking row, which the ledger's own constraint demands.
          examples:
            - "00"
          type:
            - string
            - "null"
        response_message:
          description: The rail's answer message, which on a refusal is the reason an operator came to this screen to read. Null on an invoking row.
          examples:
            - Operacao processada com sucesso
          type:
            - string
            - "null"
        status:
          description: The situation this rail command is durably parked in.
          enum:
            - invoking
            - accepted
            - rejected
            - outcome_unknown
          examples:
            - accepted
          type: string
        unknown_at:
          description: When the row was parked as outcome_unknown, in UTC. It SURVIVES on a closed row, which is what tells a clean acceptance from a recovered one. Null on a row that never passed through ambiguity.
          examples:
            - "2026-08-14T09:13:04Z"
          format: date-time
          type:
            - string
            - "null"
      required:
        - id
        - command
        - numero_contrato
        - status
        - invoking_at
        - invocation_deadline_at
        - unknown_at
        - outcome_at
        - response_code
        - response_message
      type: object
    RailCommandsPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/RailCommandItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
        unlogged_operations:
          description: "Rail operationIds this gateway runs WITHOUT writing a durable row, so their absence from the book above is not evidence they were never called. It names TWO operations today, both on the portability path: averbarConsignadoPortabilidade and respondConsignadoPortabilityAuction. Their command services hold no durable store of any kind, so this gateway cannot report what the rail was told or what it answered — and portability moves a consignado contract between institutions. The field is published even when empty, so a client can tell that from a gateway that stopped reporting it."
          items:
            type: string
          type: array
      required:
        - items
        - page
        - unlogged_operations
      type: object
    RefinanciamentoBody:
      additionalProperties: false
      properties:
        cnpjOperador:
          description: CNPJ of the operator (correspondent, cooperado or similar) responsible for the operation. Optional, Texto since v1.7.
          examples:
            - "12345678000199"
          maxLength: 14
          type: string
        codigoInscricaoEmpregador:
          description: "Employer inscription type: 1 CNPJ, 2 CPF."
          examples:
            - "1"
          pattern: ^[12]$
          type: string
        competenciaInicioDesconto:
          description: Payroll competência of the first deduction, yyyyMM. Optional.
          examples:
            - "202507"
          pattern: ^[0-9]{6}$
          type: string
        cpfTrabalhador:
          description: Worker CPF, 11 digits.
          examples:
            - "99999999999"
          maxLength: 11
          minLength: 11
          pattern: ^[0-9]{11}$
          type: string
        dataFimContrato:
          description: End date of the new consignado contract, RFC 3339 UTC.
          examples:
            - "2027-07-10T00:00:00Z"
          format: date-time
          type: string
        dataInicioContrato:
          description: Start date of the new consignado contract, RFC 3339 UTC.
          examples:
            - "2025-06-11T00:00:00Z"
          format: date-time
          type: string
        dataPrimeiroDesconto:
          description: Date of the first payroll deduction, RFC 3339 UTC.
          examples:
            - "2025-07-10T00:00:00Z"
          format: date-time
          type: string
        listaContratosQuitadosTrabalhador:
          description: Every contract this refinanciamento quits. Each must be held by this gateway for the authenticated tenant.
          examples:
            -   - numeroContrato: 99999999999AR1
          items:
            $ref: "#/components/schemas/RefinanciamentoContratoQuitado"
          minItems: 1
          type:
            - array
            - "null"
        matricula:
          description: Matrícula assigned to the worker by the employer.
          examples:
            - 99999999999-A
          maxLength: 30
          type: string
        nomeTrabalhador:
          description: Worker's full name.
          examples:
            - Trabalhador 99999999999
          maxLength: 90
          type: string
        numeroInscricaoEmpregador:
          description: Employer inscription number, Texto since Manual 008 v1.7 (the mirrored Swagger still types this int64).
          examples:
            - "99999999999881"
          maxLength: 14
          type: string
        numeroParcelas:
          description: Number of instalments of the new contract, capped at the manual's own 3-digit field width (Manual 008 §3.1.1 p.10).
          examples:
            - 24
          format: int64
          maximum: 999
          minimum: 1
          type: integer
        percVerbaRescisoriaGarantia:
          description: Percentage of severance pay pledged as collateral, 0 to 35%.
          examples:
            - "15"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        temGarantias:
          description: Whether FGTS collateral secures the new contract. When true, exactly one contract may be named in lista_contratos_quitados_trabalhador (regra FR) and at least one of the three garantia values below must be informed (regra FI).
          examples:
            - true
          type: boolean
        valorCETAnual:
          description: valorCETAnual — Custo Efetivo Total, annual percent decimal string.
          examples:
            - "7.26"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorCETMensal:
          description: valorCETMensal — Custo Efetivo Total, monthly percent decimal string.
          examples:
            - "0.59"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorEmprestimo:
          description: valorEmprestimo — the new contract's principal (decimal string, BRL).
          examples:
            - "9018.54"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorIOF:
          description: valorIOF — the IOF charged, in reais (decimal string, BRL).
          examples:
            - "94.95"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorMultaRescisoriaGarantiaFgts:
          description: FGTS termination-fine collateral, up to 100% of the 40% fine (decimal string, BRL). Optional individually.
          examples:
            - "300.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorPago:
          description: valorPago — settlement amount paid to quit the original contracts (decimal string, BRL).
          examples:
            - "6114.50"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorParcela:
          description: valorParcela — the new contract's instalment amount (decimal string, BRL).
          examples:
            - "400.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorSaldoDisponivelGarantiaFgts:
          description: FGTS balance pledged as collateral (decimal string, BRL). Optional individually; at least one of the three garantia values is required when temGarantias is true.
          examples:
            - "600.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaAnual:
          description: valorTaxaAnual — annual interest rate, percent decimal string.
          examples:
            - "6.17"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaMensal:
          description: valorTaxaMensal — monthly interest rate, percent decimal string.
          examples:
            - "0.5"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTroco:
          description: valorTroco — amount delivered to the client after settling the quitados contracts (decimal string, BRL).
          examples:
            - "2809.09"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - cpfTrabalhador
        - matricula
        - nomeTrabalhador
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
        - dataInicioContrato
        - dataFimContrato
        - dataPrimeiroDesconto
        - numeroParcelas
        - valorEmprestimo
        - valorParcela
        - valorIOF
        - valorPago
        - valorTroco
        - valorTaxaAnual
        - valorTaxaMensal
        - valorCETAnual
        - valorCETMensal
        - listaContratosQuitadosTrabalhador
        - temGarantias
      type: object
    RefinanciamentoContratoQuitado:
      additionalProperties: false
      properties:
        numeroContrato:
          description: Contract number being quit by this refinanciamento. Must be held by this gateway for the authenticated tenant.
          examples:
            - 99999999999AR1
          maxLength: 15
          minLength: 2
          type: string
      required:
        - numeroContrato
      type: object
    RefinanciamentoOperationResponse:
      additionalProperties: false
      properties:
        competenciaInicioDesconto:
          description: Payroll competência of the first deduction, yyyyMM.
          examples:
            - "202507"
          type: string
        hashOperacao:
          description: The rail's own identity for this operation.
          examples:
            - "34006311"
          type: string
        listaContratosQuitadosTrabalhador:
          description: Every contract the rail confirmed as quitado by this refinanciamento.
          examples:
            -   - numeroContrato: 99999999999AR1
          items:
            $ref: "#/components/schemas/RefinanciamentoContratoQuitado"
          type:
            - array
            - "null"
        mensagem:
          description: The rail's own message.
          examples:
            - Refinanciamento realizado com sucesso
          type: string
        numeroContrato:
          description: The new contract's number, as confirmed by the rail.
          examples:
            - 99999999999ARN1
          type: string
      required:
        - mensagem
        - numeroContrato
        - competenciaInicioDesconto
        - hashOperacao
        - listaContratosQuitadosTrabalhador
      type: object
    RegistrationInventoryArtifact:
      additionalProperties: false
      properties:
        blob_ref:
          type: string
        digest_sha256:
          type: string
        retrieval_uri:
          type: string
        size_bytes:
          format: int64
          type: integer
        stored_at:
          format: date-time
          type: string
      required:
        - blob_ref
        - digest_sha256
        - size_bytes
        - stored_at
        - retrieval_uri
      type: object
    RegistrationInventoryArtifacts:
      additionalProperties: false
      properties:
        biometrics_documents_pack:
          anyOf:
            - $ref: "#/components/schemas/RegistrationInventoryArtifact"
            - type: "null"
        signed_ccb:
          anyOf:
            - $ref: "#/components/schemas/RegistrationInventoryArtifact"
            - type: "null"
      required:
        - signed_ccb
        - biometrics_documents_pack
      type: object
    RegistrationInventoryComposition:
      additionalProperties: false
      properties:
        composed_at:
          format: date-time
          type:
            - string
            - "null"
        failure_code:
          description: "Why the witness ended, set only when status is failed. COMPOSITION_REJECTED: the rail read or the proposal ruled the contract out. CREDENTIALS_REVOKED: the tenant's Dataprev credentials were revoked. RAIL_READ_REFUSED: Dataprev refused the read for good. COMPOSITION_FAILED: any other failure, after its retries ran out."
          type:
            - string
            - "null"
        payload_sha256:
          type:
            - string
            - "null"
        status:
          description: "Composition state. complete: the contract-registration fact was composed and reserved. failed: the proposal witness failed or was rejected before finishing - failure_code says which, and a rail-only contract can reach these too, since a witness fails for rail reasons that have nothing to do with a booking. missing: no composition yet, the witness is still working. rail_only: the witness finished and the client sent no booking block, so no fact was composed and none ever will be - a finished state, not a wait."
          enum:
            - complete
            - failed
            - missing
            - rail_only
          type: string
      required:
        - status
        - composed_at
        - payload_sha256
        - failure_code
      type: object
    RegistrationInventoryEvent:
      additionalProperties: false
      properties:
        event_id:
          type: string
        event_type:
          type: string
        schema_version:
          type: string
      required:
        - event_id
        - event_type
        - schema_version
      type: object
    RegistrationInventoryItem:
      additionalProperties: false
      properties:
        artifacts:
          $ref: "#/components/schemas/RegistrationInventoryArtifacts"
        composition:
          $ref: "#/components/schemas/RegistrationInventoryComposition"
        event:
          anyOf:
            - $ref: "#/components/schemas/RegistrationInventoryEvent"
            - type: "null"
        numero_contrato:
          type: string
        outbox:
          anyOf:
            - $ref: "#/components/schemas/RegistrationInventoryOutbox"
            - type: "null"
        position:
          type: string
        registration:
          $ref: "#/components/schemas/RegistrationInventoryRegistration"
      required:
        - position
        - numero_contrato
        - registration
        - composition
        - event
        - outbox
        - artifacts
      type: object
    RegistrationInventoryObservation:
      additionalProperties: false
      properties:
        item:
          $ref: "#/components/schemas/RegistrationInventoryItem"
        observed_at:
          format: date-time
          type: string
      required:
        - item
        - observed_at
      type: object
    RegistrationInventoryOutbox:
      additionalProperties: false
      properties:
        attempt_count:
          format: int64
          type: integer
        created_at:
          format: date-time
          type: string
        last_error_code:
          type:
            - string
            - "null"
        outbox_id:
          type: string
        published_at:
          format: date-time
          type:
            - string
            - "null"
        status:
          type: string
      required:
        - outbox_id
        - status
        - created_at
        - published_at
        - attempt_count
        - last_error_code
      type: object
    RegistrationInventoryPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/RegistrationInventoryItem"
          type: array
        page:
          $ref: "#/components/schemas/RegistrationInventoryPageMetadata"
      required:
        - items
        - page
      type: object
    RegistrationInventoryPageMetadata:
      additionalProperties: false
      properties:
        after:
          type:
            - string
            - "null"
        has_more:
          type: boolean
        next_after:
          type: string
        through:
          type: string
      required:
        - after
        - through
        - next_after
        - has_more
      type: object
    RegistrationInventoryRegistration:
      additionalProperties: false
      properties:
        attachment_hash_operacao:
          type: string
        confirmed_at:
          format: date-time
          type: string
        dataprev_success_code:
          type: string
        rail_reference:
          type: string
      required:
        - confirmed_at
        - dataprev_success_code
        - rail_reference
        - attachment_hash_operacao
      type: object
    RegistroB3Body:
      additionalProperties: false
      properties:
        codigoInstrumentoFinanceiro:
          description: "The code B3 generated when it accepted the CCB registration (X(14)). Stored as received and compared byte for byte: no trim, no case fold."
          examples:
            - CCB0000ABCD12
          pattern: ^[A-Za-z0-9]{1,14}$
          type: string
        dataRegistro:
          description: The civil date B3 accepted the registration on, YYYY-MM-DD. Not in the future and not before the averbação, both in Brasília time.
          examples:
            - "2026-10-08"
          format: date
          type: string
      required:
        - codigoInstrumentoFinanceiro
      type: object
    RegistroB3Request:
      additionalProperties: false
      properties:
        registroB3:
          $ref: "#/components/schemas/RegistroB3Body"
          description: The registro B3 of the contract.
      required:
        - registroB3
      type: object
    RegistroB3Response:
      additionalProperties: false
      properties:
        numeroCcb:
          description: "Read only: the CCB number the contract's cadastro named (the documentation's block when it sent one, else the averbação's), or numeroContrato when it named none."
          examples:
            - DIDI2090
          type: string
        numeroContrato:
          description: The contract the registro belongs to.
          examples:
            - 99999999999AN1
          type: string
        registradoEm:
          description: When the registro was durably stored, strict RFC 3339 UTC. A replay returns the original instant.
          examples:
            - "2026-10-08T14:03:11Z"
          type: string
        registroB3:
          $ref: "#/components/schemas/RegistroB3Body"
          description: The registro B3 as stored.
      required:
        - numeroContrato
        - numeroCcb
        - registroB3
        - registradoEm
      type: object
    RenegociacaoBody:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          description: "Employer inscription type: 1 CNPJ, 2 CPF."
          examples:
            - "2"
          pattern: ^[12]$
          type: string
        competenciaInicioDesconto:
          description: Payroll competência of the first deduction, yyyyMM. Optional; the rail assumes the current competência when omitted.
          examples:
            - "202501"
          pattern: ^[0-9]{6}$
          type: string
        cpfTrabalhador:
          description: Worker CPF, 11 digits.
          examples:
            - "27928255022"
          maxLength: 11
          minLength: 11
          pattern: ^[0-9]{11}$
          type: string
        dataFimContrato:
          description: End date of the new consignado contract, RFC 3339 UTC.
          examples:
            - "2026-01-24T00:00:00Z"
          format: date-time
          type: string
        dataInicioContrato:
          description: Start date of the new consignado contract, RFC 3339 UTC.
          examples:
            - "2025-01-24T00:00:00Z"
          format: date-time
          type: string
        dataPrimeiroDesconto:
          description: Date of the first payroll deduction, RFC 3339 UTC.
          examples:
            - "2025-01-28T00:00:00Z"
          format: date-time
          type: string
        matricula:
          description: Matrícula assigned to the worker by the employer.
          examples:
            - teste4243
          maxLength: 20
          type: string
        nomeTrabalhador:
          description: Worker's full name.
          examples:
            - testeead
          maxLength: 100
          type: string
        numeroContratoEncerrado:
          description: The PRIOR contract this renegociação replaces. Must be held by this gateway for the authenticated tenant, and must differ from the new contract number in the path.
          examples:
            - Qwerty123456780
          maxLength: 15
          minLength: 1
          type: string
        numeroInscricaoEmpregador:
          description: Employer inscription number, Texto.
          examples:
            - "42422253000101"
          maxLength: 14
          type: string
        numeroParcelas:
          description: Number of instalments of the new contract, capped at the manual's own published range 1 to 99 (Manual 006 §2.3.2 line 748).
          examples:
            - 8
          format: int64
          maximum: 99
          minimum: 1
          type: integer
        valorCETAnual:
          description: valorCETAnual — Custo Efetivo Total, annual percent decimal string.
          examples:
            - "0.20"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorCETMensal:
          description: valorCETMensal — Custo Efetivo Total, monthly percent decimal string.
          examples:
            - "0.10"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorEmprestimo:
          description: valorEmprestimo — the new contract's principal (decimal string, BRL).
          examples:
            - "3000.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorIOF:
          description: valorIOF — the IOF charged, in reais (decimal string, BRL). Obrigatório on the manual even though the mirrored Swagger's required list omits it.
          examples:
            - "0.10"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorLiberado:
          description: valorLiberado — amount delivered to the worker (decimal string, BRL).
          examples:
            - "2000.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorParcela:
          description: valorParcela — the new contract's instalment amount (decimal string, BRL). Must not exceed the closed contract's own instalment (regra BL) — a comparison this gateway cannot make locally and leaves to the rail.
          examples:
            - "400.00"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaAnual:
          description: valorTaxaAnual — annual interest rate, percent decimal string.
          examples:
            - "0.30"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaMensal:
          description: valorTaxaMensal — monthly interest rate, percent decimal string.
          examples:
            - "0.10"
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - numeroContratoEncerrado
        - cpfTrabalhador
        - matricula
        - nomeTrabalhador
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
        - dataInicioContrato
        - dataFimContrato
        - dataPrimeiroDesconto
        - numeroParcelas
        - valorLiberado
        - valorEmprestimo
        - valorParcela
        - valorIOF
        - valorTaxaAnual
        - valorTaxaMensal
        - valorCETAnual
        - valorCETMensal
      type: object
    RenegociacaoOperationResponse:
      additionalProperties: false
      properties:
        competenciaInicioDesconto:
          description: Payroll competência of the first deduction, yyyyMM.
          examples:
            - "202501"
          type: string
        hashOperacao:
          description: The rail's own identity for this operation.
          examples:
            - "9598435"
          type: string
        mensagem:
          description: The rail's own message.
          examples:
            - Inclusão efetuada com sucesso
          type: string
        numeroContrato:
          description: The new contract's number, as confirmed by the rail.
          examples:
            - Qwerty123456789
          type: string
      required:
        - mensagem
        - numeroContrato
        - competenciaInicioDesconto
        - hashOperacao
      type: object
    RepasseExpectationItem:
      additionalProperties: false
      properties:
        cnpj:
          type: string
        competencia:
          type: string
        due_at:
          format: date-time
          type:
            - string
            - "null"
        guia_paid_at:
          format: date-time
          type:
            - string
            - "null"
        in_scope:
          type: boolean
        numero_contrato:
          type: string
        observed_at:
          format: date-time
          type: string
        repasse_paid_at:
          format: date-time
          type:
            - string
            - "null"
        resolution_pending:
          type: boolean
        settled_at:
          format: date-time
          type:
            - string
            - "null"
        settled_by_registro:
          type:
            - string
            - "null"
        situation:
          description: The state this expectation is in, derived once by the server.
          enum:
            - open
            - overdue
            - undated
            - settled
          type: string
      required:
        - cnpj
        - numero_contrato
        - competencia
        - due_at
        - observed_at
        - settled_at
        - repasse_paid_at
        - guia_paid_at
        - settled_by_registro
        - resolution_pending
        - situation
        - in_scope
      type: object
    RepasseExpectationsPage:
      additionalProperties: false
      properties:
        freshness:
          $ref: "#/components/schemas/RepasseFreshness"
        items:
          items:
            $ref: "#/components/schemas/RepasseExpectationItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
        scopes:
          items:
            $ref: "#/components/schemas/RepasseScopeCount"
          type:
            - array
            - "null"
      required:
        - items
        - page
        - freshness
        - scopes
      type: object
    RepasseFreshness:
      additionalProperties: false
      properties:
        last_clean_read_at:
          format: date-time
          type:
            - string
            - "null"
        observed_replica:
          type: string
        stale_after_seconds:
          format: int64
          type: integer
        state:
          description: How much this board's own absence of rows can be trusted.
          enum:
            - fresh
            - stale
            - never
          type: string
      required:
        - last_clean_read_at
        - stale_after_seconds
        - state
        - observed_replica
      type: object
    RepasseScopeCount:
      additionalProperties: false
      properties:
        cnpj:
          type: string
        in_scope:
          type: boolean
        open_count:
          format: int64
          type: integer
      required:
        - cnpj
        - open_count
        - in_scope
      type: object
    ReversaoRefinanciamentoBody:
      additionalProperties: false
      properties:
        motivoReversao:
          description: "Reversal reason (Manual 008 v1.10 §3.2.1, regra RG): 1 Desistência, 2 Óbito, 3 Fraude. Closed set — no 4th value exists."
          examples:
            - 1
          format: int64
          maximum: 3
          minimum: 1
          type: integer
        parcelasContratosQuitados:
          description: Instalment amounts of every contract this refinancing quitou, decimal strings (BRL). Optional; enables the margemReservada notice on the response.
          examples:
            -   - "230.00"
          items:
            type: string
          type:
            - array
            - "null"
        valorParcelaNovoContrato:
          description: The new (now-reversed) contract's own instalment amount, decimal string (BRL). Optional; enables the margemReservada notice on the response.
          examples:
            - "310.00"
          type: string
      required:
        - motivoReversao
      type: object
    ReversaoRefinanciamentoContratoReativado:
      additionalProperties: false
      properties:
        numeroContrato:
          description: A quitado contract the reversal returned to ativo.
          examples:
            - 99999999999AR1
          type: string
        valorParcela:
          description: That contract's instalment amount, again active (decimal string, BRL).
          examples:
            - "230.00"
          type: string
      required:
        - numeroContrato
        - valorParcela
      type: object
    ReversaoRefinanciamentoOperationResponse:
      additionalProperties: false
      properties:
        competenciaReversao:
          description: Payroll competência the reversal took effect in, yyyyMM.
          examples:
            - "202507"
          type: string
        hashOperacao:
          description: The rail's own identity for this operation.
          examples:
            - "34006311"
          type: string
        listaContratosTrabalhadorReativados:
          description: Every quitado contract the reversal returned to ativo.
          examples:
            -   - numeroContrato: 99999999999AR1
                  valorParcela: "230.00"
          items:
            $ref: "#/components/schemas/ReversaoRefinanciamentoContratoReativado"
          type:
            - array
            - "null"
        margemReservada:
          description: "The margin that was held reserved during the reversal window (Manual 008 v1.10 §3.2): the greater of the quitados' summed instalments and the new contract's own. Present only when the caller supplied enough context to compute it — a courtesy figure, not a rail field."
          examples:
            - "310.00"
          type: string
        mensagem:
          description: The rail's own message.
          examples:
            - Reversao realizada com sucesso
          type: string
        numeroContratoExcluido:
          description: The new contract, now excluded by the reversal.
          examples:
            - 99999999999ARN1
          type: string
      required:
        - mensagem
        - numeroContratoExcluido
        - competenciaReversao
        - hashOperacao
        - listaContratosTrabalhadorReativados
      type: object
    RotateResponse:
      additionalProperties: false
      properties:
        overlapUntil:
          type: string
        signingSecret:
          type: string
      required:
        - signingSecret
        - overlapUntil
      type: object
    SaldoDevedorAmortizacaoItem:
      additionalProperties: false
      properties:
        competencia:
          description: The competencia this marker amortized, yyyyMM.
          examples:
            - "202601"
          type: string
        created_at:
          description: When the marker was recorded, in UTC.
          examples:
            - "2026-01-31T03:00:00Z"
          format: date-time
          type: string
        origem:
          description: Which event family recorded this competência as amortized.
          enum:
            - E1
            - E5
          examples:
            - E1
          type: string
      required:
        - competencia
        - origem
        - created_at
      type: object
    SaldoDevedorDetail:
      additionalProperties: false
      properties:
        amortizacoes:
          items:
            $ref: "#/components/schemas/SaldoDevedorAmortizacaoItem"
          type: array
        obrigacao:
          $ref: "#/components/schemas/SaldoDevedorItem"
      required:
        - obrigacao
        - amortizacoes
      type: object
    SaldoDevedorItem:
      additionalProperties: false
      properties:
        codigo_inscricao_empregador:
          description: "Which register the employer identifier belongs to: 1 CNPJ, 2 CPF."
          examples:
            - "1"
          type: string
        competencia_inicio_desconto:
          description: Payroll competencia the deductions start in, yyyyMM.
          examples:
            - "202601"
          type: string
        data_primeiro_desconto:
          description: The first payroll deduction date every instalment's due date is counted from, RFC 3339 UTC midnight.
          examples:
            - "2026-01-20T00:00:00Z"
          format: date-time
          type: string
        matricula:
          description: The worker's payroll registration with the employer.
          examples:
            - MATCEN716
          type: string
        numero_contrato:
          description: The rail contract number this obligation belongs to.
          examples:
            - 99999999999AN1
          type: string
        numero_inscricao_empregador:
          description: "The employer identifier itself, as reported to Dataprev: text of up to 14 characters."
          examples:
            - "42422253000101"
          type: string
        numero_parcelas:
          description: How many instalments the cronograma minimo E0 minted.
          examples:
            - 12
          format: int64
          type: integer
        origem:
          description: "Who averbou the contract: \"gateway\" if this gateway did (or renegotiated a legado one), \"importado\" if it was averbado elsewhere and adopted from the rail afterwards."
          enum:
            - gateway
            - importado
          examples:
            - gateway
          type: string
        parcelas_pagas:
          description: How many competencias have amortized so far.
          examples:
            - 3
          format: int64
          type: integer
        proximo_marco:
          description: "The next scheduled-report marker, in UTC. Always null."
          examples:
            - null
          format: date-time
          type:
            - string
            - "null"
        quitado:
          description: "Whether the obligation is settled: every instalment amortized (parcelas_pagas against numero_parcelas), or an accepted refinanciamento or origin-side portability exclusion that no reversal undid, or an exclusion by refinanciamento or portabilidade the M005 follow-up observed at Dataprev. Derived, never a stored flag."
          examples:
            - false
          type: boolean
        taxa_mensal:
          description: "The contract's monthly rate (valorTaxaMensal) the balance is discounted at, as a PERCENT-per-month decimal string: \"1.80\" is 1.80 %/month."
          examples:
            - "1.80"
          type: string
        ultimo_envio_at:
          description: When this gateway last reported this obligation to the rail, in UTC. Null means nothing has been sent yet.
          examples:
            - "2026-08-14T09:12:33Z"
          format: date-time
          type:
            - string
            - "null"
        valor_parcela:
          description: The instalment as the schedule stores it, republished verbatim as a BRL decimal string.
          examples:
            - "1116.31"
          type: string
        valor_saldo_devedor:
          description: "The balance this gateway reports under M015 while vigente is true; once it is false, only a first report never accepted or a final 0.00 still goes out: at today's Brasília date, the present value of every instalment still ahead whose competência has not amortized, each valor_parcela / (1 + taxa_mensal)^(days/30), due on data_primeiro_desconto's day of month k months on, assuming on-time payment. \"0.00\" once the obligation is quitada."
          examples:
            - "10046.79"
          type: string
        vigente:
          description: "Whether the contract is still on the registry, so this gateway keeps reporting it under M015. False once it left: a confirmed exclusion, an accepted portability exclusion, a refinanciamento or renegociação that replaced it and no reversal undid, a refinanciamento of its own that was reversed, an exit the M005 follow-up observed, or a termination the Manual 006 report listed. A settled contract can still read true until it leaves. Derived, never a stored flag."
          examples:
            - true
          type: boolean
      required:
        - numero_contrato
        - matricula
        - codigo_inscricao_empregador
        - numero_inscricao_empregador
        - numero_parcelas
        - parcelas_pagas
        - valor_parcela
        - valor_saldo_devedor
        - taxa_mensal
        - data_primeiro_desconto
        - competencia_inicio_desconto
        - origem
        - ultimo_envio_at
        - proximo_marco
        - quitado
        - vigente
      type: object
    SaldoDevedorPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/SaldoDevedorItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
      required:
        - items
        - page
      type: object
    ScheduledJob:
      additionalProperties: false
      properties:
        cadence_seconds:
          description: How often one pass is scheduled, in seconds, read from the loop's own interval provider at request time and clamped to its floor.
          format: double
          type: number
        failures:
          description: Passes that returned an error since this process started.
          format: int64
          type: integer
        family:
          description: The operation family this loop belongs to, matching GET /v1/consignado/capabilities. Null when no capability family gates the loop.
          enum:
            - averbacao
            - averbacao_recovery
            - exclusao
            - correcoes
            - desembolso
            - cessao
            - leilao
            - portal
            - trilho
            - null
          type:
            - string
            - "null"
        hot_cadence:
          description: "True for the one fixed-rate loop: evenly spaced, start to start, with concurrent passes bounded. Every other loop runs pass then delay."
          type: boolean
        identity:
          description: The scheduler job identity, which is also the background-worker name this loop drains under.
          type: string
        last_error_class:
          description: "The class of the MOST RECENT error, never the error message. It is not cleared by a later success: 'failures' beside it is what says whether the loop is still failing."
          type:
            - string
            - "null"
        last_pass_ended_at:
          description: When the last pass finished. Null while any pass is in flight, and null before the first pass.
          format: date-time
          type:
            - string
            - "null"
        last_pass_started_at:
          description: "When this process last began a pass. Null before the first pass: no loop runs a pass at process start."
          format: date-time
          type:
            - string
            - "null"
        max_in_flight:
          description: The concurrent-pass bound of the fixed-rate lane. Null on every other loop. Paired with 'overruns' it is what reveals that the purchased rate is not being achieved.
          format: int64
          type:
            - integer
            - "null"
        overruns:
          description: "Ticks the fixed-rate lane skipped because its in-flight bound was reached. Null on every other loop, because a pass-then-delay loop cannot overrun: null means 'does not apply', never 'measured none'."
          format: int64
          type:
            - integer
            - "null"
        passes:
          description: Completed passes since this process started.
          format: int64
          type: integer
        paused_until:
          description: "When the Dataprev competency turnover holds this loop's rail until. Absent whenever the rail is being probed. A pass the turnover skipped is neither counted in 'passes' nor in 'failures', and 'last_error_class' keeps whatever it said before, so this field is what separates a held loop from a healthy one. This board is per process and has no tenant: a loop that covers a roster is shown as paused only when every tenant in the pass is paused, and this instant is the latest of their windows. It says when the loop probes again, not when a given tenant's rail returns - that is the consignado.rail.resumed event, which carries the tenant."
          format: date-time
          type: string
        reason:
          description: Which mechanism decided this loop's presence, in the same closed vocabulary the capability read publishes. A loop this process started always reads 'enabled'; the other three values describe a loop that is NOT running, and they name the mechanism that stopped it. Null when the loop belongs to no family.
          enum:
            - enabled
            - flag_off
            - portal_store_absent
            - rail_client_absent
            - null
          type:
            - string
            - "null"
        started:
          description: "Whether this process actually started the loop. False covers two different things, which 'reason' and 'last_error_class' separate: a loop a flag switched off, and a loop the scheduler refused."
          type: boolean
      required:
        - identity
        - started
        - family
        - reason
        - cadence_seconds
        - hot_cadence
        - last_pass_started_at
        - last_pass_ended_at
        - last_error_class
        - passes
        - failures
        - overruns
        - max_in_flight
      type: object
    ScheduledJobsResponse:
      additionalProperties: false
      properties:
        jobs:
          items:
            $ref: "#/components/schemas/ScheduledJob"
          type: array
        observed_replica:
          description: "An opaque, stable per-process tag. Never a hostname and never a pod name: it exists only so an operator can notice that two answers came from two processes."
          type: string
      required:
        - jobs
        - observed_replica
      type: object
    Subscription:
      additionalProperties: false
      properties:
        created_at:
          description: RFC 3339 creation timestamp (UTC).
          examples:
            - "2026-01-15T12:00:00Z"
          format: date-time
          type: string
        delegated_scope:
          description: Base64 of the subscription's delegated scope (this gateway's fund); absent on a tenant-wide subscription.
          examples:
            - Rk9ORE8tQQ==
          type: string
        enabled:
          description: Whether delivery is enabled.
          type: boolean
        endpoint:
          description: Webhook delivery endpoint. Carried on a create response only; the hub withholds it from every read, where endpoint_display names the destination instead.
          examples:
            - https://hooks.example.com/ingest
          type: string
        event_majors:
          additionalProperties:
            format: int64
            type: integer
          description: Per-event-type schema major, overriding schema_major for the types it names; absent means no overrides.
          examples:
            - loan_application.disbursed: 2
          type: object
        event_types:
          description: Event-type filter; absent means all events.
          items:
            type: string
          type:
            - array
            - "null"
        id:
          description: Hub-assigned subscription id (UUIDv7).
          examples:
            - 0192f1a0-0000-7000-8000-00000000c001
          type: string
        name:
          description: Human-readable subscription name.
          examples:
            - orders-webhook
          type: string
        origin:
          description: The one producing application (ce-source) this subscription accepts events from; absent means any producer.
          examples:
            - midaz
          type: string
        plan_tier:
          description: Delivery plan tier.
          examples:
            - standard
          type: string
        schema_major:
          description: Event schema major delivered for every type event_majors does not name; absent means major 1.
          examples:
            - 2
          format: int64
          type: integer
        signature_version:
          description: Webhook signature scheme version.
          examples:
            - 1
          format: int64
          type: integer
        sink_kind:
          description: Delivery sink kind.
          examples:
            - webhook
          type: string
        updated_at:
          description: RFC 3339 last-update timestamp (UTC).
          examples:
            - "2026-01-15T12:00:00Z"
          format: date-time
          type: string
        verification_state:
          description: Endpoint verification state.
          examples:
            - active
          type: string
      required:
        - id
        - name
        - sink_kind
        - signature_version
        - plan_tier
        - enabled
        - verification_state
        - created_at
        - updated_at
      type: object
    SubscriptionHealth:
      additionalProperties: false
      properties:
        auto_disabled:
          description: "Endpoint-health auto-disable verdict: null when the hub has no health row yet, false when healthy, true when tripped. Null is never false."
          examples:
            - false
          type:
            - boolean
            - "null"
        consumer_lag_ms:
          description: Process consumer lag behind the high watermark, in milliseconds.
          examples:
            - 120
          format: int64
          type: integer
        dead_lettered:
          description: Count of dead-lettered delivery attempts in the window.
          examples:
            - 2
          format: int64
          type: integer
        delivery_outcomes:
          additionalProperties:
            format: int64
            type: integer
          description: Delivery-attempt outcome counts over the hub's configured window, keyed by outcome.
          examples:
            - delivered: 128
              failed: 2
          type: object
        disabled_reason:
          description: Fixed, secret-free auto-disable verdict token; null when the subscription was not auto-disabled.
          examples:
            - consecutive_failures
          type:
            - string
            - "null"
        dropped_tenant:
          description: Whether any events were dropped or quarantined for this tenant.
          examples:
            - false
          type: boolean
        enabled:
          description: Whether delivery is enabled (manual operator toggle).
          examples:
            - true
          type: boolean
        last_failure_at:
          description: Instant of the last failed delivery; null when there has never been one.
          examples:
            - "2026-01-15T09:29:00Z"
          format: date-time
          type:
            - string
            - "null"
        last_success_at:
          description: Instant of the last successful delivery; null when there has never been one.
          examples:
            - "2026-01-15T09:30:00Z"
          format: date-time
          type:
            - string
            - "null"
        poison_events:
          description: Count of quarantined poison events for this tenant.
          examples:
            - 0
          format: int64
          type: integer
        recent_outcomes:
          additionalProperties:
            format: int64
            type: integer
          description: Last-24h delivery-outcome breakdown, keyed by outcome.
          examples:
            - delivered: 40
              failed: 1
          type: object
        status:
          description: Rolled-up operator status (Healthy, Degraded, Down). A free string, not a closed vocabulary.
          examples:
            - Healthy
          type: string
        subscription_id:
          description: The subscription this health view is for.
          examples:
            - 0192f1a0-0000-7000-8000-0000000000ff
          type: string
        success_rate:
          description: Share of terminal delivery attempts that succeeded, in [0.0, 1.0]; null when no terminal attempt has happened yet. Null is never zero.
          examples:
            - 0.98
          format: double
          type:
            - number
            - "null"
        verification_state:
          description: Position in the destination verification state machine (pending_verification, active, degraded, disabled). A free string, not a closed vocabulary.
          examples:
            - active
          type: string
      required:
        - subscription_id
        - enabled
        - verification_state
        - status
        - delivery_outcomes
        - dead_lettered
        - poison_events
        - dropped_tenant
        - consumer_lag_ms
        - auto_disabled
        - success_rate
        - recent_outcomes
        - disabled_reason
        - last_success_at
        - last_failure_at
      type: object
    SubscriptionRead:
      additionalProperties: false
      properties:
        created_at:
          description: RFC 3339 creation timestamp (UTC).
          examples:
            - "2026-01-15T12:00:00Z"
          format: date-time
          type: string
        credential_kind:
          description: "Which credential this subscription delivers with: delegated_grant (a cross-account role; nothing stored, nothing to rotate), static_credential (a stored queue credential), signing_secret (a webhook signing secret), or none."
          enum:
            - signing_secret
            - static_credential
            - delegated_grant
            - none
          examples:
            - signing_secret
          type: string
        delegated_scope:
          description: Base64 of the subscription's delegated scope (this gateway's fund); absent on a tenant-wide subscription.
          examples:
            - Rk9ORE8tQQ==
          type: string
        enabled:
          description: Whether delivery is enabled.
          type: boolean
        endpoint_display:
          description: "Show-safe rendering of the endpoint: webhook scheme+host only, queue/exchange/bus name only, pull:// unchanged. Empty when the stored endpoint cannot be parsed. This is the only rendering of the destination a READ carries; the full endpoint is served on its own route, GET /v1/subscriptions/{id}/endpoint, which the admin role alone may reach."
          examples:
            - https://hooks.example.com
          type: string
        event_majors:
          additionalProperties:
            format: int64
            type: integer
          description: Per-event-type schema major, overriding schema_major for the types it names; absent means no overrides.
          examples:
            - loan_application.disbursed: 2
          type: object
        event_types:
          description: Event-type filter; absent means all events.
          items:
            type: string
          type:
            - array
            - "null"
        id:
          description: Hub-assigned subscription id (UUIDv7).
          examples:
            - 0192f1a0-0000-7000-8000-00000000c001
          type: string
        name:
          description: Human-readable subscription name.
          examples:
            - orders-webhook
          type: string
        origin:
          description: The one producing application (ce-source) this subscription accepts events from; absent means any producer.
          examples:
            - midaz
          type: string
        plan_tier:
          description: Delivery plan tier.
          examples:
            - standard
          type: string
        schema_major:
          description: Event schema major delivered for every type event_majors does not name; absent means major 1.
          examples:
            - 2
          format: int64
          type: integer
        secret_configured:
          description: Whether stored secret material (a signing secret, or a queue sink's stored delivery credential) is present. Normally false for a delegated-grant sink, which stores none by design — but a grant row still holding a previously stored credential reads true, so read credential_kind for what actually delivers. The material itself is never returned.
          examples:
            - true
          type: boolean
        secret_overlap_until:
          description: "RFC 3339 instant until which the PREVIOUS signing secret is still accepted (the hub dual-signs until then), or null when no rotation-overlap window is open: never rotated, the window already closed, or a sink kind that signs nothing."
          examples:
            - "2026-01-16T09:30:00Z"
          format: date-time
          type:
            - string
            - "null"
        secret_rotated_at:
          description: RFC 3339 instant the stored secret material was last replaced, or null when the hub does not know (no secret stored, or a row predating the column that has not rotated since).
          examples:
            - "2026-01-15T09:30:00Z"
          format: date-time
          type:
            - string
            - "null"
        signature_version:
          description: Webhook signature scheme version.
          examples:
            - 1
          format: int64
          type: integer
        sink_kind:
          description: Delivery sink kind.
          examples:
            - webhook
          type: string
        updated_at:
          description: RFC 3339 last-update timestamp (UTC).
          examples:
            - "2026-01-15T12:00:00Z"
          format: date-time
          type: string
        verification_state:
          description: Endpoint verification state.
          examples:
            - active
          type: string
      required:
        - endpoint_display
        - secret_configured
        - credential_kind
        - secret_rotated_at
        - secret_overlap_until
        - id
        - name
        - sink_kind
        - signature_version
        - plan_tier
        - enabled
        - verification_state
        - created_at
        - updated_at
      type: object
    ThroughputHistoryPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/ThroughputTransitionItem"
          type: array
        page:
          $ref: "#/components/schemas/KeysetPageMetadata"
      required:
        - items
        - page
      type: object
    ThroughputResponse:
      additionalProperties: false
      properties:
        configured:
          description: Whether this tenant has a throughput chain on record. False means the tenant has expressed nothing and is paced at the starter floor; it does NOT mean paused.
          examples:
            - false
          type: boolean
        maximumRequestsPerSecond:
          description: "The ceiling the Dataprev rail imposes. It is code-locked: neither an operator nor a client can raise it. Read it from here rather than restating it."
          examples:
            - 25
          format: int64
          type: integer
        requestsPerSecond:
          description: This tenant's outbound Dataprev rail rate, in requests per second. Zero is a deliberate self-service pause, not an absent value.
          examples:
            - 3
          format: int64
          type: integer
        starterRequestsPerSecond:
          description: The floor a tenant paces at before it has chosen anything.
          examples:
            - 3
          format: int64
          type: integer
      required:
        - requestsPerSecond
        - configured
        - maximumRequestsPerSecond
        - starterRequestsPerSecond
      type: object
    ThroughputTransitionItem:
      additionalProperties: false
      properties:
        changed_at:
          description: "The instant of the transition, in UTC. Reported and never ordered by: a wall clock is not the authority on a chain that has a sequence."
          examples:
            - "2026-08-14T09:12:33Z"
          format: date-time
          type: string
        changed_by:
          description: The actor that made the change. system:gateway is the gateway's own automatic first grant.
          examples:
            - client-admin@bank
          type: string
        previous_requests_per_second:
          description: The rate held before this link. Null on sequence 1 and on no other row. A stored zero is a real predecessor and means the tenant was coming off a pause.
          examples:
            - 10
          format: int64
          type:
            - integer
            - "null"
        requests_per_second:
          description: The rate the tenant became entitled to at this link. Zero is a requested pause, not an absent value.
          examples:
            - 25
          format: int64
          type: integer
        sequence:
          description: This link's position in the tenant's chain, starting at 1. The chain's own authority on order and the only column this read sorts by.
          examples:
            - 2
          format: int64
          type: integer
      required:
        - sequence
        - requests_per_second
        - previous_requests_per_second
        - changed_at
        - changed_by
      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
    VinculoNovoRecord:
      additionalProperties: false
      properties:
        codigo_categoria_trabalhador:
          description: The eSocial worker-category code of the new bond.
          examples:
            - "101"
          type: string
        cpf:
          description: The worker's document, 11 digits, re-padded from the rail's JSON Número.
          examples:
            - "66626662031"
          type: string
        data_admissao:
          description: The worker's admission date on the new bond, RFC 3339 UTC.
          examples:
            - "2024-11-01T00:00:00Z"
          format: date-time
          type: string
        elegivel:
          description: Whether the worker is eligible for a loan on the new bond. ABSENT when the rail element carried no verdict — absence is not a refusal.
          examples:
            - true
          type: boolean
        inscricao_empregador:
          $ref: "#/components/schemas/DataprevCodigoDescricaoResponse"
          description: The employer-inscription TYPE pair (1 CNPJ, 2 CPF). Absent when the rail sent no readable code.
          examples:
            - codigo: 1
              descricao: CNPJ
        matricula:
          description: The worker's payroll registration on the NEW bond.
          examples:
            - teste4243
          type: string
        motivo_inelegibilidade:
          $ref: "#/components/schemas/DataprevCodigoDescricaoResponse"
          description: The reason code+description behind an ineligible verdict. Only motivo 8 (empréstimo encerrado por término de vínculo) permits a renegociação (Manual 006 v1.12 §2.3.1 p.20).
          examples:
            - codigo: 8
              descricao: Emprestimo encerrado por termino de vinculo
        nome:
          description: The worker's name on the new bond.
          examples:
            - testeeada
          type: string
        nome_empregador:
          description: The new employer's name.
          examples:
            - empregadorteste12
          type: string
        numero_inscricao_empregador:
          description: The employer inscription number on the new bond.
          examples:
            - "42422253000101"
          type: string
        pessoa_exposta_politicamente:
          $ref: "#/components/schemas/DataprevCodigoDescricaoResponse"
          description: The politically-exposed-person pair, relayed verbatim and never interpreted.
        qtd_emprestimos:
          description: The count of loans the worker holds on the new bond.
          examples:
            - 1
          format: int64
          type: integer
        valor_base_margem:
          description: The base amount margem is computed from (decimal string, BRL).
          examples:
            - "8000.00"
          type: string
        valor_margem_disponivel:
          description: The consignable margin available on the new bond (decimal string, BRL).
          examples:
            - "7600.00"
          type: string
        valor_total_vencimentos:
          description: The worker's total earnings on the new bond (decimal string, BRL).
          examples:
            - "9000.00"
          type: string
      required:
        - cpf
        - matricula
        - numero_inscricao_empregador
        - nome
        - nome_empregador
        - codigo_categoria_trabalhador
        - valor_total_vencimentos
        - valor_base_margem
        - valor_margem_disponivel
        - data_admissao
        - qtd_emprestimos
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: OpenAPI 3.1 surface for Lerian Consignado — Dataprev. The API covers tenant credentials and rail configuration, worker margin, loan auctions and bids, contract registration and lifecycle, B3 instrument codes, disbursement confirmation, portability, refinancing, renegotiation, FGTS guarantees, reconciliation, funds, assignments, throughput, and event subscriptions.
  license:
    name: Lerian Studio General License
  title: Lerian Consignado API
  version: v1.0.0
openapi: 3.1.0
paths:
  /v1/consignado/averbacao-operations:
    get:
      description: |-
        Walks the tenant's own averbação operation book, oldest claim first.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501 and it is served even on a deployment where averbação itself is switched off. That deployment simply has an empty book. Distinguishing "nothing is stuck" from "the convergence loop is off" is what GET /v1/consignado/capabilities is for: read the averbacao_recovery family there, not the status of this response.

        The tenant is derived from the validated identity and is never read from the request. There is no tenant parameter on this operation.

        Paging is keyset over the operation's own claim instant, which the table holds immutable by trigger, so a row's position never moves and a page can neither skip nor repeat. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false, so a client loop may terminate on either. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the scan from the top.

        status may be repeated to narrow the page to several situations at once (status=averbacao_unknown&status=attachment_pending). Omitting it means ALL eight situations, never none.
      operationId: listConsignadoAverbacaoOperations
      parameters:
        - description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all eight.
          explode: true
          in: query
          name: status
          schema:
            description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all eight.
            items:
              enum:
                - claimed
                - averbacao_invoking
                - averbacao_unknown
                - attachment_pending
                - attachment_invoking
                - attachment_unknown
                - confirmed
                - rejected
              type: string
            type: array
        - description: The previous page's page.next_after. Omitted starts at the oldest claim. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the oldest claim. A cursor this service did not mint is refused, never restarted from the top.
            type: string
        - description: Maximum number of operations to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of operations to return. Omitted means the ceiling of 200.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationsPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the tenant's averbação operations
      tags:
        - Consignado Averbação Operations
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-averbacao-operations
  /v1/consignado/bid-submissions:
    get:
      description: |-
        Walks the tenant's bid book, newest claim first: which credits this bancarizador claimed in the leilão, what the rail did with each bid, and whether a fund's cessão was ever registered against it.

        'situation' is the row's own durable state, carried verbatim from the money path and never re-derived here. Five values: 'claimed' is the replay claim written before either proposal reached the rail; 'accepted' and 'refused' are the rail's answer; 'unknown' is an outcome that never arrived; and 'retry_in_flight' is a reconduction under way. Repeat 'situacao' to narrow the page to several at once (situacao=unknown&situacao=retry_in_flight). Omitting it means ALL FIVE, never none. A value outside the vocabulary is refused with 422 rather than matching nothing, because a page that matched nothing is indistinguishable from a tenant that never bid.

        'payload_retained' is what separates a reconducible unknown from one with no way back. It is DERIVED on every read from whether the request payload is still stored, and the payload itself never leaves the database. An unresolved submission with the payload gone can no longer be replayed.

        'retry_lease_expires_at' always carries an instant, including on a settled row where it is simply the last lease that was taken. An instant already in the PAST on a retry_in_flight row is a reconducible submission, and this read reports the book exactly as it stands: it never anticipates the reconduction the recovery sweep will perform.

        'cedido', 'cedido_at' and 'fundo_ref' travel as one trio, read from the contract's one cessão record whichever producer registered it (the bancarizador's command or the lender's own cessão), and half a cessão is not a state this ledger can hold. 'cedido' is actual OWNERSHIP and not mere attribution: 'fundo_ref' may name a fund on a credit nothing has ceded yet.

        Filter with 'cedido=true' for the ceded half or 'cedido=false' for the credits no cessão was ever registered against. OMITTING the parameter is the whole book, and that is the default on purpose: an accepted credit nobody registered a cessão for is precisely the row this screen exists to surface, so it is never filtered out unasked.

        'id_solicitacao' is null on a LOCAL REFUSAL recorded before the rail was ever reached, which is a real row of this book and not a missing value.

        Four columns of the stored row never leave: the two proposal and response payloads, the refusal reason and the actor subject. The first three carry money terms and matrícula, and the last is a subject identity. The payload digest, the retry fence and the purge clocks stay behind with them, as the money path's own fence evidence.

        Paging is keyset over the claim instant and the credit's business key, both frozen for the life of the row, which is what makes the position safe against a book the money path is still writing. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false, so a client loop may terminate on either. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the walk from the top.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501 and it is served on a deployment with the rail off entirely. That deployment simply has an empty book. The tenant is derived from the validated identity and is never read from the request.
      operationId: listConsignadoBidSubmissions
      parameters:
        - description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all five.
          explode: true
          in: query
          name: situacao
          schema:
            description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all five.
            examples:
              -   - claimed
            items:
              enum:
                - claimed
                - accepted
                - refused
                - unknown
                - retry_in_flight
              type: string
            type: array
        - description: Narrows the page to credits with a cessão registered (true) or to the ones without one (false). Omitted means the whole book, which is never the same as either half.
          explode: false
          in: query
          name: cedido
          schema:
            description: Narrows the page to credits with a cessão registered (true) or to the ones without one (false). Omitted means the whole book, which is never the same as either half.
            enum:
              - "true"
              - "false"
            examples:
              - "true"
            type: string
        - description: The previous page's page.next_after. Omitted starts at the newest claim. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the newest claim. A cursor this service did not mint is refused, never restarted from the top.
            examples:
              - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOToxMjozM1oiLCJrIjpbImMwMDEyIl19
            type: string
        - description: Maximum number of submissions to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of submissions to return. Omitted means the ceiling of 200.
            examples:
              - 50
            format: int64
            maximum: 200
            minimum: 1
            type: integer
        - description: Narrows the page to the bids ONE originador placed, matched byte for byte. A bancarizador may name any originador of its register; an originador authenticating with its own credential does not need to send it, and if it does it must be its own. Omitted is the whole book for a bancarizador, and the caller's own bids for an originador.
          explode: false
          in: query
          name: originadorRef
          schema:
            description: Narrows the page to the bids ONE originador placed, matched byte for byte. A bancarizador may name any originador of its register; an originador authenticating with its own credential does not need to send it, and if it does it must be its own. Omitted is the whole book for a bancarizador, and the caller's own bids for an originador.
            examples:
              - originador-a
            maxLength: 128
            minLength: 1
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BidSubmissionsPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The request carries no validated identity, or none that names a tenant.
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The identity is valid but does not hold consignado-operations/bid-submissions:read, is neither a bancarizador nor an originador, or is an originador whose originadorRef names a partner other than itself.
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: A caller-correctable refusal, always carrying one of two codes. BID_SUBMISSIONS_INVALID_CURSOR means the cursor was not minted by this service; restart the walk from the first page rather than editing a cursor. BID_SUBMISSIONS_UNKNOWN_SITUATION means the situation filter is outside the five this book records; it is refused rather than answered with an empty page, because a page that matches nothing is indistinguishable from a tenant that submitted no bids.
        "429":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The tenant's own request pace for this read was exceeded.
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: List the credits this tenant bid on and where each bid stands
      tags:
        - Consignado Bid Submissions
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-bid-submissions
  /v1/consignado/calendar:
    get:
      description: "Proxies consultar-calendario-trabalhador (Manual 005 v1.13 §3.1): the start/end dates of one payroll competência plus the rail's own notion of the CURRENT competência. It answers a competência WINDOW ONLY — Manual 005 §3.1 has zero occurrences of \"feriado\" and publishes no business-day field, so this route never claims a date is or is not a business day. Cached for up to one hour per (tenant, competência), because the read spends the rail's own request quota on every call; a cache hit answers with no rail round trip at all."
      operationId: getConsignadoCalendar
      parameters:
        - description: OPTIONAL payroll competência to query, yyyyMM (Manual 005 v1.13 §3.1.1, código CT). Omit it and the rail answers for its own current competência.
          explode: false
          in: query
          name: competencia
          schema:
            description: OPTIONAL payroll competência to query, yyyyMM (Manual 005 v1.13 §3.1.1, código CT). Omit it and the rail answers for its own current competência.
            examples:
              - "202410"
            pattern: ^[0-9]{6}$
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetCalendarResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read the rail's operational-calendar competência window
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-calendar
  /v1/consignado/capabilities:
    get:
      description: |-
        Reports which operation families THIS deployment reaches.

        The console reads it once and uses it to disable, rather than hide, a control that would otherwise answer 501. Nothing here is tenant data: the answer is a property of the running deployment and is identical for every tenant it serves. The tenant is still derived from the validated identity, as on every other operation, and is never read from the request.

        'name' is the operation family, never the name of the deployment flag behind it: a flag name is operator material.

        'reason' is a closed vocabulary of four values, one per mechanism. 'enabled' is the only one that appears beside available true. 'flag_off' means a boot flag made the composition skip building the family. 'portal_store_absent' means this deployment mounted no portal store. 'rail_client_absent' means no Dataprev client was wired, which takes the whole rail family with it.

        A family reported unavailable will answer 501 on every one of its operations. A family reported available may still answer 501 in the instant between this read and the call, so a client keeps its own 501 branch: this read tells a client what to offer, it does not replace the refusal.
      operationId: getConsignadoCapabilities
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapabilitiesResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: Report which operation families this deployment reaches
      tags:
        - Consignado Capabilities
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-capabilities
  /v1/consignado/clock:
    get:
      description: |-
        Answers the gateway's current instant: the clock it judges its own local refusals on, such as a consent signature dated ahead of it.

        A console reads it instead of the operator's machine clock, which can be off by minutes or a whole time zone. It takes no input and reads no tenant data.

        Dataprev judges its own refusals on its own clock: a listing window that ends ahead of the rail's clock is refused with code GR (Manual 001 v1.9 §3.2.1 p.15). Keep a margin of a minute or so behind this instant for an end bound the rail checks.
      operationId: getConsignadoClock
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClockResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: Read the gateway's clock
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-clock
  /v1/consignado/contract-registrations:
    get:
      description: Returns one tenant-scoped, commit-fenced page of confirmed Dataprev registration evidence.
      operationId: listConsignadoContractRegistrations
      parameters:
        - description: Opaque continuation cursor from the preceding page.
          explode: false
          in: query
          name: after
          schema:
            description: Opaque continuation cursor from the preceding page.
            type: string
        - description: Opaque immutable fence returned by the first page.
          explode: false
          in: query
          name: through
          schema:
            description: Opaque immutable fence returned by the first page.
            type: string
        - description: Maximum number of registrations to return.
          explode: false
          in: query
          name: limit
          schema:
            default: 100
            description: Maximum number of registrations to return.
            maximum: 500
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegistrationInventoryPage"
          description: OK
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "410":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Gone
        "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
      security:
        - BearerAuth: []
      summary: List confirmed consignado contract registrations
      tags:
        - Contract registrations
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-contract-registrations
  /v1/consignado/contract-registrations/{numero_contrato}:
    get:
      description: Returns one current, tenant-scoped observation without moving an inventory cursor.
      operationId: getConsignadoContractRegistration
      parameters:
        - description: Exact Dataprev contract number; it is never trimmed or normalized.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Exact Dataprev contract number; it is never trimmed or normalized.
            maxLength: 15
            minLength: 2
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegistrationInventoryObservation"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Get current consignado contract registration evidence
      tags:
        - Contract registrations
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-registration
  /v1/consignado/contracts/{numero_contrato}/antecipacao:
    post:
      description: "Proxies antecipar-parcela (Manual 013 v1.3 §2.1). The contract assumes \"Suspenso por Antecipação de Parcelas\" for every competência informed: it drops off the employer's loan listing for those competências, and the competências count toward parcelas pagas. The transition back to Ativo happens automatically at the competência's own virada — excluir-antecipar-parcela is the operation that undoes it early. The contract must be held by this gateway for the authenticated tenant; anything else is 404 before the rail is called. X-Idempotency is required."
      operationId: incluirConsignadoAntecipacaoParcela
      parameters:
        - description: Rail contract number of a contract this gateway holds for the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Rail contract number of a contract this gateway holds for the authenticated tenant.
            examples:
              - "1997123478"
            maxLength: 15
            minLength: 2
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-antecipacao-incluir-0001
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AntecipacaoIncluirBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AntecipacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Suspend one or more competências by early payment
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/incluir-consignado-antecipacao-parcela
  /v1/consignado/contracts/{numero_contrato}/antecipacao/{competencia}:
    put:
      description: Proxies excluir-antecipar-parcela (Manual 013 v1.3 §2.2), returning the contract to its normal discount schedule for the named competência. Same tenant-ownership proof and idempotency requirement as incluir.
      operationId: excluirConsignadoAntecipacaoParcela
      parameters:
        - description: Rail contract number of a contract this gateway holds for the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Rail contract number of a contract this gateway holds for the authenticated tenant.
            examples:
              - "1997123478"
            maxLength: 15
            minLength: 2
            type: string
        - description: The suspended competência to withdraw, yyyyMM.
          in: path
          name: competencia
          required: true
          schema:
            description: The suspended competência to withdraw, yyyyMM.
            examples:
              - "202611"
            pattern: ^[0-9]{6}$
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-antecipacao-excluir-0001
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AntecipacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Withdraw a competência's early-payment suspension
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/excluir-consignado-antecipacao-parcela
  /v1/consignado/contracts/{numero_contrato}/artifacts/{artifact_type}:
    get:
      description: Returns the verified artifact bytes. The bancarizador reads every contract of its tenant. A fund or originador credential reads a contract's signed CCB, biometrics pack and cadastro only when the fund or originador it acts for sent the averbação or one of its documentation attempts, and a fund credential also reads them once the contract is ceded to its fund. A contract a renegociação minted serves its signed CCB once Dataprev accepted its documentation, to the fund and originador the contract inherited from the contract it replaced. Any other contract answers the same 404 as a missing one. Missing and non-entitled artifacts share the same 404 response. The response contains no storage coordinates or direct-storage URL.
      operationId: getConsignadoContractArtifact
      parameters:
        - description: Client contract identity within the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Client contract identity within the authenticated tenant.
            examples:
              - contract-1
            minLength: 1
            type: string
        - description: Closed retained artifact type.
          in: path
          name: artifact_type
          required: true
          schema:
            description: Closed retained artifact type.
            enum:
              - signed_ccb
              - biometrics_documents_pack
            examples:
              - signed_ccb
            type: string
      responses:
        "200":
          content:
            application/pdf:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            application/zip:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
          description: Verified retained artifact bytes.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
            ETag:
              schema:
                type: string
            X-Content-Type-Options:
              schema:
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Download a retained consignado contract artifact
      tags:
        - Artifacts
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-artifact
  /v1/consignado/contracts/{numero_contrato}/averbacao:
    get:
      description: |-
        Returns ONE contract's averbação operation, by the rail contract number.

        It answers from a LOCAL table and never reaches the Dataprev rail. The tenant is derived from the validated identity: a contract that does not exist and a contract belonging to another tenant are the SAME answer, 404, so this read cannot be used to probe another tenant's book.

        A fund or originador credential reads only an averbação its own credential sent, or whose documentation it sent; any other contract answers the same 404. The bancarizador reads every contract of its tenant.

        The body is the operation object itself, with no envelope, the same shape as one element of GET /v1/consignado/averbacao-operations. Every conditional instant is present and null until the step it names has happened.

        This is the READ half of the address whose POST creates the payroll-deduction mandate. It creates nothing and changes nothing.
      operationId: getConsignadoContractAverbacaoOperation
      parameters:
        - description: The rail contract number, exactly as it was registered. It is never trimmed or normalized.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The rail contract number, exactly as it was registered. It is never trimmed or normalized.
            maxLength: 15
            minLength: 2
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationItem"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Get one contract's averbação operation
      tags:
        - Consignado Averbação Operations
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-averbacao-operation
    post:
      description: |-
        Submits averbar-consignado-trabalhador (Manual 003 v1.19 §3.1) and nothing else. An accepted averbação answers status attachment_pending and publishes consignado.averbacao.accepted: Dataprev holds the mandate, and the contract waits for its documentation — the signed CCB, the evidence pack when the averbação carries the booking block, and the Manual 004 signature evidence — sent through POST .../ccb-attachment. This body carries no document and no signing instant: artifacts, data_hora_assinatura and the signature-evidence fields are refused 422, or 413 first when the body exceeds 1 MiB, as one carrying a real signed CCB usually does. THIS COMMITS MONEY: the averbação creates the payroll-deduction mandate the worker starts paying — so the operation is marked x-money-path: true in this document. POST .../exclusion can cancel an accepted averbação, also while it waits for its documentation. X-Idempotency is required; the transport middleware supplies best-effort response replay while the durable PostgreSQL operation record remains the semantic authority, keyed by tenant and contract and bound to the request payload's digest. The numero_contrato in the body MUST equal the one in the path. A retry after the documentation was sent answers the operation as it stands and never attaches anything.

        This intake accepts a bancarizador credential, a fundo credential for its own fund, or an originador credential for a contract whose proposal came from its own bid (a fund it names is validated against the tenant's fund register first, and a contract outside its own bids is refused 403), and most other rail operations accept a bancarizador credential only — so do not assume the credential that reaches this route reaches the rest of the rail.
      operationId: averbarConsignadoContract
      parameters:
        - description: "The contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits. Must equal the numero_contrato in the body."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits. Must equal the numero_contrato in the body."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            pattern: ^[A-Za-z0-9]+$
            type: string
        - description: Required idempotency key. Absent is 422, never a generated default.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required idempotency key. Absent is 422, never a generated default.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AverbacaoRequestedCommand"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the averbação this contract already holds. AVERBACAO_CLAIM_CONFLICT means the averbação is already claimed under another idempotency key, so follow the claim that exists rather than opening a second one. It is definitive. CONTRACT_ALREADY_REGISTERED means the contract number is already a contract in this gateway (minted by a refinanciamento or renegociação, imported, or received by portability); nothing was written and nothing was sent to Dataprev. It is definitive. AVERBACAO_HELD_BY_ANOTHER_SENDER means a credential of another nature (bancarizador, fundo or originador) sent this same request first and it has not reached Dataprev: only a credential of that nature resumes it, by sending it again. It stops once Dataprev answers that request. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The request cannot be processed as sent. IDEMPOTENCY_KEY_REUSE means the X-Idempotency key is spent on a different request: send a new key. FUNDO_NOT_REGISTERED means fundo_ref names no fund registered for this tenant, and FUNDO_DEACTIVATED a fund that no longer accepts new credit: correct fundo_ref. A body carrying documents or Manual 004 signature evidence answers 422, or 413 first when it exceeds 1 MiB: they are sent through POST .../ccb-attachment, and so is data_hora_assinatura. FIRST_DEDUCTION_BEFORE_COMPETENCIA means data_primeiro_desconto falls in a month before first_deduction_competencia; DECLARED_DATES_OUT_OF_ORDER means the declared dates break an order the booking requires (see data_inicio_contrato and data_primeiro_desconto); correct the dates and resend. BOOKING_FIELD_INVALID means the lender cannot read a booking field (see loan_product_version, margin_snapshot, contract_id and fundo_ref). DECLARED_TERMS_INCONSISTENT means the declared amounts or rates contradict each other (see principal_amount and monthly_rate); correct the terms. MARGIN_SNAPSHOT_INCONSISTENT means margin_snapshot does not hold installment_amount; read the margin again or re-price. CONTRACT_NOT_BOOKABLE means the lender cannot book this contract at all (see installment_count and expected_disbursement_date); send it without the booking block. RATE_OUTSIDE_PRODUCT_RANGE means monthly_rate times 12 falls outside the annual rate range of the loan_product_version the Lender published; a version this gateway has not seen is not checked. Each detail names the rule. All of these apply only with the booking block, and the rail was not called; a retry of an averbação the rail already accepted is not refused."
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Averbar a consignado contract on the payroll rail
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/averbar-consignado-contract
  /v1/consignado/contracts/{numero_contrato}/ccb-attachment:
    post:
      description: |-
        Submits incluir-informacoes-contrato-trabalhador (Manual 004 v1.6 §2.1) for a contract whose averbação Dataprev already accepted, or that a renegociação Dataprev accepted through this gateway minted (Manual 004 §1.2.1), and nothing else: it never averbates. With neither for the path's contract — no averbação sent, or one still in flight, ambiguous or rejected, and no accepted renegociação that minted it — it answers 409 AVERBACAO_NOT_ACCEPTED and nothing is sent to Dataprev. The body is the documentation alone: the signed CCB, the evidence pack and signature_evidence_ref when the averbação carried the booking block (refused when it did not), data_hora_assinatura, the instant the worker signed, which may be days after the averbação, and the §2.1.1 signature evidence. The contract's identity and terms are the averbação's and are not sent again; an optional dados_cadastrais replaces the averbação's cadastro block. A contract takes one accepted documentation, fixed under its own X-Idempotency key and payload digest: the same documentation under a new key replays, and a different one is 409 AVERBACAO_DOCUMENTATION_CONFLICT. When Dataprev refuses the documentation, the answer is 422 with Dataprev's códigos in the upstream member and the contract waits for documentation again: send it corrected under a new X-Idempotency key, or exclude the contract. Any other failure of the call (no answer in time, a Dataprev 5xx, a lost connection, an unusable receipt) also returns the contract to waiting for documentation and answers 5xx: send the same documentation again, under the same X-Idempotency key or a new one, and Dataprev replaces what it holds and returns a new receipt. The documents are retained before Dataprev is called, and the rail's hashOperacao is recorded durably so a replay is answered from the record. An accepted attachment answers confirmed and publishes consignado.averbacao.confirmed.

        A contract a renegociação minted is documented with the signed CCB of the contract it replaced, whose clause allows the renegotiation on a change of employer. Its identity is the one the renegociação registered, it takes the signed CCB alone (signature_evidence_ref, the evidence pack and dados_cadastrais are refused 422), the signed CCB is retained before Dataprev is called, as an averbação's documents are, and an accepted attachment answers confirmed without contractId or averbacaoAt and publishes nothing: a renegociação disburses nothing.

        THIS COMMITS MONEY, which is why it is marked x-money-path: true: its acceptance confirms an averbação's contract, which is what bills it and hands it to the Lender for booking and disbursement. The conditional signature-evidence fields are mutually exclusive §2.1.1 branches, so send the branch your signing flow used rather than the union of the per-field examples: indicador_analfabetismo, indicador_assinatura_cert_digital_icp_brasil or nsu_contrato makes the flow biometrics-exempt.

        This intake accepts a bancarizador credential, a fundo credential for a contract of its own fund, or an originador credential for a contract whose proposal came from its own bid (any other contract is refused 403), and most other rail operations accept a bancarizador credential only — so do not assume the credential that reaches this route reaches the rest of the rail. A body carrying dados_cadastrais also needs the averbação's grant, consignado-rail/averbacao:write, beside this route's consignado-rail/ccb:write: without it the request is refused 403 before anything is recorded or sent to Dataprev.
      operationId: attachConsignadoCCB
      parameters:
        - description: The contract whose accepted averbação this documentation is for.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The contract whose accepted averbação this documentation is for.
            examples:
              - 99999999999AN1
            type: string
        - description: Required idempotency key of the documentation, its own and not the averbação's. Absent is 422, never a generated default.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required idempotency key of the documentation, its own and not the averbação's. Absent is 422, never a generated default.
            examples:
              - idem-ccb-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CCBAttachmentRequestedCommand"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the averbação or the documentation this contract holds; nothing was sent to Dataprev. AVERBACAO_NOT_ACCEPTED means Dataprev has not accepted an averbação for this contract — none was sent, or it is still in flight, ambiguous or rejected — nor did a renegociação accepted through this gateway mint it: read GET .../averbacao before sending the documentation again (a contract a renegociação minted has no averbação, and GET .../averbacao answers 404 for it). AVERBACAO_DOCUMENTATION_CONFLICT means the contract's documentation is already fixed under another idempotency key with a different payload, or another documentation of it is on its way to Dataprev, or the contract was documented before documentation had its own record: a contract takes one accepted documentation, so follow the existing one. AVERBACAO_EXCLUDED means an exclusion of this averbação was requested and Dataprev has not rejected it, or the contract left the registry (a refinanciamento, renegociação or portability exclusion recorded here, an exit dataprev_follow_up observed at Dataprev, or a termination the Manual 006 report listed), so no documentation is accepted while it stands. AVERBACAO_ARTIFACT_CONFLICT means a different document is already retained for this contract, and a retained document is never replaced. AVERBACAO_DOCUMENTATION_CONFLICT and AVERBACAO_ARTIFACT_CONFLICT are definitive unless the documentation on its way fails at Dataprev, which returns GET .../averbacao to attachment_pending (a contract a renegociação minted then waits for documentation again); AVERBACAO_EXCLUDED is definitive only once GET .../exclusion reads confirmed, and once it reads rejected the same documentation goes through; for a contract that left the registry it is definitive unless a refinanciamento reversal returns it to ativo; AVERBACAO_NOT_ACCEPTED is definitive only once GET .../averbacao reads rejected, since an averbação in flight or ambiguous may still be accepted and the same documentation then goes through. AVERBACAO_HELD_BY_ANOTHER_SENDER means a credential of another nature (bancarizador, fundo or originador) sent this same request first and it has not reached Dataprev: only a credential of that nature resumes it, by sending it again. It stops once Dataprev answers that request. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "With the upstream member, Dataprev refused the documentation and its códigos are there: the contract waits for documentation again, so send it corrected under a new X-Idempotency key, or exclude the contract. Without it, the request cannot be processed as sent, and nothing was sent to Dataprev. IDEMPOTENCY_KEY_REUSE means the X-Idempotency key is spent on a different request, here or on another contract: send a new key. For an averbação sent with the booking block, FORMALIZATION_DEADLINE_EXCEEDED means data_hora_assinatura is after its formalization_deadline: the formalization window lapsed, so exclude the averbação through POST .../exclusion and formalize the contract again, and DECLARED_DATES_OUT_OF_ORDER means data_hora_assinatura is more than five minutes ahead of the gateway's clock. Otherwise the detail names the rule: the signed CCB must be a canonical base64 PDF, an averbação sent with the booking block requires signature_evidence_ref and the evidence pack while one sent without it takes neither, the §2.1.1 signature-evidence branch must be complete, and a dados_cadastrais block must agree with the averbação's cpf and employer kind."
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Attach the signed CCB for an accepted averbação or renegociação
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/attach-consignado-ccb
  /v1/consignado/contracts/{numero_contrato}/corrections:
    get:
      description: |-
        Lists every correction one contract carries, so an operator can prove WHAT was superseded, in which order, and which correction is current.

        A contract nobody has had to correct answers 200 with an empty list, never 404. Having never been corrected is a normal state of a registered contract, and a miss there would read as "no such contract". A fund credential lists only a contract ceded to its fund, or the new contract of a renegociação or refinanciamento of contracts ceded to it while that contract is not ceded itself; any other contract answers the same empty list.

        One contract can carry SEVERAL independent chains: one for its CCB and one per corrected payment. They are laid end to end rather than interleaved, each ordered root first and head last, because there is no order BETWEEN chains and publishing one would invent a fact. Each item names its own `correction_type` and `payment_reference`, which is what tells the chains apart.

        `is_head` is declared by the server and answers "which correction is current". The head is the one correction nothing supersedes, which is a TOPOLOGICAL property: deriving it from a timestamp can name an already-superseded row, so it is derived here once instead of once per client.

        `supersedes_event_id` is null on a first CCB correction, and that null MEANS the original contract-registration fact. It travels as null rather than being omitted, so a reader never has to tell "no such field" apart from "supersedes the original".

        There is NO paging and no cursor. The chain's order is topological, and a keyset needs a position that survives the next append, which supersession links are not. The answer is bounded at 200 items instead, and reaching the bound is REPORTED through `truncated` rather than swallowed: a cut nobody is told about reads as a complete audit trail on the one surface whose purpose is proving what was corrected. `truncated` is also true when a chain link points at a correction this answer does not carry, which means the same thing to the reader.

        Three columns of the stored row never leave: the client's own transport key, and the gateway's object key and version id. The published `resource_uri` is the only address a caller is given, and it is the same path the correction fact names.

        It answers from a LOCAL table and never reaches the Dataprev rail. It answers 501 on a deployment that composed no correction family, which is a deployment posture rather than a wrong URL. The tenant is derived from the validated identity and is never read from the request.
      operationId: listConsignadoContractCorrections
      parameters:
        - description: "The rail contract number whose corrections to enumerate. Exact, control-free UTF-8, bounded in BYTES: 2..15, the same bound the intake enforces."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The rail contract number whose corrections to enumerate. Exact, control-free UTF-8, bounded in BYTES: 2..15, the same bound the intake enforces."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractCorrectionsChain"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: List one contract's correction chain
      tags:
        - Consignado Corrections
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-contract-corrections
    post:
      description: |-
        Records a correction to something the client already asserted about a registered contract, and publishes the fact that names it.

        This is NOT a Dataprev operation: no rail credential is used and no government boundary is crossed. Manual 005 revision 1.13 states the rail's retification fields are no longer used and always return null, so the client is the only authority a correction can have — `source_authority` is always `client`.

        NOTHING IS MUTATED. A correction is an append that names what it supersedes, and the record it corrects stays immutable in the database exactly as it was. Correcting the same thing twice appends a second correction that supersedes the first.

        The gateway takes custody of the corrected resource and computes its SHA-256 itself; a client-declared digest is never accepted. The published fact carries a same-origin path back to this gateway plus that digest, and the consumer fetches and verifies it over authenticated M2M.

        | correction_type | payment_reference | supersedes |
        |---|---|---|
        | `ccb` | must be empty | the previous CCB correction, or nothing on the first |
        | `disbursement` | required | the confirmed payment it repairs, then the previous correction of that payment |

        A disbursement correction naming a payment this deployment holds no confirmation for is refused with 404: a supersession pointing at nothing is worse than no correction.

        X-Idempotency is mandatory, opaque, 1..128 bytes, and never defaulted. PostgreSQL is the authority: the same key replays the identical 202 body and publishes no second fact, and the same key carrying a different correction answers 422 without ever returning the earlier body.
      operationId: recordConsignadoContractCorrection
      parameters:
        - description: "The rail contract number the correction is about. Exact, control-free UTF-8, bounded in BYTES: 2..15, which is the consumer's own bound for this field."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The rail contract number the correction is about. Exact, control-free UTF-8, bounded in BYTES: 2..15, which is the consumer's own bound for this field."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            type: string
        - description: "Mandatory opaque replay key, 1..128 bytes of valid UTF-8, preserved byte for byte. No default, no alias header, no case folding: two keys differing in one byte are two keys."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Mandatory opaque replay key, 1..128 bytes of valid UTF-8, preserved byte for byte. No default, no alias header, no case folding: two keys differing in one byte are two keys."
            examples:
              - idem-correcao-0001
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContractCorrectionRequest"
        required: true
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractCorrectionResponse"
          description: The correction is durably recorded and its fact queued. A replay under the same key answers with the identical body.
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Authentication is required to access this resource.
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: You do not have permission to access this resource.
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: A disbursement correction named a payment reference this deployment holds no confirmation for.
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "Another correction already supersedes the same event. The chain is a list, not a tree: re-read the head and retry."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The transport key, the contract number or the body is refused. A key that already bought a DIFFERENT correction lands here too, and the earlier body is never returned.
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: This deployment does not record contract corrections.
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Contract correction persistence is temporarily unavailable.
      security:
        - BearerAuth: []
      summary: Record a correction to a registered contract
      tags:
        - Consignado Corrections
      x-mint:
        href: /pt/reference/rails/consignado/record-consignado-contract-correction
  /v1/consignado/contracts/{numero_contrato}/corrections/{correction_id}:
    get:
      description: |-
        Returns the corrected resource bytes a correction fact points at, verified against the digest that fact published.

        This is the endpoint the consumer's M2M artifact reader calls. It answers bytes or an error and never a redirect, a byte range or a content-coded body: each of those turns a valid correction into a terminal failure on the consumer side.

        An unknown correction and one belonging to another tenant share the same 404. The tenant is part of the chain's primary key, so the distinction is not made rather than merely hidden.
      operationId: getConsignadoContractCorrectionResource
      parameters:
        - description: The rail contract number the correction belongs to.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The rail contract number the correction belongs to.
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            type: string
        - description: The correction identity published as the fact's event id.
          in: path
          name: correction_id
          required: true
          schema:
            description: The correction identity published as the fact's event id.
            examples:
              - 1f5b9c26-6f5a-4f77-9c1c-5d1c0f0a9b21
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/pdf:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            application/zip:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
          description: Verified corrected resource bytes.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
            ETag:
              schema:
                type: string
            X-Content-Type-Options:
              schema:
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Download the corrected resource a correction fact names
      tags:
        - Consignado Corrections
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-correction
  /v1/consignado/contracts/{numero_contrato}/dados-cadastrais:
    get:
      description: |-
        Returns the contract's cadastro — the averbação's `nome_trabalhador`, plus the `dados_cadastrais` block the documentation sent, else the averbação's — as the exact bytes stored when that block arrived. Until the contract confirms, it is the client's provisional statement. Their SHA-256 is the `dados_cadastrais_digest_sha256` that consignado.contract.registered published, so the consumer verifies the body against the fact and never parses before verifying.

        A contract with no cadastro, a missing contract and another tenant's contract share the same 404. The tenant comes from the validated identity. The bancarizador reads every contract of its tenant. A fund or originador credential reads a contract's signed CCB, biometrics pack and cadastro only when the fund or originador it acts for sent the averbação or one of its documentation attempts, and a fund credential also reads them once the contract is ceded to its fund. Any other contract answers the same 404 as a missing one.
      operationId: getConsignadoContractDadosCadastrais
      parameters:
        - description: Client contract identity within the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Client contract identity within the authenticated tenant.
            examples:
              - 99999999999AN1
            minLength: 1
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DadosCadastraisDocument"
          description: The stored cadastro bytes, verbatim.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
            X-Content-Type-Options:
              schema:
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Read the cadastro stored with a consignado averbação
      tags:
        - Artifacts
      x-mint:
        href: /pt/reference/rails/consignado/read-the-cadastro-stored-with-a-consignado-averbacao
  /v1/consignado/contracts/{numero_contrato}/disbursement-confirmation:
    post:
      description: |-
        Records the gateway's own durable fact that a client bank ALREADY paid a worker. This is NOT a Dataprev operation: no rail credential is used, no government boundary is crossed, and Dataprev publishes no disbursement-confirmation operation to proxy. The gateway records what the client asserted; it asks no downstream product whether the payment is plausible.

        It accepts ORPHAN confirmations — money for a contract this deployment never registered locally — and a contract may be disbursed in MORE THAN ONE payment. The identity of a confirmation is (tenant, numero_contrato, payment_reference), so a second payment under a different reference on the same contract is a first acceptance with its own fact, never a conflict.

        X-Idempotency is mandatory, opaque, 1..128 bytes, and never defaulted. Two keys differing in one byte are two keys, and there is no X-Idempotency-Key alias.

        | Case | Status | X-Idempotency-Replayed |
        |---|---|---|
        | First acceptance | 202 | absent |
        | Same key, same request, served from the transport cache | 202, the identical bytes | true |
        | Same key, same request, served from the durable authority | 202, the identical bytes | absent |
        | Same key, divergent request | 422 — never the earlier body | whatever the shared middleware wrote |
        | New key, same payment | 202, the same body | absent |
        | New key, same payment reference, different money | 409 | whatever the shared middleware wrote |

        PostgreSQL is the authority on every row. The transport idempotency cache is a best-effort accelerator over it, in BOTH directions: whether that cache fails before the request is decided or after the confirmation is already committed, the answer is the durable one and the only difference on the wire is that the replay header is absent. A cache failure never turns a recorded payment into a 503. That is a different failure from a shared Redis outage, which the tenant rate limiter refuses first.
      operationId: confirmConsignadoDisbursement
      parameters:
        - description: "The rail contract number the money was paid against (Manual 004 §2.2.2 p.18: Texto, 15). Exact, control-free UTF-8, bounded in BYTES: no trimming and no case folding. Nothing looks it up — an orphan confirmation for a contract this deployment never registered is first-class."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The rail contract number the money was paid against (Manual 004 §2.2.2 p.18: Texto, 15). Exact, control-free UTF-8, bounded in BYTES: no trimming and no case folding. Nothing looks it up — an orphan confirmation for a contract this deployment never registered is first-class."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 1
            type: string
        - description: "Mandatory opaque replay key, 1..128 bytes of valid UTF-8, preserved byte for byte. There is no default, no X-Idempotency-Key alias, no case folding and no normalization: two keys differing in one byte are two keys."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Mandatory opaque replay key, 1..128 bytes of valid UTF-8, preserved byte for byte. There is no default, no X-Idempotency-Key alias, no case folding and no normalization: two keys differing in one byte are two keys."
            examples:
              - idem-desembolso-0001
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DisbursementConfirmationRequest"
        required: true
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DisbursementConfirmationResponse"
          description: The confirmation is durably recorded. A replay of the same payment — under the same key or a new one — answers with the identical body.
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Authentication is required to access this resource.
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: You do not have permission to access this resource.
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The key is in flight, or this payment reference already holds an immutable confirmation carrying different money.
        "413":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The raw body exceeds the 1 KiB wire guard.
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The transport key, the contract number or the body is refused. A key that already bought a DIFFERENT confirmation lands here too, and the earlier body is never returned.
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: This deployment records no disbursement confirmations.
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "Disbursement confirmation persistence is temporarily unavailable. Mandatory persistence answers it — PostgreSQL and the outbox — and so does the tenant rate limiter when its shared Redis is down, before the confirmation is read. Either way nothing was recorded and the client retries. An idempotency-cache failure never produces this answer, in either direction: before the request is decided the cache is bypassed, and after the confirmation is committed the recorded 202 stands."
      security:
        - BearerAuth: []
      summary: Confirm a disbursement already paid to the worker
      tags:
        - Consignado Disbursement
      x-mint:
        href: /pt/reference/rails/consignado/confirm-consignado-disbursement
  /v1/consignado/contracts/{numero_contrato}/exclusion:
    get:
      description: |-
        Reads the exclusion this gateway durably holds for one contract — the outcome of excluir-consignado-trabalhador (Manual 003 v1.19 §3.3). It is a LOCAL read: it never calls Dataprev and never starts a reconciliation pass, because the gateway's own row already answers and an M003 operation with no undo does not justify spending the rail's rate budget on the question.

        404 means the gateway holds nothing for this contract.
      operationId: getConsignadoContractExclusion
      parameters:
        - description: The rail contract number whose exclusion is read.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The rail contract number whose exclusion is read.
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExclusionOperationResponse"
          description: The exclusion operation that describes the contract now.
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The gateway holds no exclusion operation for this contract.
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read the exclusion this gateway holds for a contract
      tags:
        - Consignado Rail Commands
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-exclusion
    post:
      description: |-
        Removes one averbado contract from the Dataprev registry through excluir-consignado-trabalhador (Manual 003 v1.19 §3.3). THERE IS NO UNDO, which is why the operation is marked x-money-path: true.

        The contract is excludable once its averbação is confirmed, or while Dataprev accepted it and it still waits for its documentation (attachment_pending with no documentation on file: none sent through POST .../ccb-attachment, or the last one failed at Dataprev; an attachment_invoking call past its attachment_invocation_deadline_at lost its process and counts as failed). From that claim on, documentation for the contract is refused with 409 AVERBACAO_EXCLUDED until the exclusion ends rejected under any evidenceSource but m005_observation. A rejection under m005_observation means the contract already left the registry, so its documentation stays refused. A contract with no averbação in this gateway is excludable while the gateway reports it in M015 and it is still in the registry: imported without booking, a renegotiated legado, a portability received, or the new contract of a refinanciamento or renegociação.

        The body carries exactly ONE key. codigoSolicitante, cpfTrabalhador, matricula, codigoInscricaoEmpregador and numeroInscricaoEmpregador are never accepted from the caller: they identify the worker and the employer and come from the immutable local booking snapshot or, for a contract without one, from its M015 obligation, so a client cannot address an exclusion at a worker the gateway's own records never covered.

        The answer distinguishes the three outcomes a caller must be able to tell apart:

        | Status | Meaning |
        |---|---|
        | 201 | This call created the attempt and it reached a terminal state — confirmed (the contract came off the payroll) or rejected (this exclusion did not run: the registry refused it, and its own code and message are in the body; or, under evidenceSource m005_observation, the contract read showed the contract already off the registry, reasonCode contract_left_registry.*) |
        | 200 | A replay of an attempt that is ALREADY terminal: the outcome in the body is the earlier attempt's, and this call invoked nothing |
        | 202 | The gateway holds the request and the effect at the registry is not known yet; M005 reconciliation converges it. A replay of an attempt that is not terminal yet is also a 202 — X-Idempotency-Replayed, not the status code, is what says whether this call invoked anything |

        A rejected attempt is a BUSINESS answer, not a transport error: the body carries the registry's refusal, or the contract read that closed it, for the client to read.
      operationId: excluirConsignadoContract
      parameters:
        - description: "The rail contract number (Manual 003 §3.3.1 p.15: Texto, 2 to 15 characters of free choice). Exact, control-free UTF-8: no trimming and no case folding."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The rail contract number (Manual 003 §3.3.1 p.15: Texto, 2 to 15 characters of free choice). Exact, control-free UTF-8: no trimming and no case folding."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            type: string
        - description: "Mandatory opaque replay key, 1..128 bytes of valid UTF-8, preserved byte for byte. There is no X-Idempotency-Key alias, no case folding and no normalization: two keys differing in one byte are two keys."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Mandatory opaque replay key, 1..128 bytes of valid UTF-8, preserved byte for byte. There is no X-Idempotency-Key alias, no case folding and no normalization: two keys differing in one byte are two keys."
            examples:
              - idem-exclusao-0001
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExclusionCommandRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExclusionOperationResponse"
          description: "A replay of an attempt that is already terminal: the outcome in the body is the earlier attempt's, and this call invoked nothing."
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExclusionOperationResponse"
          description: This call created the attempt and it reached a terminal state — confirmed, or rejected carrying the registry's own code and message.
          headers:
            X-Idempotency-Replayed:
              schema:
                description: True when the durable record supplied the answer without another rail invocation.
                type: string
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExclusionOperationResponse"
          description: The gateway holds the request and the effect at the registry is not known yet, whether or not this call invoked anything.
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the exclusion authority or booking this contract already holds. EXCLUSION_AUTHORITY_CONFLICT means the exclusion is already recorded under another authority, and an exclusion has no undo, so this request was not applied. EXCLUSION_BOOKING_IDENTITY_INCOMPLETE means the booking lacks the worker or employer identity M003 requires: correct the booking, not this request. Both are definitive. EXCLUSION_DOCUMENTATION_UNDERWAY means Dataprev accepted the averbação and its documentation is already recorded or on its way (attachment_invoking before its attachment_invocation_deadline_at), so it is not confirmed yet. While GET .../averbacao reads attachment_pending, the recorded documentation completes only when the same documentation is sent again to POST .../ccb-attachment; exclude the contract once it reads confirmed. Nothing was sent to Dataprev."
        "413":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The raw body exceeds the 1 KiB wire guard.
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The body, the reason code or the contract number is refused locally, before anything reaches Dataprev.
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Remove an averbado contract from the payroll registry
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/excluir-consignado-contract
  /v1/consignado/contracts/{numero_contrato}/fgts-garantia/execucao:
    get:
      description: |-
        Reads the FGTS-guarantee execution this gateway durably holds for one contract (Manual 017 §3.1).

        It is a LOCAL read: it never calls Dataprev, opens no worker consent and spends none of the rail's rate budget. There is nothing out there to call — Manual 017 publishes consultar-saldo, listar-autorizados and the execution itself, and NO operation that asks the registry whether it already executed. The gateway's own row is the whole answer, which is why an unestablished outcome is reconciled by an operator rather than retried.

        This exists because the execution is the one irreversible cash movement whose outcome used to be readable in exactly one place: the response to the POST that performed it. A closed tab or a dropped connection left an operator unable to tell whether the money moved.

        The four statuses, and what each one means for the caller:

        | Status | Meaning |
        |---|---|
        | executed | The rail confirmed. protocolo is the receipt and dtPrevRepasse the forecast repasse date |
        | refused | The rail PROVED it executed nothing. Terminal for that idempotency key, but the contract is released: a corrected request under a NEW key may execute |
        | claimed | The gateway recorded the request and the rail has not answered yet |
        | unknown | The outcome could not be established. Terminal for the key, and the contract stays fenced until an operator reconciles — retrying could execute the guarantee twice |

        404 means the gateway holds no execution record for this contract. It is never answered as an empty record: on a movement with no undo, "we hold nothing" and "we hold a claim nobody settled" are the two answers that must never be confused.

        The idempotency key and the payload digest are not published. They are internal replay mechanics, and the digest fingerprints a body carrying the worker's CPF.
      operationId: getConsignadoContractFgtsGuaranteeExecution
      parameters:
        - description: The rail contract number whose guarantee execution is read.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The rail contract number whose guarantee execution is read.
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 1
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FgtsGuaranteeExecutionRecordResponse"
          description: OK
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The gateway holds no FGTS guarantee execution for this contract.
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read the FGTS guarantee execution this gateway holds for a contract
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-fgts-guarantee-execution
  /v1/consignado/contracts/{numero_contrato}/import:
    post:
      description: |-
        Adopts a contract that is ALREADY averbado on the payroll rail — registered on the Dataprev portal by hand, by a previous provider, or carried in from a book you are migrating — so its recurring saldo devedor obligation (Manual 015 §2.2) exists here and its first M015 report is scheduled.

        It does NOT averbate anything and it moves no money: the only call it makes to Dataprev is consultar-emprestimo-trabalhador (Manual 005 v1.13 §3.2.1), a read, under your own credential. Everything the obligation needs — the worker's CPF and matrícula, the employer inscription, the instalment count, the instalment amount, the first discount competência, the monthly rate and the first deduction date — is taken from that read. You send the contract number and, optionally, how many competências have already amortized; you never send worker or employer identifiers, and none come back.

        Only a LIVE contract can be imported: situação 0 (Ativo), 7 (Contrato suspenso), 8 (Suspenso banco) or 17 (Contrato suspenso por antecipação de parcela). A suspension is not a closure — the deduction is still attached to the worker and the debt is still reportable. Situação 2, 3, 15 and 16 are closed and refused 422 whose detail names the código the registry published (`situacaoEmprestimo 3 não é vigente`) and nothing else — Dataprev's own descrição is never relayed into the body. Importing one would make this gateway file recurring reports about a debt the registry already ended. A read that carries no situação at all, no competência de início de desconto, no monthly rate (valorTaxaMensal) or first deduction date (dataPrimeiroDesconto), or one that answers about a different contract number, is refused 422 the same way rather than guessed at.

        The import is not idempotent in the ordinary sense: a contract this tenant already holds an obligation for is answered 409 CONTRACT_ALREADY_REGISTERED, with nothing changed and the parcelas_pagas you sent NOT applied. X-Idempotency is still required, and the transport middleware replays the answer of a duplicate request under the same key.

        WITH BOOKING (booking + registration): the contract is also handed to the Lerian lender exactly as an averbação through this gateway would hand it — both documents are retained in this gateway's custody and consignado_contract.registered is published afterwards. booking is the averbação body with its full booking block; registration is the rail acknowledgement you received. First, before the Dataprev read, a booking the lender would refuse to book answers 422 with the codes of the averbação and documentation routes (BOOKING_FIELD_INVALID, DECLARED_TERMS_INCONSISTENT, MARGIN_SNAPSHOT_INCONSISTENT, CONTRACT_NOT_BOOKABLE, DECLARED_DATES_OUT_OF_ORDER, FORMALIZATION_DEADLINE_EXCEEDED), its detail naming the rule, and nothing is read or written; when the refused value is the one Dataprev holds, import the contract without booking. FIRST_DEDUCTION_BEFORE_COMPETENCIA is the averbação's own rule and never refuses an import. Before anything is written the booking is checked against the same Dataprev read: worker, employer and contract must be the published ones; every money term (principal, liberado, parcela, quantidade, taxas, CET, IOF), the first discount competência, the contract dates and the guarantee must equal what the read publishes (a date or guarantee value the rail does not publish is not compared); registration.averbado_at must sit within one minute of the read's aceito_em; and the read must carry every term the registration needs. Otherwise 422. The same request replays with the same answer; a different booking for a contract already in the averbação book is 409 CONTRACT_ALREADY_REGISTERED. In this mode an obligation the contract already holds is NOT a conflict: it is left untouched and saldo_devedor_dispatch_scheduled answers false. Nothing is averbated and the CCB is not attached at Dataprev.
      operationId: importConsignadoContract
      parameters:
        - description: "The contract number as the RAIL holds it (Manual 005 v1.13 §3.2.1 p.13, 2..15 alphanumerics). It is the only identifier the import takes: everything else about the contract is read back from Dataprev."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The contract number as the RAIL holds it (Manual 005 v1.13 §3.2.1 p.13, 2..15 alphanumerics). It is the only identifier the import takes: everything else about the contract is read back from Dataprev."
            examples:
              - "199971600000"
            maxLength: 15
            minLength: 2
            pattern: ^[A-Za-z0-9]+$
            type: string
        - description: Required idempotency key. Absent is 422, never a generated default.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required idempotency key. Absent is 422, never a generated default.
            examples:
              - idem-import-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContractImportRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractImportResponse"
          description: Created
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with an obligation this contract already holds. CONTRACT_ALREADY_REGISTERED means this tenant's saldo devedor book already carries this contract, whether it was averbado through this gateway or imported earlier. It is definitive: nothing about the existing obligation was changed, and the parcelas_pagas sent with this request was not applied. Read the contract's saldo devedor instead of importing it again. With a booking, the same code also means the contract is already in this tenant's averbação book — averbado through this gateway, or imported with a different booking — and nothing was written; the original request replays. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Import a contract already averbado outside this gateway
      tags:
        - Consignado Rail Commands
      x-mint:
        href: /pt/reference/rails/consignado/import-consignado-contract
  /v1/consignado/contracts/{numero_contrato}/portabilidade/exclusao:
    post:
      description: "Proxies excluir-portabilidade-trabalhador (Manual 008 v1.10 §4.1), the ORIGIN institution's write: the contract named in the path stops being consigned here because the worker moved it to the institution named by codigoProponente. codigoOrigem is never accepted from the caller — it is the authenticated tenant's own COMPE/CBC. The contract must be held by this gateway for the authenticated tenant; anything else is 404 before the rail is called. The call is claimed durably before it departs and closed durably after the answer lands, so a retry under the same X-Idempotency key is answered from the retained rail answer instead of excluding a second time, and a call whose outcome nobody established is reconciled against the registry rather than lost. Success publishes consignado.portabilidade.efetivada; a published refusal, or an unknown outcome that still reads Ativo in an M005 read started one hour past its deadline (reason_code GW-M005-NAO-EXECUTADO), publishes consignado.portabilidade.rejeitada. A portability the client performs OUTSIDE this gateway publishes nothing: Manual 008 §5.4's consulta is proponente-only, so the origin institution has no discovery path. X-Idempotency is required."
      operationId: excluirConsignadoPortabilidade
      parameters:
        - description: The contract leaving this institution. Must be held by this gateway for the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The contract leaving this institution. Must be held by this gateway for the authenticated tenant.
            examples:
              - 99999999999AP1
            maxLength: 15
            minLength: 2
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default. It is the durable replay identity of this command."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default. It is the durable replay identity of this command."
            examples:
              - idem-exclusao-portabilidade-0001
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExclusaoPortabilidadeBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExclusaoPortabilidadeResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Exclude a contract from this institution because the worker ported it out
      tags:
        - Consignado Rail
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/excluir-consignado-portabilidade
  /v1/consignado/contracts/{numero_contrato}/rail-document:
    get:
      description: "Proxies consultar-informacoes-contrato-trabalhador (Manual 004 §2.2): the document the payroll rail holds for a contract, selected by tipoArquivo (2..5). The response is the document itself, streamed in the content type the rail declared — not a JSON envelope with base64. tipoArquivo is required and validated locally, so an out-of-domain value never spends rail quota. Nothing is cached: the value of this operation is being the rail's current truth. The route accepts no CPF, because the rail operation has no such parameter."
      operationId: getConsignadoContractRailDocument
      parameters:
        - description: "Rail contract number (Manual 004 §2.2.2 p.18: Texto, 15)."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "Rail contract number (Manual 004 §2.2.2 p.18: Texto, 15)."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 1
            type: string
        - description: Document selector, published domain 2..5 (Manual 004 §2.2.2 p.18). REQUIRED — there is no default.
          explode: false
          in: query
          name: tipoArquivo
          required: true
          schema:
            description: Document selector, published domain 2..5 (Manual 004 §2.2.2 p.18). REQUIRED — there is no default.
            examples:
              - 2
            format: int64
            maximum: 5
            minimum: 2
            type: integer
      responses:
        "200":
          content:
            application/octet-stream:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
          description: The contract document, in the content type the rail declared.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Download the rail's document for a contract
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-rail-document
  /v1/consignado/contracts/{numero_contrato}/rail-loan:
    get:
      description: "Reads the rail's consultar-emprestimo-trabalhador (Manual 005 v1.13 §3.2.1) for one averbado contract: situação do empréstimo, the proposta that owns it, the money terms and the FGTS collateral block. It REPORTS status only — it creates or resolves no durable proposal witness and emits no handoff fact."
      operationId: getConsignadoRailLoan
      parameters:
        - description: The averbado contract number to read (rail numeroContrato, Texto 2..15 alphanumerics — Manual 005 v1.13 §3.2.1 p.13).
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The averbado contract number to read (rail numeroContrato, Texto 2..15 alphanumerics — Manual 005 v1.13 §3.2.1 p.13).
            examples:
              - "199971600000"
            type: string
        - description: "OPTIONAL. The proposal identifier this gateway minted for your bid. It is NEVER sent to the rail — the published query is codigoSolicitante + numeroContrato only. It is the LOCAL comparison key for the win classification: supply it and 'outcome' reports won/lost/pending for that proposal; omit it and 'outcome' is 'pending' because the classification has no subject. The rail's own verdict is always in 'situacao_emprestimo' and 'situacao_descricao', which are relayed verbatim."
          explode: false
          in: query
          name: numero_proposta
          schema:
            description: "OPTIONAL. The proposal identifier this gateway minted for your bid. It is NEVER sent to the rail — the published query is codigoSolicitante + numeroContrato only. It is the LOCAL comparison key for the win classification: supply it and 'outcome' reports won/lost/pending for that proposal; omit it and 'outcome' is 'pending' because the classification has no subject. The rail's own verdict is always in 'situacao_emprestimo' and 'situacao_descricao', which are relayed verbatim."
            examples:
              - "12345678901234567890"
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataprevConsultarEmprestimoResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read one averbado contract's loan status on the rail
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-rail-loan
  /v1/consignado/contracts/{numero_contrato}/reactivate:
    post:
      description: Proxies reativar-consignado-trabalhador (Manual 003 §3.5). Same tenant-ownership proof and idempotency requirement as suspend.
      operationId: reactivateConsignadoContract
      parameters:
        - description: Rail contract number of a contract this gateway holds for the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Rail contract number of a contract this gateway holds for the authenticated tenant.
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 1
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-lifecycle-2026-07-30-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContratoIdentityBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContratoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Reactivate a suspended contract
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/reactivate-consignado-contract
  /v1/consignado/contracts/{numero_contrato}/refinanciamento:
    post:
      description: "Proxies realizar-refinanciamento-trabalhador (Manual 008 v1.10 §3.1): quits every contract named in listaContratosQuitadosTrabalhador and averbates the new contract that replaces them, reserving margin until the refinanciamento closes. Every quitado contract must be held by this gateway for the authenticated tenant; anything else is 404 before the rail is called — whether that contract is currently ACTIVE on the government registry is left to the rail's own judgment. With garantia (temGarantias=true), the refinanciamento may only relate 1:1 (regra FR, at most one quitado contract) and must inform at least one of the three garantia values (regra FI). X-Idempotency is required."
      operationId: realizarConsignadoRefinanciamento
      parameters:
        - description: "The NEW contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The NEW contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits."
            examples:
              - 99999999999ARN1
            maxLength: 15
            minLength: 2
            pattern: ^[A-Za-z0-9]+$
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-refinanciamento-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RefinanciamentoBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RefinanciamentoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Refinance one or more active contracts into a new one
      tags:
        - Consignado Rail
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/realizar-consignado-refinanciamento
  /v1/consignado/contracts/{numero_contrato}/refinanciamento/reversao:
    post:
      description: "Proxies reverter-refinanciamento-trabalhador (Manual 008 v1.10 §3.2): the new contract is excluded and every contract it quitou returns to ativo. motivoReversao is a closed set (1 Desistência, 2 Óbito, 3 Fraude). ONLY a refinanciamento this gateway itself registered can be reversed here: the contract must be backed by an accepted refinanciamento of the authenticated tenant that no accepted reversal has already excluded, and anything else is 404 before the rail is called — a refinanciamento made outside this gateway (through the Dataprev Portal, say) has to be reversed there too. The 7-business-day window is judged against the gateway's OWN record of when that refinanciamento committed, never against a date in the request, and it refuses locally only once the window has unambiguously passed; the rail remains the final judge. X-Idempotency is required."
      operationId: reverterConsignadoRefinanciamento
      parameters:
        - description: The NEW contract minted by the refinanciamento this call reverses.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The NEW contract minted by the refinanciamento this call reverses.
            examples:
              - 99999999999ARN1
            maxLength: 15
            minLength: 2
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-reversao-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReversaoRefinanciamentoBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReversaoRefinanciamentoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. REVERSAO_WINDOW_EXPIRED means the 7-business-day window for reversing this refinancing has closed; no correction to the request can reopen it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Reverse a refinancing within its 7 business day window
      tags:
        - Consignado Rail
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/reverter-consignado-refinanciamento
  /v1/consignado/contracts/{numero_contrato}/registro-b3:
    get:
      description: Reads the B3 instrument code informed for an averbado contract. A contract that exists and holds no code yet is 404 REGISTRO_B3_NAO_INFORMADO; a contract this tenant does not hold is 404 REGISTRO_B3_CONTRATO_NAO_ENCONTRADO.
      operationId: getConsignadoRegistroB3
      parameters:
        - description: Client contract identity within the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Client contract identity within the authenticated tenant.
            examples:
              - 99999999999AN1
            minLength: 1
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegistroB3Response"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Read the B3 instrument code of an averbado contract
      tags:
        - Consignado Registro B3
      x-mint:
        href: /pt/reference/rails/consignado/read-the-b3-instrument-code-of-an-averbado-contract
    patch:
      description: |-
        Informs the B3 instrument code (Código IF, X(14) per the B3 CCB operations manual) the bancarizador received when B3 accepted the CCB registration of an averbado contract.

        The premise that the B3 registration happens AFTER the averbação is a product decision, not a B3 rule: the code is accepted only once the averbação is confirmed, and never on the averbação body.

        Written once. Re-sending the same registro answers 200 with the original registradoEm and publishes no second fact. Sending a different code or date for a contract that already holds one is refused with 409; the API offers no correction. The gateway does not talk to B3 and does not check that the code matches the CCB: that is the informer's responsibility.

        Idempotent by value: the registro itself is the key, so no X-Idempotency header is read.
      operationId: registrarConsignadoRegistroB3
      parameters:
        - description: Client contract identity within the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Client contract identity within the authenticated tenant.
            examples:
              - 99999999999AN1
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RegistroB3Request"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegistroB3Response"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Inform the B3 instrument code of an averbado contract
      tags:
        - Consignado Registro B3
      x-mint:
        href: /pt/reference/rails/consignado/inform-the-b3-instrument-code-of-an-averbado-contract
  /v1/consignado/contracts/{numero_contrato}/renegociacao:
    post:
      description: "Proxies renegociar-consignado-trabalhador (Manual 006 v1.12 §2.3): renegotiates a contract closed in situação 15 (\"Encerrado por término de vínculo\") into a new one against the worker's new employment bond. numeroContratoEncerrado must be held by this gateway for the authenticated tenant, and must differ from the new contract number in the path; that is checked here, before the rail is called. Whether the closed contract actually sits in situação 15, whether the new bond is elegível or inelegível only by motivo 8, and whether valorParcela stays within the closed contract's own instalment (regra BL) are live registry facts this gateway holds no local copy of and defers to the rail's own judgment. valorIOF is required, following the manual rather than the mirrored Swagger's required list. X-Idempotency is required."
      operationId: renegociarConsignadoContract
      parameters:
        - description: "The NEW (renegotiated) contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The NEW (renegotiated) contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits."
            examples:
              - Qwerty123456789
            maxLength: 15
            minLength: 2
            pattern: ^[A-Za-z0-9]+$
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-renegociacao-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RenegociacaoBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RenegociacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Renegotiate a contract closed by employment-link termination
      tags:
        - Consignado Rail
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/renegociar-consignado-contract
  /v1/consignado/contracts/{numero_contrato}/saldo-devedor:
    get:
      description: |-
        Returns ONE contract's saldo devedor obligation together with its whole amortization book, by the rail contract number.

        'obrigacao' is the SAME shape as one element of GET /v1/consignado/saldo-devedor, so a console needs one renderer for both. 'amortizacoes' is the per-competência record of what has already amortized, ordered by competência, which is the amortization table's own key order.

        'origem' on each amortization is the provenance a reversal acts against: E1 is an amortização prevista, which nothing withdraws, and E5 is an antecipação, which its own exclusion can withdraw. That distinction is why the two are published rather than collapsed into a count.

        An obligation with NO amortization at all answers an empty list and never a 404. The obligation is real and has simply never amortized, which is the ordinary state of a contract in its first month.

        It answers from a LOCAL table and never reaches the Dataprev rail. The tenant is derived from the validated identity: a contract that does not exist and a contract belonging to another tenant are the SAME answer, 404, so this read cannot be used to probe another tenant's book.
      operationId: getConsignadoContractSaldoDevedor
      parameters:
        - description: The rail contract number, exactly as it was registered. It is never trimmed or normalized.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The rail contract number, exactly as it was registered. It is never trimmed or normalized.
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SaldoDevedorDetail"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Get one contract's saldo devedor and its amortization book
      tags:
        - Consignado Saldo Devedor
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-saldo-devedor
  /v1/consignado/contracts/{numero_contrato}/suspend:
    post:
      description: Proxies suspender-consignado-trabalhador (Manual 003 §3.4). The contract must be held by this gateway for the authenticated tenant; anything else is 404 before the rail is called. X-Idempotency is required. Competência is calculated by the rail and is never sent. Reversible by the reactivate operation.
      operationId: suspendConsignadoContract
      parameters:
        - description: Rail contract number of a contract this gateway holds for the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Rail contract number of a contract this gateway holds for the authenticated tenant.
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 1
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-lifecycle-2026-07-30-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContratoIdentityBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContratoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Suspend payroll deduction for an averbado contract
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/suspend-consignado-contract
  /v1/consignado/contracts/{numero_contrato}/terms:
    patch:
      description: "Proxies alterar-consignado-trabalhador (Manual 003 §3.2): instalment count, instalment amount, worker name, and optionally the first deduction competência. Same tenant-ownership proof and idempotency requirement as suspend. Money is a decimal string, never a float."
      operationId: alterConsignadoContractTerms
      parameters:
        - description: Rail contract number of a contract this gateway holds for the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Rail contract number of a contract this gateway holds for the authenticated tenant.
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 1
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-terms-2026-07-30-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContratoTermsBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContratoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Alter the mutable terms of an averbado contract
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/alter-consignado-contract-terms
  /v1/consignado/disbursement-confirmations:
    get:
      description: |-
        Walks the confirmations client banks recorded against this tenant, most recently confirmed first: money the client says it ALREADY paid a worker.

        'orphan' is the field to read first. It is true when this deployment holds NO averbado contract under the confirmation's contract number, which means a client reported paying against a contract that is not here. It is DERIVED on every read from the same predicate the antecipação gate uses, never stored: storing it would create a second owner of the truth about whether a contract exists, and the two would disagree the moment an averbação landed after its confirmation.

        Filter with 'orphan=true' to see only those, or 'orphan=false' for the matched ones. OMITTING the parameter is the whole book, which is what an operator arriving with no filter is asking for.

        Filter with 'numero_contrato' to see only the confirmations recorded against one contract, which is how a client checks what it already declared before declaring another payment: the book refuses only the same payment_reference twice, so the same money under a different reference lands twice. It combines with 'orphan' and pages the same way.

        'amount' is the canonical BRL decimal STRING the client asserted, byte for byte as it was recorded, and it is never re-rendered: 'payload_digest' is taken over exactly those bytes, so a reformatted number would stop re-deriving the digest a client checks its own receipt against.

        'confirmed_at' is when THIS GATEWAY stamped the confirmation and it is what orders the book. 'paid_at' is when the CLIENT says the money left, which is declared rather than observed, so it never orders anything: a client may declare any instant it likes, and a late confirmation ordered by it would insert itself in the middle of a page an operator had already walked past.

        There is deliberately NO time window. A confirmation is immutable and is never purged, and a window would hide exactly the old orphan nobody ever reconciled.

        Paging is keyset over the gateway's stamp and the confirmation id. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false, so a client loop may terminate on either. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the walk from the top.

        It answers from a LOCAL table and crosses no government boundary. It answers 501 on a deployment that composed no disbursement family, the same posture the confirmation intake answers there: a deployment that can never record a confirmation has none to report, and an empty page would say the opposite. The tenant is derived from the validated identity and is never read from the request.
      operationId: listConsignadoDisbursementConfirmations
      parameters:
        - description: Narrows the page to confirmations with no averbado contract here (true) or to matched ones (false). Omitted means the whole book, which is never the same as either half.
          explode: false
          in: query
          name: orphan
          schema:
            description: Narrows the page to confirmations with no averbado contract here (true) or to matched ones (false). Omitted means the whole book, which is never the same as either half.
            enum:
              - "true"
              - "false"
            examples:
              - "true"
            type: string
        - description: "Narrows the page to the confirmations recorded against this rail contract number: 2 to 15 letters or digits, exact, never trimmed. Combines with orphan, after and limit. Omitted means every contract."
          explode: false
          in: query
          name: numero_contrato
          schema:
            description: "Narrows the page to the confirmations recorded against this rail contract number: 2 to 15 letters or digits, exact, never trimmed. Combines with orphan, after and limit. Omitted means every contract."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            pattern: ^[A-Za-z0-9]+$
            type: string
        - description: The previous page's page.next_after. Omitted starts at the most recent confirmation. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the most recent confirmation. A cursor this service did not mint is refused, never restarted from the top.
            examples:
              - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOToxMjozM1oiLCJrIjpbImMwMDEyIl19
            type: string
        - description: Maximum number of confirmations to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of confirmations to return. Omitted means the ceiling of 200.
            examples:
              - 50
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DisbursementConfirmationsPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: List the disbursement confirmations recorded for this tenant
      tags:
        - Consignado Disbursement
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-disbursement-confirmations
  /v1/consignado/employment-status/terminations:
    get:
      description: "Reads one page of the rail's consultar-emprestimo-encerrado-termino-vinculo feed (Manual 006 v1.12 §2.1): the loans closed because the worker's employment link ended. Paginate with the opaque continuation token; omit it to start a fresh window. The read writes nothing — the poller's checkpoint advances only through its own compare-and-set persistence, so on-demand paging cannot make the job skip a page. When this deployment has no real termination-feed client plugged, the route answers 501 instead of returning fabricated records."
      operationId: listConsignadoEmploymentTerminations
      parameters:
        - description: OPTIONAL opaque pagination handle returned as next_continuation_token by a previous call. Omit it to start a fresh window. It is minted by this gateway and refused (422) when it is not one of ours.
          explode: false
          in: query
          name: continuation_token
          schema:
            description: OPTIONAL opaque pagination handle returned as next_continuation_token by a previous call. Omit it to start a fresh window. It is minted by this gateway and refused (422) when it is not one of ours.
            examples:
              - ""
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListEmploymentTerminationsResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read the loans closed by employment-link termination
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-employment-terminations
  /v1/consignado/event-delivery:
    get:
      description: |-
        Censuses this tenant's transactional outbox by status: five buckets, always five, one per value of the database enum.

        It answers whether the facts this gateway WROTE actually left it, which no other surface reports. A fact recorded in a local table and never published is invisible to every read beside this one: the operation books show what the gateway did, and this shows whether the world was told.

        ALL FIVE BUCKETS ARE ALWAYS PRESENT, at count zero included. A bucket that vanished when it emptied would make "nothing is stuck" and "nothing was ever written" render identically.

        'oldest_created_at' is the number to act on, and it is null exactly when the bucket is at zero. A PENDING bucket whose oldest row is hours old is a dispatcher that stopped; a PENDING bucket of the same count whose oldest row is seconds old is a healthy queue.

        The status labels are the Postgres enum's own, verbatim and UPPERCASE. This is the one read here that does not use lowercase vocabulary, deliberately: inventing a lowercase alias would give one fact two spellings, and an operator would read one on the screen and the other in every query they run against the database while acting on it.

        INVALID is terminal for the dispatcher: it never retries those facts, and switching a relay on afterwards recovers nothing. GET /v1/consignado/event-delivery/invalid is the row-by-row read of that bucket, and POST /v1/consignado/event-delivery/invalid/{id}/requeue puts one of them back in the queue.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501. It takes no parameter of any kind, neither filter nor page: the whole answer is five numbers, and there is nothing for a caller to narrow. The tenant is derived from the validated identity and is never read from the request.
      operationId: getConsignadoEventDelivery
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EventDeliverySummary"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: Census this tenant's outbox event delivery by status
      tags:
        - Consignado Event Delivery
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-event-delivery
  /v1/consignado/event-delivery/invalid:
    get:
      description: |-
        Walks the terminal INVALID rows of this tenant's outbox, oldest first: the money facts this gateway DESTROYED.

        The dispatcher never retries a row here, and switching a relay on afterwards recovers nothing. POST /v1/consignado/event-delivery/invalid/{id}/requeue puts one row back in the dispatcher's queue; this operation is a read and moves nothing.

        The event PAYLOAD never leaves the store. It is the whole envelope of the fact, business data and CPF included, and an operator deciding what to do about a destroyed fact does not need its body. The recorded failure text does not leave either: it travels as 'last_error_class', a MECHANISM, because a publish error can carry a tenant identifier, a contract number or a rail payload. 'unclassified' covers both a message no rule recognises and a row with no message at all, which are the same thing to an operator.

        'event_type' is the stable relay type the dispatcher routed on, not the business fact's name: the concrete fact rides inside the envelope this read never opens. 'id' is the id the requeue operation takes.

        There is deliberately NO status filter and NO time window. INVALID is the only status a cursor is correct over, because only an explicit requeue moves a row out of it, and a window would hide exactly the old destroyed fact nobody ever noticed, which is what this surface exists to show.

        Paging is keyset over the row's creation instant and its id. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false, so a client loop may terminate on either. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the scan from the top.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501. The tenant is derived from the validated identity and is never read from the request.
      operationId: listConsignadoInvalidEvents
      parameters:
        - description: The previous page's page.next_after. Omitted starts at the oldest destroyed fact. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the oldest destroyed fact. A cursor this service did not mint is refused, never restarted from the top.
            examples:
              - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOToxMjozM1oiLCJrIjpbImMwMDEyIl19
            type: string
        - description: Maximum number of destroyed facts to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of destroyed facts to return. Omitted means the ceiling of 200.
            examples:
              - 50
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvalidEventsPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the outbox facts this gateway destroyed
      tags:
        - Consignado Event Delivery
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-invalid-events
  /v1/consignado/event-delivery/invalid/{id}/requeue:
    post:
      description: |-
        Puts ONE INVALID fact of this tenant's outbox back in the dispatcher's queue. Its attempts restart at zero and the dispatcher publishes it again under the SAME id, event type and payload, so a consumer that dedupes on the id receives it once.

        Only an INVALID fact is requeued: a row whose event_type is lerian.streaming.publish. An id this tenant's outbox does not hold answers 404 INVALID_EVENT_NOT_FOUND. A row in any other status, or a command the gateway runs itself (event_type consignado.saldo_devedor.dispatch, an M015 saldo devedor report to Dataprev), answers 409 INVALID_EVENT_NOT_REQUEUEABLE. Neither changes anything. A fact that fails again returns to INVALID and can be requeued again.

        202 means queued, not published: the row leaves the INVALID page at once and the dispatcher's next sweep publishes it.

        X-Idempotency is optional. Sent again with the same key, the stored answer is replayed and the fact is requeued once.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501. The tenant is derived from the validated identity and is never read from the request.
      operationId: requeueConsignadoInvalidEvent
      parameters:
        - description: The INVALID fact's id, as GET /v1/consignado/event-delivery/invalid lists it.
          in: path
          name: id
          required: true
          schema:
            description: The INVALID fact's id, as GET /v1/consignado/event-delivery/invalid lists it.
            examples:
              - 0192f1a0-0000-7000-8000-00000000d301
            format: uuid
            type: string
        - description: Optional idempotency key. Sent again, the stored response is replayed and the fact is requeued once. Absent, the request executes once.
          in: header
          name: X-Idempotency
          schema:
            description: Optional idempotency key. Sent again, the stored response is replayed and the fact is requeued once. Absent, the request executes once.
            examples:
              - idem-1
            type: string
      responses:
        "202":
          description: Accepted
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
      security:
        - BearerAuth: []
      summary: Requeue one outbox fact this gateway destroyed
      tags:
        - Consignado Event Delivery
      x-mint:
        href: /pt/reference/rails/consignado/requeue-consignado-invalid-event
  /v1/consignado/exclusion-operations:
    get:
      description: |-
        Walks the tenant's own exclusion operation book, oldest claim first.

        Exclusion is the product's IRREVERSIBLE operation: once the registry removes the payroll deduction there is no undo, so this queue is the surface an operator watches. The situation that matters most is outcome_unknown: the command was sent and the registry has not yet been observed answering it, which the exclusion recovery loop is still driving.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501 and it is served even on a deployment where exclusion itself is switched off. That deployment simply has an empty book. Distinguishing "the queue is clear" from "the command was never composed" is what GET /v1/consignado/capabilities is for: read the exclusao family there, not the status of this response.

        The tenant is derived from the validated identity and is never read from the request. There is no tenant parameter on this operation.

        Paging is keyset over the operation's own claim instant and reference, the pair the table holds immutable, so a row's position never moves and a page can neither skip nor repeat. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the scan from the top.

        status may be repeated to narrow the page to several situations at once (status=claimed&status=invoking). Omitting it means ALL five situations, never none.
      operationId: listConsignadoExclusionOperations
      parameters:
        - description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all five.
          explode: true
          in: query
          name: status
          schema:
            description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all five.
            items:
              enum:
                - claimed
                - invoking
                - confirmed
                - rejected
                - outcome_unknown
              type: string
            type: array
        - description: The previous page's page.next_after. Omitted starts at the oldest claim. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the oldest claim. A cursor this service did not mint is refused, never restarted from the top.
            type: string
        - description: Maximum number of operations to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of operations to return. Omitted means the ceiling of 200.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExclusionOperationsPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the tenant's exclusion operations
      tags:
        - Consignado Exclusion Operations
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-exclusion-operations
  /v1/consignado/exclusion-operations/{request_ref}/audit:
    get:
      description: |-
        Returns ONE exclusion operation's append-only transition trail, oldest first.

        The trail is keyed by the operation's own request_ref rather than by contract number, because the trail belongs to the OPERATION: a contract excluded more than once has more than one trail, and keying by contract would need a resolution step free to answer with the wrong one.

        The tenant is derived from the validated identity: an operation that does not exist and an operation belonging to another tenant are the SAME answer, 404, so this read cannot be used to probe another tenant's book.

        evidence is handed back as the JSON document the writer stored, byte for byte, and its shape varies by event_type. It is deliberately not re-encoded: a trail exists to hold proof, and a server that rewrites proof cannot settle the argument the trail was kept for.

        The trail is not paginated. It is capped at 200 entries and the cut is STATED through truncated rather than swallowed, because a silent cut reads as a complete history.
      operationId: getConsignadoExclusionOperationAudit
      parameters:
        - description: The exclusion operation's own reference, exactly as the list returned it.
          in: path
          name: request_ref
          required: true
          schema:
            description: The exclusion operation's own reference, exactly as the list returned it.
            maxLength: 128
            minLength: 1
            pattern: ^[A-Za-z0-9._-]{1,128}$
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExclusionAuditTrail"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Get one exclusion operation's audit trail
      tags:
        - Consignado Exclusion Operations
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-exclusion-operation-audit
  /v1/consignado/fgts/autorizados:
    post:
      description: |-
        Proxies listar-autorizados-trabalhador (Manual 002 §3.2): the worker's authorized employment bonds and, for an ineligible one, the rail's reason. POST, not GET, for the same reason as the balance read — the operation is consent-gated and the CPF belongs in the body. An empty vinculos list is the rail's answer, not an error, and is returned as 200.

        CONSENT WINDOW (Manual 002 v1.15 §5.6). dataHoraAutorizacaoDigital starts two clocks, measured in calendar days from the worker's signature: the authorization may be CONSULTED for 30 days, and a request may be MADE against it for 45. Both boundaries are INCLUSIVE — the instant exactly 30 or 45 days after the signature is still inside its window, and only the next nanosecond is outside.

        Outside either window the gateway refuses LOCALLY, before a byte reaches the rail: 422 with code CLT-0006 and a detail telling you to obtain a fresh worker authorization. THAT REFUSAL IS NOT RETRYABLE. Repeating the request performs the very read the lapsed authorization withdrew; only new authorization evidence makes it succeed. A dataHoraAutorizacaoDigital carrying a non-UTC offset, or dated ahead of the gateway's clock, is the same 422 with a different detail — correct the timestamp; the worker's consent is not in question.

        Contrast the rail's OWN consent rejection (Dataprev EX/IV on a stale tokenAutorizacao): that is 503 and IS retryable, because the gateway drops the cached token and the next attempt opens a fresh consent from the same evidence.
      operationId: listConsignadoFgtsAutorizados
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FgtsAutorizadosRequestBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FgtsAutorizadosResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: List a worker's authorized employment bonds
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-fgts-autorizados
  /v1/consignado/fgts/garantias/execucao:
    post:
      description: |-
        Proxies execucao-garantias-fgts (Manual 017 §3.1). THIS MOVES CASH AND CANNOT BE UNDONE — it is marked x-money-path: true in this document. The guarantee executes AT MOST ONCE per (tenant, contract). X-Idempotency is required and is never defaulted; the gateway records the request durably BEFORE calling the rail.

        The four conflict cases, all 409:
        1. Same key, same body — the recorded outcome is REPLAYED (replayed: true) without touching the rail. This is the only non-conflict repeat.
        2. Same key, DIFFERENT body — refused, never served the earlier answer.
        3. A BRAND-NEW key for a contract that ALREADY has an execution record — REFUSED, not replayed. The stored outcome belongs to the other key, and a fresh key must not buy a second cash movement. This is a refusal, not a fault: nothing was claimed and the rail was not called.
        4. The first attempt's outcome could not be established — the key is terminally unresolved. Retrying could execute the guarantee twice, and Manual 017 publishes no operation that asks the rail whether it already did, so reconciliation is an OPERATOR action, deliberately not an automatic one.

        The two collateral values are Obrigatório=Não at the rail: OMIT them for a contract with no FGTS collateral. Sending 0 is refused locally with 422 — the rail reads 0 as an invalid guarantee value, and refusing early keeps the mistake from burning your idempotency key.
      operationId: executeConsignadoFgtsGuarantee
      parameters:
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default. The key decides what a REPEAT gets back; the CONTRACT decides what may happen at all. Same key + same body: the recorded outcome is replayed without touching the rail. Same key + different body: 409. A BRAND-NEW key for a contract that already has an execution record: 409 — a fresh key does not buy a second execution. First attempt's outcome unestablished: 409 until an operator reconciles it."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default. The key decides what a REPEAT gets back; the CONTRACT decides what may happen at all. Same key + same body: the recorded outcome is replayed without touching the rail. Same key + different body: 409. A BRAND-NEW key for a contract that already has an execution record: 409 — a fresh key does not buy a second execution. First attempt's outcome unestablished: 409 until an operator reconciles it."
            examples:
              - idem-fgts-exec-2026-07-30-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FgtsGuaranteeExecutionRequestBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FgtsGuaranteeExecutionResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: A conflict with the FGTS guarantee execution already recorded for this key or this contract. FGTS_EXECUTION_PAYLOAD_MISMATCH means this key holds a different execution. FGTS_EXECUTION_ALREADY_REFUSED means the execution under this key was refused and this key can only ever return that refusal. FGTS_EXECUTION_OUTCOME_UNRESOLVED means the first attempt's outcome is not known, so it cannot be replayed and an operator must reconcile it. FGTS_EXECUTION_CONTRACT_TAKEN means the contract's guarantee was already executed under another key, and a guarantee is executed once. All four are definitive, and none of them executed anything. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying.
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Execute the FGTS guarantee for a contract
      tags:
        - Consignado Rail
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/execute-consignado-fgts-guarantee
  /v1/consignado/fgts/saldo:
    post:
      description: |-
        Proxies consultar-saldo-fgts (Manual 002 §3.4): the worker's consignable FGTS balance and rescission-penalty portion, the SOURCE of the collateral values an averbação or an auction bid carries. POST, not GET, because the read is consent-gated: the worker's grupo-1 authorization evidence is a nested object and the CPF must never appear in a path or query string. The consent token the gateway mints or reuses is never returned. Money is a decimal string, never a float.

        CONSENT WINDOW (Manual 002 v1.15 §5.6). dataHoraAutorizacaoDigital starts two clocks, measured in calendar days from the worker's signature: the authorization may be CONSULTED for 30 days, and a request may be MADE against it for 45. Both boundaries are INCLUSIVE — the instant exactly 30 or 45 days after the signature is still inside its window, and only the next nanosecond is outside.

        Outside either window the gateway refuses LOCALLY, before a byte reaches the rail: 422 with code CLT-0006 and a detail telling you to obtain a fresh worker authorization. THAT REFUSAL IS NOT RETRYABLE. Repeating the request performs the very read the lapsed authorization withdrew; only new authorization evidence makes it succeed. A dataHoraAutorizacaoDigital carrying a non-UTC offset, or dated ahead of the gateway's clock, is the same 422 with a different detail — correct the timestamp; the worker's consent is not in question.

        Contrast the rail's OWN consent rejection (Dataprev EX/IV on a stale tokenAutorizacao): that is 503 and IS retryable, because the gateway drops the cached token and the next attempt opens a fresh consent from the same evidence.
      operationId: readConsignadoFgtsSaldo
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FgtsSaldoRequestBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FgtsSaldoResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read a worker's consignable FGTS balance
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/read-consignado-fgts-saldo
  /v1/consignado/fundo/creditos:
    get:
      description: |-
        Returns the credits this fund actually OWNS.

        Ownership is keyed on the cessão registration and on nothing else: a credit merely ATTRIBUTED to the fund — allocated to it, but with no cessão registered — is INVISIBLE here.

        The fund is taken from the authenticated credential and is never read from the request: there is no fund parameter on this operation, and naming another fund anywhere in the request changes nothing. The tenant is derived from the validated identity the same way.

        A bancarizador reading a fund it administers uses GET /v1/consignado/fundos/{id}/creditos instead, where the fund is named in the path and resolved against that bancarizador's own tenant.
      operationId: listConsignadoFundoCreditosCedidos
      parameters:
        - description: "Narrows the read to ONE auction credit the caller already names: the same idempotency_key the bid was submitted under. A contract averbado directly has no such key, so naming one never returns it. Omit for the whole page. It never widens the fund fence."
          explode: false
          in: query
          name: credit_key
          schema:
            description: "Narrows the read to ONE auction credit the caller already names: the same idempotency_key the bid was submitted under. A contract averbado directly has no such key, so naming one never returns it. Omit for the whole page. It never widens the fund fence."
            maxLength: 128
            type: string
        - description: Maximum number of credits to return. Omitted means the ceiling of 500; a value outside 1..500 is refused with a validation error.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of credits to return. Omitted means the ceiling of 500; a value outside 1..500 is refused with a validation error.
            format: int64
            maximum: 500
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListCededCreditsResponse"
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the credits ceded to the caller's own fund
      tags:
        - Consignado Fundo Créditos
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-fundo-creditos-cedidos
  /v1/consignado/fundos:
    get:
      description: Returns every fund the tenant registered, active and deactivated alike. Tenant scope is derived from the validated identity; it is never taken from the request.
      operationId: listConsignadoFundos
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListFundosResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the tenant's registered funds
      tags:
        - Consignado Fundos
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-fundos
    post:
      description: "Registers a new fund under the authenticated tenant. The same real-world fund registered under another tenant is represented by a separate tenant-scoped record."
      operationId: createConsignadoFundo
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateFundoRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Fundo"
          description: Created
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: Register a new fund
      tags:
        - Consignado Fundos
      x-mint:
        href: /pt/reference/rails/consignado/create-consignado-fundo
  /v1/consignado/fundos/{fundo_id}/contracts:
    get:
      description: |-
        Returns the credits this fund actually OWNS.

        Ownership is keyed on the cessão registration and on nothing else: a credit merely ATTRIBUTED to the fund — allocated to it, but with no cessão registered — is INVISIBLE here.

        The fund is taken from the authenticated credential and is never read from the request: there is no fund parameter on this operation, and naming another fund anywhere in the request changes nothing. The tenant is derived from the validated identity the same way.

        A bancarizador reading a fund it administers uses GET /v1/consignado/fundos/{id}/creditos instead, where the fund is named in the path and resolved against that bancarizador's own tenant.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: listConsignadoFundoCreditosCedidosAsFundo
      parameters:
        - description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
          in: path
          name: fundo_id
          required: true
          schema:
            description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
            examples:
              - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
            format: uuid
            type: string
        - description: "Narrows the read to ONE auction credit the caller already names: the same idempotency_key the bid was submitted under. A contract averbado directly has no such key, so naming one never returns it. Omit for the whole page. It never widens the fund fence."
          explode: false
          in: query
          name: credit_key
          schema:
            description: "Narrows the read to ONE auction credit the caller already names: the same idempotency_key the bid was submitted under. A contract averbado directly has no such key, so naming one never returns it. Omit for the whole page. It never widens the fund fence."
            maxLength: 128
            type: string
        - description: Maximum number of credits to return. Omitted means the ceiling of 500; a value outside 1..500 is refused with a validation error.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of credits to return. Omitted means the ceiling of 500; a value outside 1..500 is refused with a validation error.
            format: int64
            maximum: 500
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListCededCreditsResponse"
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the credits ceded to the caller's own fund
      tags:
        - Consignado Fundo Créditos
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-fundo-creditos-cedidos-as-fundo
  /v1/consignado/fundos/{fundo_id}/contracts/{numero_contrato}/artifacts/{artifact_type}:
    get:
      description: |-
        Returns the verified artifact bytes. The bancarizador reads every contract of its tenant. A fund or originador credential reads a contract's signed CCB, biometrics pack and cadastro only when the fund or originador it acts for sent the averbação or one of its documentation attempts, and a fund credential also reads them once the contract is ceded to its fund. A contract a renegociação minted serves its signed CCB once Dataprev accepted its documentation, to the fund and originador the contract inherited from the contract it replaced. Any other contract answers the same 404 as a missing one. Missing and non-entitled artifacts share the same 404 response. The response contains no storage coordinates or direct-storage URL.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: getConsignadoContractArtifactAsFundo
      parameters:
        - description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
          in: path
          name: fundo_id
          required: true
          schema:
            description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
            examples:
              - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
            format: uuid
            type: string
        - description: Client contract identity within the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Client contract identity within the authenticated tenant.
            examples:
              - contract-1
            minLength: 1
            type: string
        - description: Closed retained artifact type.
          in: path
          name: artifact_type
          required: true
          schema:
            description: Closed retained artifact type.
            enum:
              - signed_ccb
              - biometrics_documents_pack
            examples:
              - signed_ccb
            type: string
      responses:
        "200":
          content:
            application/pdf:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            application/zip:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
          description: Verified retained artifact bytes.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
            ETag:
              schema:
                type: string
            X-Content-Type-Options:
              schema:
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Download a retained consignado contract artifact
      tags:
        - Artifacts
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-artifact-as-fundo
  /v1/consignado/fundos/{fundo_id}/contracts/{numero_contrato}/averbacao:
    get:
      description: |-
        Returns ONE contract's averbação operation, by the rail contract number.

        It answers from a LOCAL table and never reaches the Dataprev rail. The tenant is derived from the validated identity: a contract that does not exist and a contract belonging to another tenant are the SAME answer, 404, so this read cannot be used to probe another tenant's book.

        A fund or originador credential reads only an averbação its own credential sent, or whose documentation it sent; any other contract answers the same 404. The bancarizador reads every contract of its tenant.

        The body is the operation object itself, with no envelope, the same shape as one element of GET /v1/consignado/averbacao-operations. Every conditional instant is present and null until the step it names has happened.

        This is the READ half of the address whose POST creates the payroll-deduction mandate. It creates nothing and changes nothing.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: getConsignadoContractAverbacaoOperationAsFundo
      parameters:
        - description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
          in: path
          name: fundo_id
          required: true
          schema:
            description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
            examples:
              - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
            format: uuid
            type: string
        - description: The rail contract number, exactly as it was registered. It is never trimmed or normalized.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The rail contract number, exactly as it was registered. It is never trimmed or normalized.
            maxLength: 15
            minLength: 2
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationItem"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Get one contract's averbação operation
      tags:
        - Consignado Averbação Operations
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-averbacao-operation-as-fundo
    post:
      description: |-
        Submits averbar-consignado-trabalhador (Manual 003 v1.19 §3.1) and nothing else. An accepted averbação answers status attachment_pending and publishes consignado.averbacao.accepted: Dataprev holds the mandate, and the contract waits for its documentation — the signed CCB, the evidence pack when the averbação carries the booking block, and the Manual 004 signature evidence — sent through POST .../ccb-attachment. This body carries no document and no signing instant: artifacts, data_hora_assinatura and the signature-evidence fields are refused 422, or 413 first when the body exceeds 1 MiB, as one carrying a real signed CCB usually does. THIS COMMITS MONEY: the averbação creates the payroll-deduction mandate the worker starts paying — so the operation is marked x-money-path: true in this document. POST .../exclusion can cancel an accepted averbação, also while it waits for its documentation. X-Idempotency is required; the transport middleware supplies best-effort response replay while the durable PostgreSQL operation record remains the semantic authority, keyed by tenant and contract and bound to the request payload's digest. The numero_contrato in the body MUST equal the one in the path. A retry after the documentation was sent answers the operation as it stands and never attaches anything.

        This intake accepts a bancarizador credential, a fundo credential for its own fund, or an originador credential for a contract whose proposal came from its own bid (a fund it names is validated against the tenant's fund register first, and a contract outside its own bids is refused 403), and most other rail operations accept a bancarizador credential only — so do not assume the credential that reaches this route reaches the rest of the rail.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: averbarConsignadoContractAsFundo
      parameters:
        - description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
          in: path
          name: fundo_id
          required: true
          schema:
            description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
            examples:
              - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
            format: uuid
            type: string
        - description: "The contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits. Must equal the numero_contrato in the body."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits. Must equal the numero_contrato in the body."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            pattern: ^[A-Za-z0-9]+$
            type: string
        - description: Required idempotency key. Absent is 422, never a generated default.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required idempotency key. Absent is 422, never a generated default.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AverbacaoRequestedCommand"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the averbação this contract already holds. AVERBACAO_CLAIM_CONFLICT means the averbação is already claimed under another idempotency key, so follow the claim that exists rather than opening a second one. It is definitive. CONTRACT_ALREADY_REGISTERED means the contract number is already a contract in this gateway (minted by a refinanciamento or renegociação, imported, or received by portability); nothing was written and nothing was sent to Dataprev. It is definitive. AVERBACAO_HELD_BY_ANOTHER_SENDER means a credential of another nature (bancarizador, fundo or originador) sent this same request first and it has not reached Dataprev: only a credential of that nature resumes it, by sending it again. It stops once Dataprev answers that request. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The request cannot be processed as sent. IDEMPOTENCY_KEY_REUSE means the X-Idempotency key is spent on a different request: send a new key. FUNDO_NOT_REGISTERED means fundo_ref names no fund registered for this tenant, and FUNDO_DEACTIVATED a fund that no longer accepts new credit: correct fundo_ref. A body carrying documents or Manual 004 signature evidence answers 422, or 413 first when it exceeds 1 MiB: they are sent through POST .../ccb-attachment, and so is data_hora_assinatura. FIRST_DEDUCTION_BEFORE_COMPETENCIA means data_primeiro_desconto falls in a month before first_deduction_competencia; DECLARED_DATES_OUT_OF_ORDER means the declared dates break an order the booking requires (see data_inicio_contrato and data_primeiro_desconto); correct the dates and resend. BOOKING_FIELD_INVALID means the lender cannot read a booking field (see loan_product_version, margin_snapshot, contract_id and fundo_ref). DECLARED_TERMS_INCONSISTENT means the declared amounts or rates contradict each other (see principal_amount and monthly_rate); correct the terms. MARGIN_SNAPSHOT_INCONSISTENT means margin_snapshot does not hold installment_amount; read the margin again or re-price. CONTRACT_NOT_BOOKABLE means the lender cannot book this contract at all (see installment_count and expected_disbursement_date); send it without the booking block. RATE_OUTSIDE_PRODUCT_RANGE means monthly_rate times 12 falls outside the annual rate range of the loan_product_version the Lender published; a version this gateway has not seen is not checked. Each detail names the rule. All of these apply only with the booking block, and the rail was not called; a retry of an averbação the rail already accepted is not refused."
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Averbar a consignado contract on the payroll rail
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/averbar-consignado-contract-as-fundo
  /v1/consignado/fundos/{fundo_id}/contracts/{numero_contrato}/ccb-attachment:
    post:
      description: |-
        Submits incluir-informacoes-contrato-trabalhador (Manual 004 v1.6 §2.1) for a contract whose averbação Dataprev already accepted, or that a renegociação Dataprev accepted through this gateway minted (Manual 004 §1.2.1), and nothing else: it never averbates. With neither for the path's contract — no averbação sent, or one still in flight, ambiguous or rejected, and no accepted renegociação that minted it — it answers 409 AVERBACAO_NOT_ACCEPTED and nothing is sent to Dataprev. The body is the documentation alone: the signed CCB, the evidence pack and signature_evidence_ref when the averbação carried the booking block (refused when it did not), data_hora_assinatura, the instant the worker signed, which may be days after the averbação, and the §2.1.1 signature evidence. The contract's identity and terms are the averbação's and are not sent again; an optional dados_cadastrais replaces the averbação's cadastro block. A contract takes one accepted documentation, fixed under its own X-Idempotency key and payload digest: the same documentation under a new key replays, and a different one is 409 AVERBACAO_DOCUMENTATION_CONFLICT. When Dataprev refuses the documentation, the answer is 422 with Dataprev's códigos in the upstream member and the contract waits for documentation again: send it corrected under a new X-Idempotency key, or exclude the contract. Any other failure of the call (no answer in time, a Dataprev 5xx, a lost connection, an unusable receipt) also returns the contract to waiting for documentation and answers 5xx: send the same documentation again, under the same X-Idempotency key or a new one, and Dataprev replaces what it holds and returns a new receipt. The documents are retained before Dataprev is called, and the rail's hashOperacao is recorded durably so a replay is answered from the record. An accepted attachment answers confirmed and publishes consignado.averbacao.confirmed.

        A contract a renegociação minted is documented with the signed CCB of the contract it replaced, whose clause allows the renegotiation on a change of employer. Its identity is the one the renegociação registered, it takes the signed CCB alone (signature_evidence_ref, the evidence pack and dados_cadastrais are refused 422), the signed CCB is retained before Dataprev is called, as an averbação's documents are, and an accepted attachment answers confirmed without contractId or averbacaoAt and publishes nothing: a renegociação disburses nothing.

        THIS COMMITS MONEY, which is why it is marked x-money-path: true: its acceptance confirms an averbação's contract, which is what bills it and hands it to the Lender for booking and disbursement. The conditional signature-evidence fields are mutually exclusive §2.1.1 branches, so send the branch your signing flow used rather than the union of the per-field examples: indicador_analfabetismo, indicador_assinatura_cert_digital_icp_brasil or nsu_contrato makes the flow biometrics-exempt.

        This intake accepts a bancarizador credential, a fundo credential for a contract of its own fund, or an originador credential for a contract whose proposal came from its own bid (any other contract is refused 403), and most other rail operations accept a bancarizador credential only — so do not assume the credential that reaches this route reaches the rest of the rail. A body carrying dados_cadastrais also needs the averbação's grant, fundo-contract-averbacao/post, beside this route's fundo-contract-ccb-attachment/post: without it the request is refused 403 before anything is recorded or sent to Dataprev.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: attachConsignadoCCBAsFundo
      parameters:
        - description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
          in: path
          name: fundo_id
          required: true
          schema:
            description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
            examples:
              - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
            format: uuid
            type: string
        - description: The contract whose accepted averbação this documentation is for.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The contract whose accepted averbação this documentation is for.
            examples:
              - 99999999999AN1
            type: string
        - description: Required idempotency key of the documentation, its own and not the averbação's. Absent is 422, never a generated default.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required idempotency key of the documentation, its own and not the averbação's. Absent is 422, never a generated default.
            examples:
              - idem-ccb-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CCBAttachmentRequestedCommand"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the averbação or the documentation this contract holds; nothing was sent to Dataprev. AVERBACAO_NOT_ACCEPTED means Dataprev has not accepted an averbação for this contract — none was sent, or it is still in flight, ambiguous or rejected — nor did a renegociação accepted through this gateway mint it: read GET .../averbacao before sending the documentation again (a contract a renegociação minted has no averbação, and GET .../averbacao answers 404 for it). AVERBACAO_DOCUMENTATION_CONFLICT means the contract's documentation is already fixed under another idempotency key with a different payload, or another documentation of it is on its way to Dataprev, or the contract was documented before documentation had its own record: a contract takes one accepted documentation, so follow the existing one. AVERBACAO_EXCLUDED means an exclusion of this averbação was requested and Dataprev has not rejected it, or the contract left the registry (a refinanciamento, renegociação or portability exclusion recorded here, an exit dataprev_follow_up observed at Dataprev, or a termination the Manual 006 report listed), so no documentation is accepted while it stands. AVERBACAO_ARTIFACT_CONFLICT means a different document is already retained for this contract, and a retained document is never replaced. AVERBACAO_DOCUMENTATION_CONFLICT and AVERBACAO_ARTIFACT_CONFLICT are definitive unless the documentation on its way fails at Dataprev, which returns GET .../averbacao to attachment_pending (a contract a renegociação minted then waits for documentation again); AVERBACAO_EXCLUDED is definitive only once GET .../exclusion reads confirmed, and once it reads rejected the same documentation goes through; for a contract that left the registry it is definitive unless a refinanciamento reversal returns it to ativo; AVERBACAO_NOT_ACCEPTED is definitive only once GET .../averbacao reads rejected, since an averbação in flight or ambiguous may still be accepted and the same documentation then goes through. AVERBACAO_HELD_BY_ANOTHER_SENDER means a credential of another nature (bancarizador, fundo or originador) sent this same request first and it has not reached Dataprev: only a credential of that nature resumes it, by sending it again. It stops once Dataprev answers that request. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "With the upstream member, Dataprev refused the documentation and its códigos are there: the contract waits for documentation again, so send it corrected under a new X-Idempotency key, or exclude the contract. Without it, the request cannot be processed as sent, and nothing was sent to Dataprev. IDEMPOTENCY_KEY_REUSE means the X-Idempotency key is spent on a different request, here or on another contract: send a new key. For an averbação sent with the booking block, FORMALIZATION_DEADLINE_EXCEEDED means data_hora_assinatura is after its formalization_deadline: the formalization window lapsed, so exclude the averbação through POST .../exclusion and formalize the contract again, and DECLARED_DATES_OUT_OF_ORDER means data_hora_assinatura is more than five minutes ahead of the gateway's clock. Otherwise the detail names the rule: the signed CCB must be a canonical base64 PDF, an averbação sent with the booking block requires signature_evidence_ref and the evidence pack while one sent without it takes neither, the §2.1.1 signature-evidence branch must be complete, and a dados_cadastrais block must agree with the averbação's cpf and employer kind."
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Attach the signed CCB for an accepted averbação or renegociação
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/attach-consignado-ccb-as-fundo
  /v1/consignado/fundos/{fundo_id}/contracts/{numero_contrato}/corrections:
    get:
      description: |-
        Lists every correction one contract carries, so an operator can prove WHAT was superseded, in which order, and which correction is current.

        A contract nobody has had to correct answers 200 with an empty list, never 404. Having never been corrected is a normal state of a registered contract, and a miss there would read as "no such contract". A fund credential lists only a contract ceded to its fund, or the new contract of a renegociação or refinanciamento of contracts ceded to it while that contract is not ceded itself; any other contract answers the same empty list.

        One contract can carry SEVERAL independent chains: one for its CCB and one per corrected payment. They are laid end to end rather than interleaved, each ordered root first and head last, because there is no order BETWEEN chains and publishing one would invent a fact. Each item names its own `correction_type` and `payment_reference`, which is what tells the chains apart.

        `is_head` is declared by the server and answers "which correction is current". The head is the one correction nothing supersedes, which is a TOPOLOGICAL property: deriving it from a timestamp can name an already-superseded row, so it is derived here once instead of once per client.

        `supersedes_event_id` is null on a first CCB correction, and that null MEANS the original contract-registration fact. It travels as null rather than being omitted, so a reader never has to tell "no such field" apart from "supersedes the original".

        There is NO paging and no cursor. The chain's order is topological, and a keyset needs a position that survives the next append, which supersession links are not. The answer is bounded at 200 items instead, and reaching the bound is REPORTED through `truncated` rather than swallowed: a cut nobody is told about reads as a complete audit trail on the one surface whose purpose is proving what was corrected. `truncated` is also true when a chain link points at a correction this answer does not carry, which means the same thing to the reader.

        Three columns of the stored row never leave: the client's own transport key, and the gateway's object key and version id. The published `resource_uri` is the only address a caller is given, and it is the same path the correction fact names.

        It answers from a LOCAL table and never reaches the Dataprev rail. It answers 501 on a deployment that composed no correction family, which is a deployment posture rather than a wrong URL. The tenant is derived from the validated identity and is never read from the request.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: listConsignadoContractCorrectionsAsFundo
      parameters:
        - description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
          in: path
          name: fundo_id
          required: true
          schema:
            description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
            examples:
              - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
            format: uuid
            type: string
        - description: "The rail contract number whose corrections to enumerate. Exact, control-free UTF-8, bounded in BYTES: 2..15, the same bound the intake enforces."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The rail contract number whose corrections to enumerate. Exact, control-free UTF-8, bounded in BYTES: 2..15, the same bound the intake enforces."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractCorrectionsChain"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: List one contract's correction chain
      tags:
        - Consignado Corrections
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-contract-corrections-as-fundo
  /v1/consignado/fundos/{fundo_id}/contracts/{numero_contrato}/corrections/{correction_id}:
    get:
      description: |-
        Returns the corrected resource bytes a correction fact points at, verified against the digest that fact published.

        This is the endpoint the consumer's M2M artifact reader calls. It answers bytes or an error and never a redirect, a byte range or a content-coded body: each of those turns a valid correction into a terminal failure on the consumer side.

        An unknown correction and one belonging to another tenant share the same 404. The tenant is part of the chain's primary key, so the distinction is not made rather than merely hidden.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: getConsignadoContractCorrectionResourceAsFundo
      parameters:
        - description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
          in: path
          name: fundo_id
          required: true
          schema:
            description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
            examples:
              - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
            format: uuid
            type: string
        - description: The rail contract number the correction belongs to.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The rail contract number the correction belongs to.
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            type: string
        - description: The correction identity published as the fact's event id.
          in: path
          name: correction_id
          required: true
          schema:
            description: The correction identity published as the fact's event id.
            examples:
              - 1f5b9c26-6f5a-4f77-9c1c-5d1c0f0a9b21
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/pdf:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            application/zip:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
          description: Verified corrected resource bytes.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
            ETag:
              schema:
                type: string
            X-Content-Type-Options:
              schema:
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Download the corrected resource a correction fact names
      tags:
        - Consignado Corrections
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-correction-resource-as-fundo
  /v1/consignado/fundos/{fundo_id}/contracts/{numero_contrato}/dados-cadastrais:
    get:
      description: |-
        Returns the contract's cadastro — the averbação's `nome_trabalhador`, plus the `dados_cadastrais` block the documentation sent, else the averbação's — as the exact bytes stored when that block arrived. Until the contract confirms, it is the client's provisional statement. Their SHA-256 is the `dados_cadastrais_digest_sha256` that consignado.contract.registered published, so the consumer verifies the body against the fact and never parses before verifying.

        A contract with no cadastro, a missing contract and another tenant's contract share the same 404. The tenant comes from the validated identity. The bancarizador reads every contract of its tenant. A fund or originador credential reads a contract's signed CCB, biometrics pack and cadastro only when the fund or originador it acts for sent the averbação or one of its documentation attempts, and a fund credential also reads them once the contract is ceded to its fund. Any other contract answers the same 404 as a missing one.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: getConsignadoContractDadosCadastraisAsFundo
      parameters:
        - description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
          in: path
          name: fundo_id
          required: true
          schema:
            description: The fund's register id, as returned in the id field of GET /v1/consignado/fundos. It must be in the partner credential's scope.
            examples:
              - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
            format: uuid
            type: string
        - description: Client contract identity within the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Client contract identity within the authenticated tenant.
            examples:
              - 99999999999AN1
            minLength: 1
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DadosCadastraisDocument"
          description: The stored cadastro bytes, verbatim.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
            X-Content-Type-Options:
              schema:
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Read the cadastro stored with a consignado averbação
      tags:
        - Artifacts
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-dados-cadastrais-as-fundo
  /v1/consignado/fundos/{id}:
    delete:
      description: "Soft-disables the fund: it stops accepting new credit, but the row is never deleted, so credit already attributed to it stays legible. Idempotent: deactivating an already-deactivated fund succeeds."
      operationId: deactivateConsignadoFundo
      parameters:
        - description: The fund's internal id.
          in: path
          name: id
          required: true
          schema:
            description: The fund's internal id.
            format: uuid
            type: string
      responses:
        "204":
          description: No Content
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Deactivate a fund
      tags:
        - Consignado Fundos
      x-mint:
        href: /pt/reference/rails/consignado/deactivate-consignado-fundo
  /v1/consignado/fundos/{id}/creditos:
    get:
      description: |-
        Returns the credits a fund you administer actually OWNS.

        Ownership is keyed on the cessão registration and on nothing else: a credit merely ATTRIBUTED to the fund (allocated to it, but with no cessão registered) is INVISIBLE here, exactly as it is on the fund's own route.

        This operation is for the BANCARIZADOR, which administers many funds and carries none on its credential, so it names the fund it means. The fence is the tenant plus that fund: the tenant is derived from the validated identity and is never read from the request, and the path id must resolve to a fund registered under THAT tenant. An id belonging to another tenant answers 404, identically to one that never existed. The reference the credit query runs on is the resolved fund row's own, so nothing else in the request narrows or widens it.

        A fund reading its own credits uses GET /v1/consignado/fundo/creditos instead, where the fund comes from the credential and there is no fund parameter at all.
      operationId: listConsignadoFundoCreditosCedidosAsBancarizador
      parameters:
        - description: The fund's internal id, as returned in the id field of GET /v1/consignado/fundos. It must name a fund registered under the caller's own tenant; anything else answers 404.
          in: path
          name: id
          required: true
          schema:
            description: The fund's internal id, as returned in the id field of GET /v1/consignado/fundos. It must name a fund registered under the caller's own tenant; anything else answers 404.
            format: uuid
            type: string
        - description: "Narrows the read to ONE auction credit the caller already names: the same idempotency_key the bid was submitted under. A contract averbado directly has no such key, so naming one never returns it. Omit for the whole page. It never widens the fund fence."
          explode: false
          in: query
          name: credit_key
          schema:
            description: "Narrows the read to ONE auction credit the caller already names: the same idempotency_key the bid was submitted under. A contract averbado directly has no such key, so naming one never returns it. Omit for the whole page. It never widens the fund fence."
            maxLength: 128
            type: string
        - description: Maximum number of credits to return. Omitted means the ceiling of 500; a value outside 1..500 is refused with a validation error.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of credits to return. Omitted means the ceiling of 500; a value outside 1..500 is refused with a validation error.
            format: int64
            maximum: 500
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListCededCreditsResponse"
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: List the credits ceded to one fund the caller administers
      tags:
        - Consignado Fundo Créditos
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-fundo-creditos-cedidos-as-bancarizador
  /v1/consignado/fundos/{id}/reactivate:
    post:
      description: "Undoes a deactivation: the fund accepts new credit again under its existing fundo_ref, so an averbação naming it is admitted again. Authorized by the same permission as the deactivation. Idempotent: reactivating an active fund succeeds and returns it unchanged."
      operationId: reactivateConsignadoFundo
      parameters:
        - description: The fund's internal id.
          in: path
          name: id
          required: true
          schema:
            description: The fund's internal id.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Fundo"
          description: OK
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Reactivate a fund
      tags:
        - Consignado Fundos
      x-mint:
        href: /pt/reference/rails/consignado/reactivate-consignado-fundo
  /v1/consignado/jobs:
    get:
      description: |-
        Reports every scheduled Consignado loop this process knows about, whether or not it is running.

        THE ANSWER IS PROCESS MEMORY. One request is served by ONE replica and reports that replica alone, so two reads of this operation may disagree, by design rather than by fault. 'observed_replica' is what makes the disagreement legible: it is an opaque, stable per-process tag, never a hostname and never a pod name. Counters and stamps reset when a process restarts.

        The row set is fixed and complete: every loop in the inventory appears, including one this deployment did not compose. That is the point of the surface. Three conditions read differently, and conflating them is what leaves an operator acting on the wrong thing:

        started true is a loop this process put on the scheduler. 'passes' and 'failures' count what it has done since the process came up.

        started true is always accompanied by a 'reason' of enabled, whatever its family reports: a loop can be gated by its own boot flag rather than by its family's, and a running loop is running.

        started false with a 'reason' of flag_off, portal_store_absent or rail_client_absent is a loop this deployment never composed. The loop never reached the scheduler at all, so it has no counters and no stamps. 'family' names the operation family, and GET /v1/consignado/capabilities carries the same vocabulary for the family as a whole. The deployment flag behind the decision is deliberately not named: a flag name is operator material.

        started false with a 'reason' of enabled, or with no reason at all, plus a 'last_error_class' of scheduler_refused, is the third condition: the registration reached the scheduler and the scheduler REFUSED it, so no worker was started. It is a wiring fault rather than a posture, and it is the one an operator has to escalate.

        No loop runs a pass at process start. Every loop's first pass is delayed and staggered per replica, so 'last_pass_started_at' is null for some time after a deploy on a healthy process.

        'last_error_class' is the class of the MOST RECENT error, not the outcome of the last pass. It is not cleared by a later success, deliberately: a one-second loop would otherwise erase its own failure before anyone could read it. 'failures' beside it is what says whether the loop is still failing. The class names a mechanism and never carries the error message, because a pass error can carry a tenant identifier, a contract number or a rail payload.

        'overruns' and 'max_in_flight' are populated only for the one fixed-rate loop and are null everywhere else, where null means 'does not apply' rather than 'measured none'.

        Nothing here is tenant data: the answer is identical for every tenant this process serves. The tenant is still derived from the validated identity, as on every other operation, and is never read from the request.
      operationId: listConsignadoScheduledJobs
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScheduledJobsResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: Report this process's scheduled Consignado loops
      tags:
        - Consignado Scheduled Jobs
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-scheduled-jobs
  /v1/consignado/legacy-contracts:
    post:
      description: "Proxies incluir-emprestimo-legado-trabalhador (Manual 007 v1.4 §3.1): registers a contract the tenant made BEFORE this rail's model existed. The worker becomes ineligible for new contracting on this rail until the legado contract is excluded or renegotiated. Dataprev performs no documental validation of legado contracts (§2.2.1.3) — the veracity of what is sent is the institution's own responsibility. When codigoTipoContrato is 2 (folha), codigoInscricaoEmpregador, numeroInscricaoEmpregador and matricula become required; this gateway proves that conditional before the rail is called, since neither the rail nor the official Swagger enforces it. X-Idempotency is required. A retried request that lands on the rail's own HX (\"empréstimo já cadastrado\") answers success rather than a refusal."
      operationId: incluirConsignadoEmprestimoLegado
      parameters:
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-legado-incluir-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegadoIncluirBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegadoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Register a pre-existing (legado) loan
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/incluir-consignado-emprestimo-legado
  /v1/consignado/legacy-contracts/renegociacao:
    post:
      description: "Proxies renegociar-emprestimo-legado-trabalhador (Manual 007 v1.4 §3.3): folds every contract named in contratosLegados into a single new Plataforma contract. codigoTipoRenegociacao selects Padrão (1) or Portabilidade (2); this gateway proves the structural half of the Portabilidade rules before the rail is called — numeroUnico populated only under Portabilidade, at least one item carrying it, and no two items sharing the same one — while whether the requester actually holds each legado contract, whether an existing folha (tipoContrato=2) contract was included, and whether the new rate undercuts the original are left to the rail's own judgment (Dataprev performs no documental validation of legado contracts, §2.2.1.3). On Portabilidade (§2.2.1.3): the ported contract itself is NOT excluded automatically — exclusion is the origin bank's own responsibility; every contract of the REQUESTER that carries no numeroUnico is excluded automatically once the operation completes; and any troco (change) is only permitted when every contract INVOLVED in the operation — including the ported one itself — is fully settled (§2.2.1.3). A SUCCESSFUL round trip is codigo SUCESSO with a non-empty numeroContrato: read codigo and errosContratosPortados in the response body — the rail can report per-legado-contract failures inside that same 200 while the new contract still averbates; any other codigo means no new contract was minted and surfaces as a 422 naming the rail's own code. X-Idempotency is required; this operation names no idempotency pair of its own, so a retry is refused by the rail on its own terms."
      operationId: renegociarConsignadoEmprestimoLegado
      parameters:
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-legado-renegociar-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegadoRenegociarBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegadoRenegociarResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Renegotiate one or more legado loans into a new contract
      tags:
        - Consignado Rail
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/renegociar-consignado-emprestimo-legado
  /v1/consignado/legacy-contracts/{numero_contrato}:
    put:
      description: Proxies excluir-emprestimo-legado-trabalhador (Manual 007 v1.4 §3.2, PUT — never DELETE), restoring the worker's eligibility for new contracting on this rail. motivoExclusao is a closed, non-contiguous set (1,2,3,7,8,9 — the manual's own apêndice §4.1 has no 4, 5 or 6). X-Idempotency is required. A retried request that lands on the rail's own HY ("empréstimo inexistente") answers success rather than a refusal.
      operationId: excluirConsignadoEmprestimoLegado
      parameters:
        - description: "Number of the legado contract to remove, percent-encoded as a path segment: '/', spaces and accents must be escaped. 1 to 20 characters once decoded."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "Number of the legado contract to remove, percent-encoded as a path segment: '/', spaces and accents must be escaped. 1 to 20 characters once decoded."
            examples:
              - 99999999999AL1
            minLength: 1
            type: string
        - description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default."
            examples:
              - idem-legado-excluir-0001
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegadoExcluirBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegadoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the durable command this contract already carries. RAIL_COMMAND_CLAIM_CONFLICT means the contract already holds a command of this kind under another idempotency key; follow that claim. RAIL_COMMAND_PAYLOAD_MISMATCH means this key already holds a different command; resend the original under it, or use a new key for a different command. RAIL_COMMAND_ALREADY_REFUSED means the command under this key ended refused (by Dataprev, or by the gateway once M005 showed it never ran), so a corrected request needs a new key. RAIL_COMMAND_OUTCOME_UNRESOLVED means the command under this key has no known outcome yet; read GET /v1/consignado/rail-commands and never send it under a new key. RAIL_COMMAND_ANSWER_NOT_RETAINED means the command committed but its original answer was not kept, so read the contract's current state instead of resending. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: the first call is still running, so hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Remove a previously registered legado loan
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/excluir-consignado-emprestimo-legado
  /v1/consignado/leilao/bid-submissions/cessao:
    put:
      description: |-
        Registers one credit's cessão and establishes the fund's ownership boundary. A prior fund attribution alone does not open fund-scoped reads.

        The bancarizador identifies the credit with the idempotency_key used for the bid and the fund that signed the endosso. The credit must already be attributed to that exact fund; a credit without an attribution or attributed to another fund is rejected.

        The operation is idempotent. Registering the same credit and fund again returns the durable state instead of creating a second row or feed fact. cedido starts false and becomes true only through a registered cessão: this registration, or the Lender's own cessão of the credit's contract. When the Lender already ceded the contract to the same fund, the call returns that cessão. When the Lender ceded it to another fund, the call is rejected with 409 CESSAO_CEDED_TO_OTHER_FUND.
      operationId: registerConsignadoCessao
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CessaoRegistrationRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CessaoRegistrationResponse"
          description: OK
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Register a credit's cessão to its attributed fund
      tags:
        - Consignado Cessão
      x-mint:
        href: /pt/reference/rails/consignado/register-consignado-cessao
  /v1/consignado/leilao/portabilidade/solicitacoes:
    get:
      description: |-
        Reads one page of the rail's portability-auction listing (Manual 011 v1.6 §3.1.2/§3.1.3): the requests from another institution's client to port an existing payroll loan IN to this bancarizador, each carrying the worker's FREE consignable margin and the rail's own eligibility verdict.

        The listing window is MANDATORY and carries no default. Both bounds are required by the rail, and "page N of the solicitações" has no defined answer until the window it pages over is named. Send the SAME window for every page of one walk: a window that slides between requests can let a solicitação cross a page boundary unread.

        'data_hora_validade_solicitacao' is the AUTHORITATIVE clock of each row, not of the listing. It is the instant that specific auction closes, and a proposal submitted after it is refused by the rail. The 72 hours Manual 011 §2.1 publishes is only the rule that formed the instant, so never compute a deadline from the read time.

        'elegivel_emprestimo' is the rail's own eligibility flag and is ABSENT when the rail published no verdict. Absence is a legal shape on this element, so it travels as absent rather than as a fabricated false.

        'margem_disponivel' is the free margin the rail reports for this request, relayed as the decimal string it sent.

        'descartadas' carries the elements the rail published on this page that could not be projected onto a solicitação: a malformed identity, or a worker CPF in a shape no padding repairs. It holds no worker data, only the rail identifier and nothing else. It is published rather than dropped because an inbound auction nobody was told about must not look identical to an auction that does not exist.

        A window holding no open request answers an EMPTY page and not an error: the rail reports that condition as a refusal, and for a listing "nothing is open" is the answer, not a fault.

        This is a window onto the RAIL and writes nothing. It does not advance the portability discovery job's state, so it can return a solicitação the job has already relayed as an offer, and reading it never suppresses one the job still owes. Use the event feed for what the gateway itself has processed. The tenant is derived from the validated identity and is never read from the request.
      operationId: listConsignadoPortabilidadeSolicitacoes
      parameters:
        - description: Listing window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim, Manual 011 v1.6 §3.1.2).
          explode: false
          in: query
          name: data_hora_inicio
          required: true
          schema:
            description: Listing window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim, Manual 011 v1.6 §3.1.2).
            examples:
              - "2026-08-17T00:00:00Z"
            format: date-time
            type: string
        - description: Listing window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). It must follow data_hora_inicio and lie in the PAST, since the rail refuses an end ahead of its own clock with code GR, so leave a margin of a minute or so for clock drift between the two organizations. The span is capped at 365 days by this gateway.
          explode: false
          in: query
          name: data_hora_fim
          required: true
          schema:
            description: Listing window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). It must follow data_hora_inicio and lie in the PAST, since the rail refuses an end ahead of its own clock with code GR, so leave a margin of a minute or so for clock drift between the two organizations. The span is capped at 365 days by this gateway.
            examples:
              - "2026-08-18T00:00:00Z"
            format: date-time
            type: string
        - description: 1-based page number, relayed to the rail's nroPagina. The rail owns the page size (Manual 011 v1.6 publishes no page-size constant of its own); this surface serves exactly one page per call, and the caller owns the loop.
          explode: false
          in: query
          name: page
          schema:
            default: 1
            description: 1-based page number, relayed to the rail's nroPagina. The rail owns the page size (Manual 011 v1.6 publishes no page-size constant of its own); this surface serves exactly one page per call, and the caller owns the loop.
            examples:
              - 1
            format: int64
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataprevListPortabilidadeSolicitacoesResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The listing window, page, or a deterministic rail refusal is invalid for this request.
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The Dataprev portability-listing operation is not wired in this deployment.
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The Dataprev rail is temporarily unavailable.
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: List the inbound portability requests open for the leilão
      tags:
        - Consignado Portability Auction
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-portabilidade-solicitacoes
  /v1/consignado/leilao/portabilidade/solicitacoes/{id_solicitacao_proposta}/propostas:
    post:
      description: |-
        Submits one proposal through inclusao-garantias (Manual 011 v1.6 §3.2) in response to a portability auction request that the client received on a consignado.portability_proposal.received fact. Unlike the M001 bid operation, this endpoint accepts one proposal per call: a request that permits a second proposal, with or without FGTS collateral, requires two separate calls rather than an array.

        dataHoraValidadeSolicitacao is the same field that the initiating fact carried. It is response-side data from Manual 011 §3.1.3 and is not sent to Dataprev in this request. The client echoes it so the gateway can reject a response to an expired record before calling the rail. Expiration is evaluated per record without consulting a calendar.

        Manual 011 uses two spellings for this operation's path: §2.2 omits an accent, while §3.2.3.1 includes one. Because M011 publishes no Swagger path to resolve the discrepancy, the configured path spelling must be validated during homologation. The request and response otherwise follow Manual 011 §3.2.1 and §3.2.2.

        X-Idempotency is the mandatory transport replay key. A retry with the same key returns the stored Dataprev answer instead of resubmitting to the rail. A rejection that the gateway issues on its own is not stored, so a corrected body under the same key is processed. A 500, 503 or 504 that may have reached Dataprev holds the key for its 7-day TTL: that response carries X-Idempotency-Fenced: true, and a resend under the same key is rejected with 422 IDEMPOTENCY_OUTCOME_UNRECORDED. A 503 whose only Dataprev code is OZ (service suspended) does not hold the key. To learn the outcome, resend the same body, with the same numeroProposta, under a new key. Dataprev rejects a proposal number it already holds with SE (Manual 011 v1.6 §3.2.1, §4.1), so a 422 whose upstream member names SE means the first proposal reached Dataprev, and an acceptance means it did not. Never change numeroProposta on that resend. The resend works only before dataHoraValidadeSolicitacao. After that instant the gateway rejects the resend before calling the rail, which proves nothing, and the Dataprev Portal is the only place to check. This endpoint does not have durable PostgreSQL-backed replay storage, so the guarantee does not survive a Redis eviction or service restart.
      operationId: respondConsignadoPortabilityAuction
      parameters:
        - description: Portability solicitação identity, echoed from the initiating fact. A digit string — Manual 011 v1.6 §3.2.1 publishes 32 algarismos, which overflows an int64.
          in: path
          name: id_solicitacao_proposta
          required: true
          schema:
            description: Portability solicitação identity, echoed from the initiating fact. A digit string — Manual 011 v1.6 §3.2.1 publishes 32 algarismos, which overflows an int64.
            examples:
              - "221"
            maxLength: 32
            minLength: 1
            pattern: ^[0-9]{1,32}$
            type: string
        - description: Required transport replay key, scoped by authenticated tenant.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required transport replay key, scoped by authenticated tenant.
            examples:
              - idem-portability-2026-08-10-0001
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PortabilityAuctionResponseRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PortabilityAuctionResponseResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Respond to an inbound portability leilão solicitação
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/respond-consignado-portability-auction
  /v1/consignado/leilao/solicitacoes:
    get:
      description: "Reads one page of the rail's solicitações-trabalhador-paginado listing (Manual 001 v1.9 §3.2.1/§3.2.2): the worker loan requests open for a 24h leilão, each carrying the FREE consignable margin. The inclusion window is MANDATORY — the rail refuses a listing read without one — and the page is served over exactly that window. This is a window onto the RAIL and writes nothing: it does not advance the discovery job's state, so it can return a solicitação the job has already processed. Use the event feed for what the gateway itself has processed."
      operationId: listConsignadoSolicitacoes
      parameters:
        - description: Listing window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 001 v1.9 §3.2.2 p.16).
          explode: false
          in: query
          name: data_hora_inicio
          required: true
          schema:
            description: Listing window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 001 v1.9 §3.2.2 p.16).
            examples:
              - "2026-08-17T00:00:00Z"
            format: date-time
            type: string
        - description: Listing window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). It must follow data_hora_inicio and lie in the PAST — the rail refuses an end ahead of its own clock with code GR (Manual 001 v1.9 §3.2.1 p.15), so leave a margin of a minute or so for clock drift between the two organizations. The span is capped at 365 days by this gateway.
          explode: false
          in: query
          name: data_hora_fim
          required: true
          schema:
            description: Listing window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). It must follow data_hora_inicio and lie in the PAST — the rail refuses an end ahead of its own clock with code GR (Manual 001 v1.9 §3.2.1 p.15), so leave a margin of a minute or so for clock drift between the two organizations. The span is capped at 365 days by this gateway.
            examples:
              - "2026-08-18T00:00:00Z"
            format: date-time
            type: string
        - description: "1-based page number, relayed to the rail's nroPagina. The rail owns the page size (Manual 001 v1.9 §3.2.1 p.15: a system parameter, 250 results per page); this surface serves exactly one page per call."
          explode: false
          in: query
          name: page
          schema:
            default: 1
            description: "1-based page number, relayed to the rail's nroPagina. The rail owns the page size (Manual 001 v1.9 §3.2.1 p.15: a system parameter, 250 results per page); this surface serves exactly one page per call."
            examples:
              - 1
            format: int64
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataprevListSolicitacoesResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: List the worker loan requests open for the leilão
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-solicitacoes
  /v1/consignado/leilao/solicitacoes/{id_solicitacao}/propostas:
    post:
      description: |-
        Submits the complete one-or-two proposal set through inclusao-garantias (Manual 001 v1.9 §3.1) synchronously. X-Idempotency is mandatory and durable.

        | Case | Result | Rail call |
        |---|---|---|
        | Same key + same body, known outcome | 200 replay of the stored response | No |
        | Same key + different body | 422 unprocessable entity | No |
        | New key + same solicitação | 409 conflict | No |
        | Unknown-outcome retry | Retry the unresolved submission with the same proposal IDs | May call the rail with the same proposal IDs |
      operationId: submitConsignadoBid
      parameters:
        - description: Canonical positive int64 Dataprev solicitação identifier, bounded by 9223372036854775807. Leading-zero aliases are normalized before idempotency fingerprinting.
          in: path
          name: id_solicitacao
          required: true
          schema:
            description: Canonical positive int64 Dataprev solicitação identifier, bounded by 9223372036854775807. Leading-zero aliases are normalized before idempotency fingerprinting.
            examples:
              - "18406"
            maxLength: 19
            minLength: 1
            pattern: ^([1-9][0-9]{0,17}|[1-8][0-9]{18}|9[01][0-9]{17}|92[01][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[01][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-6]|9223372036854775807)$
            type: string
        - description: Required durable replay key, scoped by authenticated tenant and bounded like the service's other indexed opaque request references.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required durable replay key, scoped by authenticated tenant and bounded like the service's other indexed opaque request references.
            examples:
              - idem-bid-2026-07-31-0001
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BidRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BidResponse"
          description: OK
          headers:
            X-Idempotency-Replayed:
              schema:
                description: True when PostgreSQL durable state supplied the response without another rail submission.
                type: string
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with a bid that already holds this position. BID_SOLICITACAO_TAKEN means this solicitação already carries a bid from this institution, and a solicitação takes one. BID_PROPOSAL_SLOT_TAKEN means an earlier submission already holds a proposal position in this bid. Both are definitive; read the bid book for the outcome of the submission that holds it. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/BidRefusalError"
                  - $ref: "#/components/schemas/Detail"
          description: "The bid was not accepted. Two shapes share this status. BidRefusalError, carrying a refusal member, means a named local or Dataprev rail rule refused the bid AFTER the refusal was recorded durably: the outcome is final, a replay under the same idempotency key returns it, and the bid book carries it. The canonical problem Detail, with NO refusal member, means the request was refused BEFORE anything durable was written, and its code names the cause. CLT-0006 (payload validation) and BID_ORIGINADOR_UNKNOWN or BID_ORIGINADOR_INACTIVE (the named originador is not registered for this tenant or may no longer act for it): correct the request and send it again. BID_SOLICITACAO_UNKNOWN: the gateway holds no discovered solicitação under this identifier, so retry once its consignado_solicitacao.received event arrives. BID_NO_PROPOSTA_LEFT: a resume has no proposta left to re-send, so place a new bid. IDEMPOTENCY_KEY_REUSE: the key is spent on a different request, so send a new key."
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Client bid submission is disabled for this deployment.
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Submit a one-or-two proposal set to the payroll rail
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/submit-consignado-bid
  /v1/consignado/originadores:
    get:
      description: Returns every originador the tenant registered, active and deactivated alike. Tenant scope is derived from the validated identity; it is never taken from the request.
      operationId: listConsignadoOriginadores
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListOriginadoresResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the tenant's registered originadores
      tags:
        - Consignado Originadores
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-originadores
    post:
      description: "Registers a new originador under the tenant. The originador is a CHILD of this bancarizador, the same way a fund is: the same real originator registered under another tenant is a separate row."
      operationId: createConsignadoOriginador
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateOriginadorRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Originador"
          description: Created
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: Register a new originador
      tags:
        - Consignado Originadores
      x-mint:
        href: /pt/reference/rails/consignado/create-consignado-originador
  /v1/consignado/originadores/{id}:
    delete:
      description: "Soft-disables the originador: it stops being allowed to act, but the row is never deleted, so what it already did stays legible. Idempotent: deactivating an already-deactivated originador succeeds."
      operationId: deactivateConsignadoOriginador
      parameters:
        - description: The originador's internal id.
          in: path
          name: id
          required: true
          schema:
            description: The originador's internal id.
            format: uuid
            type: string
      responses:
        "204":
          description: No Content
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Deactivate an originador
      tags:
        - Consignado Originadores
      x-mint:
        href: /pt/reference/rails/consignado/deactivate-consignado-originador
  /v1/consignado/originadores/{id}/reactivate:
    post:
      description: "Undoes a deactivation: the originador may act again under its existing originadorRef, so an originador credential bids again with no new credential. Authorized by the same permission as the deactivation. Idempotent: reactivating an active originador succeeds and returns it unchanged."
      operationId: reactivateConsignadoOriginador
      parameters:
        - description: The originador's internal id.
          in: path
          name: id
          required: true
          schema:
            description: The originador's internal id.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Originador"
          description: OK
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Bad Request
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Reactivate an originador
      tags:
        - Consignado Originadores
      x-mint:
        href: /pt/reference/rails/consignado/reactivate-consignado-originador
  /v1/consignado/originadores/{originador_id}/bid-submissions:
    get:
      description: |-
        Walks the tenant's bid book, newest claim first: which credits this bancarizador claimed in the leilão, what the rail did with each bid, and whether a fund's cessão was ever registered against it.

        'situation' is the row's own durable state, carried verbatim from the money path and never re-derived here. Five values: 'claimed' is the replay claim written before either proposal reached the rail; 'accepted' and 'refused' are the rail's answer; 'unknown' is an outcome that never arrived; and 'retry_in_flight' is a reconduction under way. Repeat 'situacao' to narrow the page to several at once (situacao=unknown&situacao=retry_in_flight). Omitting it means ALL FIVE, never none. A value outside the vocabulary is refused with 422 rather than matching nothing, because a page that matched nothing is indistinguishable from a tenant that never bid.

        'payload_retained' is what separates a reconducible unknown from one with no way back. It is DERIVED on every read from whether the request payload is still stored, and the payload itself never leaves the database. An unresolved submission with the payload gone can no longer be replayed.

        'retry_lease_expires_at' always carries an instant, including on a settled row where it is simply the last lease that was taken. An instant already in the PAST on a retry_in_flight row is a reconducible submission, and this read reports the book exactly as it stands: it never anticipates the reconduction the recovery sweep will perform.

        'cedido', 'cedido_at' and 'fundo_ref' travel as one trio, read from the contract's one cessão record whichever producer registered it (the bancarizador's command or the lender's own cessão), and half a cessão is not a state this ledger can hold. 'cedido' is actual OWNERSHIP and not mere attribution: 'fundo_ref' may name a fund on a credit nothing has ceded yet.

        Filter with 'cedido=true' for the ceded half or 'cedido=false' for the credits no cessão was ever registered against. OMITTING the parameter is the whole book, and that is the default on purpose: an accepted credit nobody registered a cessão for is precisely the row this screen exists to surface, so it is never filtered out unasked.

        'id_solicitacao' is null on a LOCAL REFUSAL recorded before the rail was ever reached, which is a real row of this book and not a missing value.

        Four columns of the stored row never leave: the two proposal and response payloads, the refusal reason and the actor subject. The first three carry money terms and matrícula, and the last is a subject identity. The payload digest, the retry fence and the purge clocks stay behind with them, as the money path's own fence evidence.

        Paging is keyset over the claim instant and the credit's business key, both frozen for the life of the row, which is what makes the position safe against a book the money path is still writing. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false, so a client loop may terminate on either. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the walk from the top.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501 and it is served on a deployment with the rail off entirely. That deployment simply has an empty book. The tenant is derived from the validated identity and is never read from the request.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: listConsignadoBidSubmissionsAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
        - description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all five.
          explode: true
          in: query
          name: situacao
          schema:
            description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all five.
            examples:
              -   - claimed
            items:
              enum:
                - claimed
                - accepted
                - refused
                - unknown
                - retry_in_flight
              type: string
            type: array
        - description: Narrows the page to credits with a cessão registered (true) or to the ones without one (false). Omitted means the whole book, which is never the same as either half.
          explode: false
          in: query
          name: cedido
          schema:
            description: Narrows the page to credits with a cessão registered (true) or to the ones without one (false). Omitted means the whole book, which is never the same as either half.
            enum:
              - "true"
              - "false"
            examples:
              - "true"
            type: string
        - description: The previous page's page.next_after. Omitted starts at the newest claim. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the newest claim. A cursor this service did not mint is refused, never restarted from the top.
            examples:
              - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOToxMjozM1oiLCJrIjpbImMwMDEyIl19
            type: string
        - description: Maximum number of submissions to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of submissions to return. Omitted means the ceiling of 200.
            examples:
              - 50
            format: int64
            maximum: 200
            minimum: 1
            type: integer
        - description: Narrows the page to the bids ONE originador placed, matched byte for byte. A bancarizador may name any originador of its register; an originador authenticating with its own credential does not need to send it, and if it does it must be its own. Omitted is the whole book for a bancarizador, and the caller's own bids for an originador.
          explode: false
          in: query
          name: originadorRef
          schema:
            description: Narrows the page to the bids ONE originador placed, matched byte for byte. A bancarizador may name any originador of its register; an originador authenticating with its own credential does not need to send it, and if it does it must be its own. Omitted is the whole book for a bancarizador, and the caller's own bids for an originador.
            examples:
              - originador-a
            maxLength: 128
            minLength: 1
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BidSubmissionsPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The request carries no validated identity, or none that names a tenant.
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The identity is valid but does not hold consignado-operations/bid-submissions:read, is neither a bancarizador nor an originador, or is an originador whose originadorRef names a partner other than itself.
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: A caller-correctable refusal, always carrying one of two codes. BID_SUBMISSIONS_INVALID_CURSOR means the cursor was not minted by this service; restart the walk from the first page rather than editing a cursor. BID_SUBMISSIONS_UNKNOWN_SITUATION means the situation filter is outside the five this book records; it is refused rather than answered with an empty page, because a page that matches nothing is indistinguishable from a tenant that submitted no bids.
        "429":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: The tenant's own request pace for this read was exceeded.
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: List the credits this tenant bid on and where each bid stands
      tags:
        - Consignado Bid Submissions
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-bid-submissions-as-originador
  /v1/consignado/originadores/{originador_id}/contracts/{numero_contrato}/artifacts/{artifact_type}:
    get:
      description: |-
        Returns the verified artifact bytes. The bancarizador reads every contract of its tenant. A fund or originador credential reads a contract's signed CCB, biometrics pack and cadastro only when the fund or originador it acts for sent the averbação or one of its documentation attempts, and a fund credential also reads them once the contract is ceded to its fund. A contract a renegociação minted serves its signed CCB once Dataprev accepted its documentation, to the fund and originador the contract inherited from the contract it replaced. Any other contract answers the same 404 as a missing one. Missing and non-entitled artifacts share the same 404 response. The response contains no storage coordinates or direct-storage URL.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: getConsignadoContractArtifactAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
        - description: Client contract identity within the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Client contract identity within the authenticated tenant.
            examples:
              - contract-1
            minLength: 1
            type: string
        - description: Closed retained artifact type.
          in: path
          name: artifact_type
          required: true
          schema:
            description: Closed retained artifact type.
            enum:
              - signed_ccb
              - biometrics_documents_pack
            examples:
              - signed_ccb
            type: string
      responses:
        "200":
          content:
            application/pdf:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            application/zip:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
          description: Verified retained artifact bytes.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
            ETag:
              schema:
                type: string
            X-Content-Type-Options:
              schema:
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Download a retained consignado contract artifact
      tags:
        - Artifacts
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-artifact-as-originador
  /v1/consignado/originadores/{originador_id}/contracts/{numero_contrato}/averbacao:
    get:
      description: |-
        Returns ONE contract's averbação operation, by the rail contract number.

        It answers from a LOCAL table and never reaches the Dataprev rail. The tenant is derived from the validated identity: a contract that does not exist and a contract belonging to another tenant are the SAME answer, 404, so this read cannot be used to probe another tenant's book.

        A fund or originador credential reads only an averbação its own credential sent, or whose documentation it sent; any other contract answers the same 404. The bancarizador reads every contract of its tenant.

        The body is the operation object itself, with no envelope, the same shape as one element of GET /v1/consignado/averbacao-operations. Every conditional instant is present and null until the step it names has happened.

        This is the READ half of the address whose POST creates the payroll-deduction mandate. It creates nothing and changes nothing.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: getConsignadoContractAverbacaoOperationAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
        - description: The rail contract number, exactly as it was registered. It is never trimmed or normalized.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The rail contract number, exactly as it was registered. It is never trimmed or normalized.
            maxLength: 15
            minLength: 2
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationItem"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "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
      security:
        - BearerAuth: []
      summary: Get one contract's averbação operation
      tags:
        - Consignado Averbação Operations
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-averbacao-operation-as-originador
    post:
      description: |-
        Submits averbar-consignado-trabalhador (Manual 003 v1.19 §3.1) and nothing else. An accepted averbação answers status attachment_pending and publishes consignado.averbacao.accepted: Dataprev holds the mandate, and the contract waits for its documentation — the signed CCB, the evidence pack when the averbação carries the booking block, and the Manual 004 signature evidence — sent through POST .../ccb-attachment. This body carries no document and no signing instant: artifacts, data_hora_assinatura and the signature-evidence fields are refused 422, or 413 first when the body exceeds 1 MiB, as one carrying a real signed CCB usually does. THIS COMMITS MONEY: the averbação creates the payroll-deduction mandate the worker starts paying — so the operation is marked x-money-path: true in this document. POST .../exclusion can cancel an accepted averbação, also while it waits for its documentation. X-Idempotency is required; the transport middleware supplies best-effort response replay while the durable PostgreSQL operation record remains the semantic authority, keyed by tenant and contract and bound to the request payload's digest. The numero_contrato in the body MUST equal the one in the path. A retry after the documentation was sent answers the operation as it stands and never attaches anything.

        This intake accepts a bancarizador credential, a fundo credential for its own fund, or an originador credential for a contract whose proposal came from its own bid (a fund it names is validated against the tenant's fund register first, and a contract outside its own bids is refused 403), and most other rail operations accept a bancarizador credential only — so do not assume the credential that reaches this route reaches the rest of the rail.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would. On this route the body names the fund by fundo_id, its register id, and fundo_ref is refused 422.
      operationId: averbarConsignadoContractAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
        - description: "The contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits. Must equal the numero_contrato in the body."
          in: path
          name: numero_contrato
          required: true
          schema:
            description: "The contract number, minted by the CLIENT — the rail mints nothing here: 2 to 15 letters or digits. Must equal the numero_contrato in the body."
            examples:
              - 99999999999AN1
            maxLength: 15
            minLength: 2
            pattern: ^[A-Za-z0-9]+$
            type: string
        - description: Required idempotency key. Absent is 422, never a generated default.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required idempotency key. Absent is 422, never a generated default.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OriginadorAverbacaoRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the averbação this contract already holds. AVERBACAO_CLAIM_CONFLICT means the averbação is already claimed under another idempotency key, so follow the claim that exists rather than opening a second one. It is definitive. CONTRACT_ALREADY_REGISTERED means the contract number is already a contract in this gateway (minted by a refinanciamento or renegociação, imported, or received by portability); nothing was written and nothing was sent to Dataprev. It is definitive. AVERBACAO_HELD_BY_ANOTHER_SENDER means a credential of another nature (bancarizador, fundo or originador) sent this same request first and it has not reached Dataprev: only a credential of that nature resumes it, by sending it again. It stops once Dataprev answers that request. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The request cannot be processed as sent. IDEMPOTENCY_KEY_REUSE means the X-Idempotency key is spent on a different request: send a new key. FUNDO_NOT_REGISTERED means fundo_ref names no fund registered for this tenant, and FUNDO_DEACTIVATED a fund that no longer accepts new credit: correct fundo_ref. A body carrying documents or Manual 004 signature evidence answers 422, or 413 first when it exceeds 1 MiB: they are sent through POST .../ccb-attachment, and so is data_hora_assinatura. FIRST_DEDUCTION_BEFORE_COMPETENCIA means data_primeiro_desconto falls in a month before first_deduction_competencia; DECLARED_DATES_OUT_OF_ORDER means the declared dates break an order the booking requires (see data_inicio_contrato and data_primeiro_desconto); correct the dates and resend. BOOKING_FIELD_INVALID means the lender cannot read a booking field (see loan_product_version, margin_snapshot, contract_id and fundo_ref). DECLARED_TERMS_INCONSISTENT means the declared amounts or rates contradict each other (see principal_amount and monthly_rate); correct the terms. MARGIN_SNAPSHOT_INCONSISTENT means margin_snapshot does not hold installment_amount; read the margin again or re-price. CONTRACT_NOT_BOOKABLE means the lender cannot book this contract at all (see installment_count and expected_disbursement_date); send it without the booking block. RATE_OUTSIDE_PRODUCT_RANGE means monthly_rate times 12 falls outside the annual rate range of the loan_product_version the Lender published; a version this gateway has not seen is not checked. Each detail names the rule. All of these apply only with the booking block, and the rail was not called; a retry of an averbação the rail already accepted is not refused."
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Averbar a consignado contract on the payroll rail
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/averbar-consignado-contract-as-originador
  /v1/consignado/originadores/{originador_id}/contracts/{numero_contrato}/ccb-attachment:
    post:
      description: |-
        Submits incluir-informacoes-contrato-trabalhador (Manual 004 v1.6 §2.1) for a contract whose averbação Dataprev already accepted, or that a renegociação Dataprev accepted through this gateway minted (Manual 004 §1.2.1), and nothing else: it never averbates. With neither for the path's contract — no averbação sent, or one still in flight, ambiguous or rejected, and no accepted renegociação that minted it — it answers 409 AVERBACAO_NOT_ACCEPTED and nothing is sent to Dataprev. The body is the documentation alone: the signed CCB, the evidence pack and signature_evidence_ref when the averbação carried the booking block (refused when it did not), data_hora_assinatura, the instant the worker signed, which may be days after the averbação, and the §2.1.1 signature evidence. The contract's identity and terms are the averbação's and are not sent again; an optional dados_cadastrais replaces the averbação's cadastro block. A contract takes one accepted documentation, fixed under its own X-Idempotency key and payload digest: the same documentation under a new key replays, and a different one is 409 AVERBACAO_DOCUMENTATION_CONFLICT. When Dataprev refuses the documentation, the answer is 422 with Dataprev's códigos in the upstream member and the contract waits for documentation again: send it corrected under a new X-Idempotency key, or exclude the contract. Any other failure of the call (no answer in time, a Dataprev 5xx, a lost connection, an unusable receipt) also returns the contract to waiting for documentation and answers 5xx: send the same documentation again, under the same X-Idempotency key or a new one, and Dataprev replaces what it holds and returns a new receipt. The documents are retained before Dataprev is called, and the rail's hashOperacao is recorded durably so a replay is answered from the record. An accepted attachment answers confirmed and publishes consignado.averbacao.confirmed.

        A contract a renegociação minted is documented with the signed CCB of the contract it replaced, whose clause allows the renegotiation on a change of employer. Its identity is the one the renegociação registered, it takes the signed CCB alone (signature_evidence_ref, the evidence pack and dados_cadastrais are refused 422), the signed CCB is retained before Dataprev is called, as an averbação's documents are, and an accepted attachment answers confirmed without contractId or averbacaoAt and publishes nothing: a renegociação disburses nothing.

        THIS COMMITS MONEY, which is why it is marked x-money-path: true: its acceptance confirms an averbação's contract, which is what bills it and hands it to the Lender for booking and disbursement. The conditional signature-evidence fields are mutually exclusive §2.1.1 branches, so send the branch your signing flow used rather than the union of the per-field examples: indicador_analfabetismo, indicador_assinatura_cert_digital_icp_brasil or nsu_contrato makes the flow biometrics-exempt.

        This intake accepts a bancarizador credential, a fundo credential for a contract of its own fund, or an originador credential for a contract whose proposal came from its own bid (any other contract is refused 403), and most other rail operations accept a bancarizador credential only — so do not assume the credential that reaches this route reaches the rest of the rail. A body carrying dados_cadastrais also needs the averbação's grant, originador-contract-averbacao/post, beside this route's originador-contract-ccb-attachment/post: without it the request is refused 403 before anything is recorded or sent to Dataprev.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: attachConsignadoCCBAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
        - description: The contract whose accepted averbação this documentation is for.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: The contract whose accepted averbação this documentation is for.
            examples:
              - 99999999999AN1
            type: string
        - description: Required idempotency key of the documentation, its own and not the averbação's. Absent is 422, never a generated default.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required idempotency key of the documentation, its own and not the averbação's. Absent is 422, never a generated default.
            examples:
              - idem-ccb-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CCBAttachmentRequestedCommand"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AverbacaoOperationResponse"
          description: OK
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with the averbação or the documentation this contract holds; nothing was sent to Dataprev. AVERBACAO_NOT_ACCEPTED means Dataprev has not accepted an averbação for this contract — none was sent, or it is still in flight, ambiguous or rejected — nor did a renegociação accepted through this gateway mint it: read GET .../averbacao before sending the documentation again (a contract a renegociação minted has no averbação, and GET .../averbacao answers 404 for it). AVERBACAO_DOCUMENTATION_CONFLICT means the contract's documentation is already fixed under another idempotency key with a different payload, or another documentation of it is on its way to Dataprev, or the contract was documented before documentation had its own record: a contract takes one accepted documentation, so follow the existing one. AVERBACAO_EXCLUDED means an exclusion of this averbação was requested and Dataprev has not rejected it, or the contract left the registry (a refinanciamento, renegociação or portability exclusion recorded here, an exit dataprev_follow_up observed at Dataprev, or a termination the Manual 006 report listed), so no documentation is accepted while it stands. AVERBACAO_ARTIFACT_CONFLICT means a different document is already retained for this contract, and a retained document is never replaced. AVERBACAO_DOCUMENTATION_CONFLICT and AVERBACAO_ARTIFACT_CONFLICT are definitive unless the documentation on its way fails at Dataprev, which returns GET .../averbacao to attachment_pending (a contract a renegociação minted then waits for documentation again); AVERBACAO_EXCLUDED is definitive only once GET .../exclusion reads confirmed, and once it reads rejected the same documentation goes through; for a contract that left the registry it is definitive unless a refinanciamento reversal returns it to ativo; AVERBACAO_NOT_ACCEPTED is definitive only once GET .../averbacao reads rejected, since an averbação in flight or ambiguous may still be accepted and the same documentation then goes through. AVERBACAO_HELD_BY_ANOTHER_SENDER means a credential of another nature (bancarizador, fundo or originador) sent this same request first and it has not reached Dataprev: only a credential of that nature resumes it, by sending it again. It stops once Dataprev answers that request. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "With the upstream member, Dataprev refused the documentation and its códigos are there: the contract waits for documentation again, so send it corrected under a new X-Idempotency key, or exclude the contract. Without it, the request cannot be processed as sent, and nothing was sent to Dataprev. IDEMPOTENCY_KEY_REUSE means the X-Idempotency key is spent on a different request, here or on another contract: send a new key. For an averbação sent with the booking block, FORMALIZATION_DEADLINE_EXCEEDED means data_hora_assinatura is after its formalization_deadline: the formalization window lapsed, so exclude the averbação through POST .../exclusion and formalize the contract again, and DECLARED_DATES_OUT_OF_ORDER means data_hora_assinatura is more than five minutes ahead of the gateway's clock. Otherwise the detail names the rule: the signed CCB must be a canonical base64 PDF, an averbação sent with the booking block requires signature_evidence_ref and the evidence pack while one sent without it takes neither, the §2.1.1 signature-evidence branch must be complete, and a dados_cadastrais block must agree with the averbação's cpf and employer kind."
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Attach the signed CCB for an accepted averbação or renegociação
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/attach-consignado-ccb-as-originador
  /v1/consignado/originadores/{originador_id}/contracts/{numero_contrato}/dados-cadastrais:
    get:
      description: |-
        Returns the contract's cadastro — the averbação's `nome_trabalhador`, plus the `dados_cadastrais` block the documentation sent, else the averbação's — as the exact bytes stored when that block arrived. Until the contract confirms, it is the client's provisional statement. Their SHA-256 is the `dados_cadastrais_digest_sha256` that consignado.contract.registered published, so the consumer verifies the body against the fact and never parses before verifying.

        A contract with no cadastro, a missing contract and another tenant's contract share the same 404. The tenant comes from the validated identity. The bancarizador reads every contract of its tenant. A fund or originador credential reads a contract's signed CCB, biometrics pack and cadastro only when the fund or originador it acts for sent the averbação or one of its documentation attempts, and a fund credential also reads them once the contract is ceded to its fund. Any other contract answers the same 404 as a missing one.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: getConsignadoContractDadosCadastraisAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
        - description: Client contract identity within the authenticated tenant.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: Client contract identity within the authenticated tenant.
            examples:
              - 99999999999AN1
            minLength: 1
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DadosCadastraisDocument"
          description: The stored cadastro bytes, verbatim.
          headers:
            Cache-Control:
              schema:
                type: string
            Content-Type:
              schema:
                type: string
            X-Content-Type-Options:
              schema:
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Implemented
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      security:
        - BearerAuth: []
      summary: Read the cadastro stored with a consignado averbação
      tags:
        - Artifacts
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-contract-dados-cadastrais-as-originador
  /v1/consignado/originadores/{originador_id}/leilao/solicitacoes:
    get:
      description: |-
        Reads one page of the rail's solicitações-trabalhador-paginado listing (Manual 001 v1.9 §3.2.1/§3.2.2): the worker loan requests open for a 24h leilão, each carrying the FREE consignable margin. The inclusion window is MANDATORY — the rail refuses a listing read without one — and the page is served over exactly that window. This is a window onto the RAIL and writes nothing: it does not advance the discovery job's state, so it can return a solicitação the job has already processed. Use the event feed for what the gateway itself has processed.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: listConsignadoSolicitacoesAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
        - description: Listing window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 001 v1.9 §3.2.2 p.16).
          explode: false
          in: query
          name: data_hora_inicio
          required: true
          schema:
            description: Listing window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 001 v1.9 §3.2.2 p.16).
            examples:
              - "2026-08-17T00:00:00Z"
            format: date-time
            type: string
        - description: Listing window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). It must follow data_hora_inicio and lie in the PAST — the rail refuses an end ahead of its own clock with code GR (Manual 001 v1.9 §3.2.1 p.15), so leave a margin of a minute or so for clock drift between the two organizations. The span is capped at 365 days by this gateway.
          explode: false
          in: query
          name: data_hora_fim
          required: true
          schema:
            description: Listing window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). It must follow data_hora_inicio and lie in the PAST — the rail refuses an end ahead of its own clock with code GR (Manual 001 v1.9 §3.2.1 p.15), so leave a margin of a minute or so for clock drift between the two organizations. The span is capped at 365 days by this gateway.
            examples:
              - "2026-08-18T00:00:00Z"
            format: date-time
            type: string
        - description: "1-based page number, relayed to the rail's nroPagina. The rail owns the page size (Manual 001 v1.9 §3.2.1 p.15: a system parameter, 250 results per page); this surface serves exactly one page per call."
          explode: false
          in: query
          name: page
          schema:
            default: 1
            description: "1-based page number, relayed to the rail's nroPagina. The rail owns the page size (Manual 001 v1.9 §3.2.1 p.15: a system parameter, 250 results per page); this surface serves exactly one page per call."
            examples:
              - 1
            format: int64
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataprevListSolicitacoesResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: List the worker loan requests open for the leilão
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-solicitacoes-as-originador
  /v1/consignado/originadores/{originador_id}/leilao/solicitacoes/{id_solicitacao}/propostas:
    post:
      description: |-
        Submits the complete one-or-two proposal set through inclusao-garantias (Manual 001 v1.9 §3.1) synchronously. X-Idempotency is mandatory and durable.

        | Case | Result | Rail call |
        |---|---|---|
        | Same key + same body, known outcome | 200 replay of the stored response | No |
        | Same key + different body | 422 unprocessable entity | No |
        | New key + same solicitação | 409 conflict | No |
        | Unknown-outcome retry | Retry the unresolved submission with the same proposal IDs | May call the rail with the same proposal IDs |

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: submitConsignadoBidAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
        - description: Canonical positive int64 Dataprev solicitação identifier, bounded by 9223372036854775807. Leading-zero aliases are normalized before idempotency fingerprinting.
          in: path
          name: id_solicitacao
          required: true
          schema:
            description: Canonical positive int64 Dataprev solicitação identifier, bounded by 9223372036854775807. Leading-zero aliases are normalized before idempotency fingerprinting.
            examples:
              - "18406"
            maxLength: 19
            minLength: 1
            pattern: ^([1-9][0-9]{0,17}|[1-8][0-9]{18}|9[01][0-9]{17}|92[01][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[01][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-6]|9223372036854775807)$
            type: string
        - description: Required durable replay key, scoped by authenticated tenant and bounded like the service's other indexed opaque request references.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required durable replay key, scoped by authenticated tenant and bounded like the service's other indexed opaque request references.
            examples:
              - idem-bid-2026-07-31-0001
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BidRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BidResponse"
          description: OK
          headers:
            X-Idempotency-Replayed:
              schema:
                description: True when PostgreSQL durable state supplied the response without another rail submission.
                type: string
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "A conflict with a bid that already holds this position. BID_SOLICITACAO_TAKEN means this solicitação already carries a bid from this institution, and a solicitação takes one. BID_PROPOSAL_SLOT_TAKEN means an earlier submission already holds a proposal position in this bid. Both are definitive; read the bid book for the outcome of the submission that holds it. A 409 carrying NO code and the detail \"an identical request is already in flight\" is not definitive: hold this idempotency key and retry under it. DATAPREV_CREDENTIAL_REQUIRED means this tenant has no Dataprev credential in custody, so the gateway cannot act for it on the rail at all; it is definitive until the credential is provisioned, and retrying before that never succeeds. DATAPREV_CREDENTIAL_REVOKED means the tenant's credentials were revoked; it holds until a complete upload (PUT /v1/credentials/dataprev with the certificate and the OAuth client together) opens a new custody. DATAPREV_CREDENTIAL_REJECTED means Dataprev refused its OAuth client credentials, so correct them in custody before retrying."
        "422":
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/BidRefusalError"
                  - $ref: "#/components/schemas/Detail"
          description: "The bid was not accepted. Two shapes share this status. BidRefusalError, carrying a refusal member, means a named local or Dataprev rail rule refused the bid AFTER the refusal was recorded durably: the outcome is final, a replay under the same idempotency key returns it, and the bid book carries it. The canonical problem Detail, with NO refusal member, means the request was refused BEFORE anything durable was written, and its code names the cause. CLT-0006 (payload validation) and BID_ORIGINADOR_UNKNOWN or BID_ORIGINADOR_INACTIVE (the named originador is not registered for this tenant or may no longer act for it): correct the request and send it again. BID_SOLICITACAO_UNKNOWN: the gateway holds no discovered solicitação under this identifier, so retry once its consignado_solicitacao.received event arrives. BID_NO_PROPOSTA_LEFT: a resume has no proposta left to re-send, so place a new bid. IDEMPOTENCY_KEY_REUSE: the key is spent on a different request, so send a new key."
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "501":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Client bid submission is disabled for this deployment.
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Submit a one-or-two proposal set to the payroll rail
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/submit-consignado-bid-as-originador
  /v1/consignado/originadores/{originador_id}/workers/margin:
    post:
      description: |-
        Opens or reuses the worker's authorization and reads available payroll margin — the rail's autorizar-consulta-dados-trabalhador (Manual 002 v1.15 §3.1) and consultar-dados-trabalhador (Manual 002 v1.15 §3.3) behind ONE operation, because the adapter performs them as one. POST, not GET: it opens a consent, and the consent evidence plus the CPF must travel in a body rather than in a path or query string. The worker's authorization token is NEVER returned. A consignado.margin.fetched fact is emitted on this path exactly as on the lender event path, so a client integrating by API keeps its other consumers fed.

        CONSENT WINDOW (Manual 002 v1.15 §5.6). dataHoraAutorizacaoDigital starts two clocks, measured in calendar days from the worker's signature: the authorization may be CONSULTED for 30 days, and a request may be MADE against it for 45. Both boundaries are INCLUSIVE — the instant exactly 30 or 45 days after the signature is still inside its window, and only the next nanosecond is outside.

        Outside either window the gateway refuses LOCALLY, before a byte reaches the rail: 422 with code CLT-0006 and a detail telling you to obtain a fresh worker authorization. THAT REFUSAL IS NOT RETRYABLE. Repeating the request performs the very read the lapsed authorization withdrew; only new authorization evidence makes it succeed. A dataHoraAutorizacaoDigital carrying a non-UTC offset, or dated ahead of the gateway's clock, is the same 422 with a different detail — correct the timestamp; the worker's consent is not in question.

        Contrast the rail's OWN consent rejection (Dataprev EX/IV on a stale tokenAutorizacao): that is 503 and IS retryable, because the gateway drops the cached token and the next attempt opens a fresh consent from the same evidence.

        Partner route: the text above describes the party's own route. Here the register id in the path names the party: it must be in the partner credential's scope and registered under the caller's tenant, and the call runs as that party, exactly as the party's own credential would.
      operationId: fetchConsignadoWorkerMarginAsOriginador
      parameters:
        - description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
          in: path
          name: originador_id
          required: true
          schema:
            description: The originador's register id, as returned in the id field of GET /v1/consignado/originadores. It must be in the partner credential's scope.
            examples:
              - 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MarginRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MarginResponse"
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Fetch a worker's available consignable margin
      tags:
        - Consignado Rail Commands
      x-mint:
        href: /pt/reference/rails/consignado/fetch-consignado-worker-margin-as-originador
  /v1/consignado/portabilidade/efetivacoes:
    post:
      description: |-
        Reads one page of consultar-portabilidade-trabalhador (Manual 008 v1.10 §5.4), the proponent's published status view for a portability. classificadorSituacao is relayed without reinterpretation: 0 Aberto, 1 Encerrado por prazo, 2 Encerrado por averbação, or 3 Encerrado por alteração do Número Único. Code 1 means that the 20-calendar-day portability window has closed and the FGTS collateral blocks were removed.

        codigoProponente is injected from the tenant's Dataprev credential and is never accepted from the caller. The filters travel in the request body. Send {} for the first page with no filter. This read does not mutate gateway state. It spends the tenant's write rate budget, which the tenant's commands share.
      operationId: listConsignadoPortabilidadeEfetivacoes
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PortabilidadeConsultaRequestBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PortabilidadeConsultaResponseBody"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read one page of a portability's efetivação status
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-portabilidade-efetivacoes
  /v1/consignado/portabilidade/{numero_unico}/averbacao:
    post:
      description: |-
        Performs averbar-portabilidade-trabalhador (Manual 008 v1.10 §5.3): the proponent institution's averbação of a portability. The origin-side exclusion is a separate command, POST /v1/consignado/contracts/{numero_contrato}/portabilidade/exclusao. It may occur before or after this averbação under Manual 008 §4, which explicitly defines the before-exclusion case and treats the reserved value as zero.

        dataExclusaoOrigem is optional and is not sent to Dataprev. When supplied, it is the origin exclusion date tracked by the client. The gateway echoes it so it can refuse an averbação whose 20-calendar-day window (Manual 008 §4) has already elapsed before calling the rail. No business calendar is consulted because the window is in calendar days. When absent, the gateway submits the averbação as occurring before the origin exclusion. The gateway has no initiating fact to fall back on, so the client is the only source of the exclusion date when one exists.

        X-Idempotency is the mandatory transport replay key. A retry with the same key is answered from the stored Dataprev answer instead of being resubmitted to the rail. A rejection that the gateway issues on its own is not stored, so a corrected body under the same key is processed. A 500, 503 or 504 that may have reached Dataprev holds the key for its 7-day TTL: that response carries X-Idempotency-Fenced: true, and a resend under the same key is rejected with 422 IDEMPOTENCY_OUTCOME_UNRECORDED. A 503 whose only Dataprev code is OZ (service suspended) does not hold the key. Reconcile on POST /v1/consignado/portabilidade/efetivacoes instead of resending under a new key, which would submit the averbação again. This route does not have durable Postgres-backed replay storage, so, unlike the bid route, that guarantee does not survive a Redis eviction or restart.
      operationId: averbarConsignadoPortabilidade
      parameters:
        - description: The portability's NSU (Manual 008 v1.10 publishes 21 algarismos, which overflows int64/float64 — carried and validated as a digit string only).
          in: path
          name: numero_unico
          required: true
          schema:
            description: The portability's NSU (Manual 008 v1.10 publishes 21 algarismos, which overflows int64/float64 — carried and validated as a digit string only).
            examples:
              - "100000000000000000001"
            maxLength: 21
            minLength: 1
            pattern: ^[0-9]{1,21}$
            type: string
        - description: Required transport replay key, scoped by authenticated tenant.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Required transport replay key, scoped by authenticated tenant.
            examples:
              - idem-portabilidade-averbacao-2026-01-21-0001
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PortabilidadeAverbacaoRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PortabilidadeAverbacaoResponseBody"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Averbate a portability
      tags:
        - Consignado Rail Commands
      x-money-path: true
      x-mint:
        href: /pt/reference/rails/consignado/averbar-consignado-portabilidade
  /v1/consignado/rail-commands:
    get:
      description: |-
        Walks the tenant's rail-command book, newest invocation first: what this gateway told the payroll rail to do, and what the rail answered.

        It records TWELVE commands: refinanciamento, its reversal, renegociação, the origin-side portability exclusion, both antecipação de parcela operations, all three empréstimo legado operations, and the three contract-management ones (suspensão, reativação, alteração de termos). Each row carries the situation it is durably parked in, reported exactly as it stands: an invoking row whose deadline has passed is the row the recovery sweep will convert, and this read never anticipates that conversion.

        'unlogged_operations' is a FIXED list rather than anything derived from the rows, and it names TWO operations, both on the portability path: averbarConsignadoPortabilidade and respondConsignadoPortabilityAuction. Their command services hold no durable store of any kind, so nothing on this side can report what the rail was told or what it answered, and an empty book is NOT evidence that no call departed — which matters because portability moves a consignado contract between institutions. The field is published even when empty, so a client can tell "no operation is unlogged" from "this gateway stopped reporting it"; a rail operation added later with no durable record of its own appears here too.

        Not every command is CONVERGIBLE. A Manual 005 contract read decides the outcome of refinanciamento, its reversal, renegociação and the portability exclusion, so an ambiguous row of those four leaves outcome_unknown once the recovery pass reads the registry. The other eight have no such decisive read. A legado contract number, for instance, may be registered by an earlier attempt, another channel or the institution itself, so its presence proves the number is taken and not that this command committed. One of their rows that reaches outcome_unknown STAYS there. That is the truth about the call, not a queue nobody drains, and the situation filter is how you find them.

        'unknown_at' SURVIVES on a closed row. An outcome that passed through ambiguity keeps that evidence, which is what lets a screen tell a clean acceptance from a recovered one. 'response_code' and 'response_message' are null on an invoking row, which the ledger's own constraint demands, and they are the refusal reason an operator came to this screen to read.

        Three columns of the stored row never leave: the rail's raw answer, the request digest and the idempotency key. The first can carry fields no screen was meant to publish; the other two are the money fence's own transport evidence.

        'command' and 'status' may each be repeated to narrow the page to several values at once (status=invoking&status=outcome_unknown). Omitting a filter means ALL of its values, never none. A value outside either vocabulary is refused with 422 rather than matching nothing, because a page that matched nothing is indistinguishable from a tenant that never called the rail.

        Paging is keyset over the invocation instant and the row id, both frozen for the life of the row by the ledger's own trigger, which is what makes the position safe against a book the money path is still writing. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false, so a client loop may terminate on either. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the walk from the top.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501 and it is served on a deployment with the rail off entirely. That deployment simply has an empty book. The tenant is derived from the validated identity and is never read from the request.
      operationId: listConsignadoRailCommands
      parameters:
        - description: Narrows the page to the named commands. Repeat the parameter for several. Omitted means all twelve.
          explode: true
          in: query
          name: command
          schema:
            description: Narrows the page to the named commands. Repeat the parameter for several. Omitted means all twelve.
            examples:
              -   - refinanciamento
            items:
              enum:
                - refinanciamento
                - reversao_refinanciamento
                - renegociacao
                - exclusao_portabilidade
                - antecipacao_incluir
                - antecipacao_excluir
                - legado_incluir
                - legado_renegociar
                - legado_excluir
                - suspensao
                - reativacao
                - alteracao_termos
              type: string
            type: array
        - description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all four.
          explode: true
          in: query
          name: status
          schema:
            description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all four.
            examples:
              -   - invoking
            items:
              enum:
                - invoking
                - accepted
                - rejected
                - outcome_unknown
              type: string
            type: array
        - description: The previous page's page.next_after. Omitted starts at the newest invocation. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the newest invocation. A cursor this service did not mint is refused, never restarted from the top.
            examples:
              - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOToxMjozM1oiLCJrIjpbImMwMDEyIl19
            type: string
        - description: Maximum number of rail commands to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of rail commands to return. Omitted means the ceiling of 200.
            examples:
              - 50
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RailCommandsPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the tenant's rail commands and the operations that leave no record
      tags:
        - Consignado Rail Commands
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-rail-commands
  /v1/consignado/reconciliation/escrituracoes:
    get:
      description: "Reads the rail's consultar-escrituracoes-remuneracoes (Manual 005 v1.13 §3.3): every escrituração record included in the inclusion window, each carrying its OWN competência and Dataprev's pre-computed analise verdict, relayed verbatim. The window is mandatory and capped at 30 days by the rail (code GR); this gateway refuses a wider window locally. The read writes nothing: the reconciliation job's per-record done-keys are untouched, so a record read here is still delivered as a fact by the job."
      operationId: listConsignadoEscrituracoes
      parameters:
        - description: Inclusion window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 005 v1.13 §3.3.1 p.20 / §3.4.1 p.26).
          explode: false
          in: query
          name: data_hora_inicio
          required: true
          schema:
            description: Inclusion window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 005 v1.13 §3.3.1 p.20 / §3.4.1 p.26).
            examples:
              - "2026-07-01T00:00:00Z"
            format: date-time
            type: string
        - description: Inclusion window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). The span must not exceed 30 days — the rail answers code GR above that (Manual 005 v1.13 §4.1 p.29), and this gateway refuses 422 locally so the attempt costs no rail quota.
          explode: false
          in: query
          name: data_hora_fim
          required: true
          schema:
            description: Inclusion window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). The span must not exceed 30 days — the rail answers code GR above that (Manual 005 v1.13 §4.1 p.29), and this gateway refuses 422 locally so the attempt costs no rail quota.
            examples:
              - "2026-07-30T00:00:00Z"
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataprevEscrituracoesResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read the payroll escrituração records included in a window
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-escrituracoes
  /v1/consignado/reconciliation/repasse-expectations:
    get:
      description: |-
        Walks the tenant's own repasse expectation book: the escriturated instalments whose transfer the rail still owes, oldest deadline first, undated promises last.

        READ THE FRESHNESS STAMP BEFORE THE ROWS. An empty list under a state other than fresh DOES NOT MEAN nothing is missing. When the reconciliation pass cannot seed the tenant database it returns before the D+2 detector runs, publishing neither an alarm nor the "I do not know" fact, so that outage class is indistinguishable from health unless the stamp is read. state is fresh, stale or never. never covers a deployment that never composed reconciliation and a tenant whose rail credentials never worked. stale additionally covers a stamp this deployment could not read at all: that is not a claim that reconciliation never ran, and last_clean_read_at is then null under a stale state rather than under never.

        The clean-read instant is DURABLE and shared by every replica whenever the stamp was recorded and can be read, so a restarted process answers for a pass it did not run and two reads of the same tenant agree. Two reads that DISAGREE therefore name a problem with the shared stamp and never two processes holding different clocks: a replica that cannot read the stamp answers stale with a null last_clean_read_at, while a replica whose own pass read the rail cleanly still answers from what it knows when the stamp was never recorded at all. freshness.observed_replica is the opaque tag of the ONE PROCESS that answered this request, kept because the rows and the census are still read through one process's connections. It is never a hostname and never a pod name.

        It answers from the LOCAL BOOK and never reaches the Dataprev rail, so it cannot answer 501 and it is served on a deployment with no reconciliation composed at all - that deployment answers 200 with an empty book, an empty scope census and state never.

        scopes censuses the OPEN promises by employer. Every employer of the tenant is reconciled, so in_scope is always true.

        scopes IS ANSWERED ON THE FIRST PAGE ONLY and is null on every page requested with a non-blank after. A blank or whitespace-only after is a first-page request and is censused like an omitted one. The census is unfiltered and unpaged by design, so it describes the whole book rather than the page and is asked once per scan. Read it from the first page. null means it was not asked on this page; an empty list is the different, stated fact that no employer scope holds an open promise. freshness, by contrast, travels on every page.

        There is deliberately NO time window. The rail's own reads carry one because the rail demands it; imposing one here would hide exactly the old promise nobody ever closed, which is what this board exists to show.

        Paging is keyset over (due_at nulls last, competencia, numero_contrato, an internal row id), the order the D+2 alarm walks up to its last column, so the board and the alarm can never disagree about which deadline is next. Send the previous page's page.next_after as after; it is opaque and carries no employer document. has_more is true exactly when another page exists, and next_after is null exactly when it is false. The cursor has no time limit, but a cursor this service did not mint, including one minted by an earlier version of this order, is refused with 422 rather than silently restarting the scan from the top: start again from the first page.

        situation may be repeated to narrow the page to several situations at once (situation=open&situation=overdue). Omitting it means ALL FOUR, never none. overdue is judged where the D+2 alarm judges it: at the last clean read, never later than now, so a deadline no clean read has reached yet is still open, and with no clean read known nothing is overdue. undated is a promise whose deadline was not computable, which is a durable STATE and not missing data: nothing ever back-fills it, so it can never become overdue.
      operationId: listConsignadoRepasseExpectations
      parameters:
        - description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all four.
          explode: true
          in: query
          name: situation
          schema:
            description: Narrows the page to the named situations. Repeat the parameter for several. Omitted means all four.
            items:
              enum:
                - open
                - overdue
                - undated
                - settled
              type: string
            type: array
        - description: The previous page's page.next_after. Omitted starts at the oldest deadline. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the oldest deadline. A cursor this service did not mint is refused, never restarted from the top.
            type: string
        - description: Maximum number of expectations to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of expectations to return. Omitted means the ceiling of 200.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RepasseExpectationsPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List the repasse transfers the rail still owes this tenant
      tags:
        - Consignado Repasse Board
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-repasse-expectations
  /v1/consignado/reconciliation/repasses:
    get:
      description: "Reads the rail's consultar-repasse-pagamentos (Manual 005 v1.13 §3.4): the per-registro CEF D+2 transfers included in the inclusion window, each with its own competência, guia and transfer instant. The existence of a registro IS the liquidation — the rail publishes no status field. Same mandatory 30-day-capped window as escriturações, and the same no-write discipline: the job's done-keys are untouched."
      operationId: listConsignadoRepasses
      parameters:
        - description: Inclusion window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 005 v1.13 §3.3.1 p.20 / §3.4.1 p.26).
          explode: false
          in: query
          name: data_hora_inicio
          required: true
          schema:
            description: Inclusion window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 005 v1.13 §3.3.1 p.20 / §3.4.1 p.26).
            examples:
              - "2026-07-01T00:00:00Z"
            format: date-time
            type: string
        - description: Inclusion window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). The span must not exceed 30 days — the rail answers code GR above that (Manual 005 v1.13 §4.1 p.29), and this gateway refuses 422 locally so the attempt costs no rail quota.
          explode: false
          in: query
          name: data_hora_fim
          required: true
          schema:
            description: Inclusion window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). The span must not exceed 30 days — the rail answers code GR above that (Manual 005 v1.13 §4.1 p.29), and this gateway refuses 422 locally so the attempt costs no rail quota.
            examples:
              - "2026-07-30T00:00:00Z"
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataprevRepasseResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read the CEF D+2 repasse transfers included in a window
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-repasses
  /v1/consignado/saldo-devedor:
    get:
      description: |-
        Walks the tenant's saldo devedor obligation book, lowest contract number first: what each averbado contract still owes, as this gateway itself reports it to the payroll rail under M015.

        'valor_saldo_devedor' is DERIVED on every read and never stored: the present value, at today's Brasília date, of every instalment still ahead whose competência has not amortized (an antecipação need not be the next one), discounted at the contract's own monthly rate as valor_parcela / (1 + taxa_mensal)^(days/30) and assuming on-time payment. It is published BESIDE 'valor_parcela', 'numero_parcelas', 'parcelas_pagas', 'taxa_mensal' and 'data_primeiro_desconto' precisely so a client can redo the discounting and see the same figure the rail is given on a send that day. 'valor_parcela' is republished byte for byte as the schedule stores it and is never re-scaled, because a reformatted number would make the screen and the rail report two spellings of one amount.

        'quitado' is likewise derived: every instalment amortized (parcelas_pagas >= numero_parcelas), or an accepted refinanciamento or origin-side portability exclusion that no reversal undid settled the contract, or the M005 follow-up observed its exclusion by refinanciamento or portabilidade at Dataprev, and the rail then gets one final 0.00. It is not a stored flag, because two owners of that fact would disagree.

        'vigente' is derived by the predicate the M015 clock reads: false once the contract left the registry (a confirmed or portability exclusion, a refinanciamento or renegociação that replaced it and no reversal undid, a reversed refinanciamento of its own, an exit the M005 follow-up observed, or a termination the Manual 006 report listed). This gateway then stops reporting it, so 'valor_saldo_devedor' is no longer the figure the rail is given.

        Filter with 'quitado=true' for the settled obligations or 'quitado=false' for the ones not settled, vigente or not: read 'vigente' to tell an open obligation from a contract that left. OMITTING the parameter is the whole book, which is what an operator arriving with no filter is asking for, and it is the only way to see a settled obligation at all: the table's own index deliberately excludes them, and they are exactly the rows a client reconciling a finished contract comes to check.

        'proximo_marco' is always null. 'ultimo_envio_at' is null until this gateway has reported the obligation at least once, and it travels as null rather than as the zero instant.

        The worker's CPF is deliberately absent from every row. It is on the table only because M015 resends it on each report, and this screen answers its question without it.

        Paging is keyset over the contract number, which is half the table's own primary key, so the page costs an index walk and no sort. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false, so a client loop may terminate on either. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the walk from the top.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501 and it is served on a deployment with the rail off entirely. The tenant is derived from the validated identity and is never read from the request.
      operationId: listConsignadoSaldoDevedorObrigacoes
      parameters:
        - description: Narrows the page to settled obligations (true) or to the ones not settled (false), vigente or not. Omitted means the whole book, which is never the same as either half.
          explode: false
          in: query
          name: quitado
          schema:
            description: Narrows the page to settled obligations (true) or to the ones not settled (false), vigente or not. Omitted means the whole book, which is never the same as either half.
            enum:
              - "true"
              - "false"
            examples:
              - "false"
            type: string
        - description: The previous page's page.next_after. Omitted starts at the lowest contract number. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the lowest contract number. A cursor this service did not mint is refused, never restarted from the top.
            examples:
              - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOToxMjozM1oiLCJrIjpbImMwMDEyIl19
            type: string
        - description: Maximum number of obligations to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of obligations to return. Omitted means the ceiling of 200.
            examples:
              - 50
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SaldoDevedorPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List what each averbado contract of this tenant still owes
      tags:
        - Consignado Saldo Devedor
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-saldo-devedor-obrigacoes
  /v1/consignado/throughput:
    get:
      description: Returns the tenant's own outbound Dataprev rail rate in requests per second, together with the rail's code-locked ceiling and the starter floor, so no consumer restates either number from its own bundle. A tenant that has never chosen a rate is reported at the starter floor with configured=false; the read never opens a chain. A rate of zero is a deliberate self-service pause, never an absent value.
      operationId: getConsignadoThroughput
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ThroughputResponse"
          description: OK
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Get this tenant's outbound Dataprev rail throughput
      tags:
        - Consignado Throughput
      x-mint:
        href: /pt/reference/rails/consignado/get-consignado-throughput
    put:
      description: Sets the tenant's own outbound Dataprev rail rate, within the rail's 0..25 contract. A value outside that range is refused naming the rejected value; zero is accepted and pauses this tenant's outbound rail. Setting the value the tenant already holds succeeds without recording a transition. The change is durable and published as one fact; the serving replica applies it on its very next exchange, and every other replica converges within the pace cache TTL.
      operationId: putConsignadoThroughput
      parameters:
        - description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the chain records one transition; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
          in: header
          name: X-Idempotency
          schema:
            description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the chain records one transition; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PutThroughputRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ThroughputResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Set this tenant's outbound Dataprev rail throughput
      tags:
        - Consignado Throughput
      x-mint:
        href: /pt/reference/rails/consignado/put-consignado-throughput
  /v1/consignado/throughput/history:
    get:
      description: |-
        Walks this tenant's append-only outbound-rail throughput chain, newest transition first: every rate the tenant has held, when it changed, and who changed it.

        It is the SIBLING of GET /v1/consignado/throughput and never a replacement for it: that read answers what the tenant is paced at right now, and this one answers how it got there.

        'sequence' is the chain's own authority on order and is the ONLY column this read sorts by. 'changed_at' is reported and never ordered by, because a wall clock stamped by whichever replica served the change would let two links swap places under clock skew.

        'previous_requests_per_second' is null on sequence 1 and on no other link. A stored ZERO is a real predecessor and means the tenant was coming off a pause, so absent and zero never share a spelling here.

        'requests_per_second' of zero is a deliberate self-service pause, not an absent value. 'changed_by' names the actor: the gateway's own reserved system actor marks the automatic first grant, which is how a rate somebody chose is told apart from the floor the gateway opened the chain at.

        The rows are reported AS STORED, and this read asserts nothing about the sequence advancing by exactly one. The plus-one step lives in the write path under an advisory lock and the table enforces only uniqueness and the first-link rule, so a reader that refused a jump would be claiming a guarantee nothing makes. A consumer that cares about continuity verifies what it received.

        A tenant that never changed its rate reads as an EMPTY page and never as a not-found: never having changed the rate is an ordinary state.

        There is deliberately no time window. A window would hide exactly the old transition an operator is looking for when they ask why a client is paced the way it is.

        Paging is keyset over the sequence. Send the previous page's page.next_after as after. has_more is true exactly when another page exists, and next_after is null exactly when it is false, so a client loop may terminate on either. The cursor never expires; a cursor this service did not mint is refused with 422 rather than silently restarting the walk from the head.

        It answers from a LOCAL table and never reaches the Dataprev rail, so it cannot answer 501. The tenant is derived from the validated identity and is never read from the request.
      operationId: listConsignadoThroughputHistory
      parameters:
        - description: The previous page's page.next_after. Omitted starts at the head of the chain, the rate the tenant holds right now. A cursor this service did not mint is refused, never restarted from the top.
          explode: false
          in: query
          name: after
          schema:
            description: The previous page's page.next_after. Omitted starts at the head of the chain, the rate the tenant holds right now. A cursor this service did not mint is refused, never restarted from the top.
            examples:
              - eyJ2IjoxLCJyIjoiYm9hcmQiLCJ0IjoiMjAyNi0wOC0xNFQwOToxMjozM1oiLCJrIjpbImMwMDEyIl19
            type: string
        - description: Maximum number of transitions to return. Omitted means the ceiling of 200.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum number of transitions to return. Omitted means the ceiling of 200.
            examples:
              - 50
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ThroughputHistoryPage"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "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
      security:
        - BearerAuth: []
      summary: List this tenant's outbound Dataprev rail throughput transitions
      tags:
        - Consignado Throughput
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-throughput-history
  /v1/consignado/trabalhadores/vinculos-novos:
    get:
      description: "Reads the rail's consultar-vinculos-novos-trabalhador (Manual 006 v1.12 §2.2): the support read for the §2.3 renegociação, listing workers who now hold a new employment bond after a contract closed by employment-link termination. The window is mandatory and capped at 30 days by the rail (code GR); this gateway refuses a wider window locally."
      operationId: listConsignadoVinculosNovos
      parameters:
        - description: Inclusion window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 006 v1.12 §2.2.2 p.14).
          explode: false
          in: query
          name: data_hora_inicio
          required: true
          schema:
            description: Inclusion window start, RFC 3339 (rail dataHoraInicio, Obrigatório Sim — Manual 006 v1.12 §2.2.2 p.14).
            examples:
              - "2026-07-01T00:00:00Z"
            format: date-time
            type: string
        - description: Inclusion window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). The span must not exceed 30 days — the rail answers code GR above that (Manual 006 v1.12 §2.2.1 p.14), and this gateway refuses 422 locally so the attempt costs no rail quota.
          explode: false
          in: query
          name: data_hora_fim
          required: true
          schema:
            description: Inclusion window end, RFC 3339 (rail dataHoraFim, Obrigatório Sim). The span must not exceed 30 days — the rail answers code GR above that (Manual 006 v1.12 §2.2.1 p.14), and this gateway refuses 422 locally so the attempt costs no rail quota.
            examples:
              - "2026-07-30T00:00:00Z"
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListVinculosNovosResponse"
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Read workers with a new employment bond after a termination-closed contract
      tags:
        - Consignado Rail
      x-mint:
        href: /pt/reference/rails/consignado/list-consignado-vinculos-novos
  /v1/consignado/workers/margin:
    post:
      description: |-
        Opens or reuses the worker's authorization and reads available payroll margin — the rail's autorizar-consulta-dados-trabalhador (Manual 002 v1.15 §3.1) and consultar-dados-trabalhador (Manual 002 v1.15 §3.3) behind ONE operation, because the adapter performs them as one. POST, not GET: it opens a consent, and the consent evidence plus the CPF must travel in a body rather than in a path or query string. The worker's authorization token is NEVER returned. A consignado.margin.fetched fact is emitted on this path exactly as on the lender event path, so a client integrating by API keeps its other consumers fed.

        CONSENT WINDOW (Manual 002 v1.15 §5.6). dataHoraAutorizacaoDigital starts two clocks, measured in calendar days from the worker's signature: the authorization may be CONSULTED for 30 days, and a request may be MADE against it for 45. Both boundaries are INCLUSIVE — the instant exactly 30 or 45 days after the signature is still inside its window, and only the next nanosecond is outside.

        Outside either window the gateway refuses LOCALLY, before a byte reaches the rail: 422 with code CLT-0006 and a detail telling you to obtain a fresh worker authorization. THAT REFUSAL IS NOT RETRYABLE. Repeating the request performs the very read the lapsed authorization withdrew; only new authorization evidence makes it succeed. A dataHoraAutorizacaoDigital carrying a non-UTC offset, or dated ahead of the gateway's clock, is the same 422 with a different detail — correct the timestamp; the worker's consent is not in question.

        Contrast the rail's OWN consent rejection (Dataprev EX/IV on a stale tokenAutorizacao): that is 503 and IS retryable, because the gateway drops the cached token and the next attempt opens a fresh consent from the same evidence.
      operationId: fetchConsignadoWorkerMargin
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MarginRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MarginResponse"
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Fetch a worker's available consignable margin
      tags:
        - Consignado Rail Commands
      x-mint:
        href: /pt/reference/rails/consignado/fetch-consignado-worker-margin
  /v1/credentials/dataprev:
    delete:
      description: Durably revokes the tenant's Dataprev certificate and OAuth credentials. Subsequent rail calls fail closed and never use static fallback credentials.
      operationId: revokeDataprevCredentials
      responses:
        "204":
          description: No Content
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Revoke the Dataprev credentials
      tags:
        - Credentials
      x-mint:
        href: /pt/reference/rails/consignado/revoke-credentials
    get:
      description: "Returns the non-secret status of the tenant's stored Dataprev credentials (cert presence + fingerprint + expiry, oauth presence) together with the two public values stored verbatim: the codigoSolicitante and the worker portal base URL. When nothing is stored it returns 200 with both presence flags false, NOT 404, and each verbatim value is absent rather than empty. NEVER returns secret material."
      operationId: getDataprevCredentialStatus
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CredentialStatusResponse"
          description: OK
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Get the Dataprev credential status
      tags:
        - Credentials
      x-mint:
        href: /pt/reference/rails/consignado/get-credential-status
    put:
      description: "Stores the tenant's ICP-Brasil A1 certificate (PEM cert+key) and OAuth2 client_credentials secret together, in one audited transaction, at new secret references. It is the only write a revoked custody accepts: it closes the revocation and opens a new custody generation, and the revoked material is never used again. A body that carries the revoked certificate is refused with 409 DATAPREV_CREDENTIAL_REVOKED; the gateway keeps no non-secret record of the revoked OAuth client to compare, so supplying a new one is the caller's duty. On a custody that was not revoked it replaces both at once. The response NEVER carries secret material."
      operationId: putDataprevCredentials
      parameters:
        - description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the custody is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent.
          in: header
          name: X-Idempotency
          schema:
            description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the custody is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PutCustodyRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CredentialStatusResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Upload a complete Dataprev custody
      tags:
        - Credentials
      x-mint:
        href: /pt/reference/rails/consignado/put-dataprev-credentials
  /v1/credentials/dataprev/certificate:
    put:
      description: Stores (or rotates) the tenant's ICP-Brasil A1 client certificate (PEM cert+key) for the Dataprev rail in the tenant secret store and upserts non-secret metadata. The certificate is validated before storage. The response NEVER carries secret material.
      operationId: putDataprevCertificate
      parameters:
        - description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the certificate is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
          in: header
          name: X-Idempotency
          schema:
            description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the certificate is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PutCertificateRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CredentialStatusResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Upload or rotate the Dataprev client certificate
      tags:
        - Credentials
      x-mint:
        href: /pt/reference/rails/consignado/put-certificate
  /v1/credentials/dataprev/codigo-solicitante:
    put:
      description: Stores (or corrects) the tenant's Dataprev codigoSolicitante — the institution's BACEN COMPE code, a 3-digit number (Numero 3 algarismos) in the range 001-999, required (Obrigatorio Sim) on nearly every rail operation. A COMPE code of 55 is published as 055; 000 is refused. It is PUBLIC, non-secret metadata held in Postgres beside the credential metadata; it is never written to the tenant secret store.
      operationId: putDataprevCodigoSolicitante
      parameters:
        - description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the code is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
          in: header
          name: X-Idempotency
          schema:
            description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the code is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PutCodigoSolicitanteRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CredentialStatusResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Set the tenant's Dataprev codigoSolicitante
      tags:
        - Credentials
      x-mint:
        href: /pt/reference/rails/consignado/put-codigo-solicitante
  /v1/credentials/dataprev/oauth:
    put:
      description: Stores (or rotates) the tenant's OAuth2 client_credentials secret for the Dataprev token endpoint in the tenant secret store and flips the oauth-present flag. The response NEVER echoes the client secret.
      operationId: putDataprevOAuth
      parameters:
        - description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the OAuth material is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
          in: header
          name: X-Idempotency
          schema:
            description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the OAuth material is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PutOAuthRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CredentialStatusResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Upload or rotate the Dataprev OAuth2 credentials
      tags:
        - Credentials
      x-mint:
        href: /pt/reference/rails/consignado/put-oauth
  /v1/credentials/dataprev/portal-base-url:
    put:
      operationId: putDataprevPortalBaseURL
      parameters:
        - description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the URL is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
          in: header
          name: X-Idempotency
          schema:
            description: Optional idempotency key. Sent again with the SAME body, the stored response is replayed and the URL is stored once; sent again with a DIFFERENT body, the request is refused with 422 because the key was already spent on another intent. Absent, the request executes once, exactly as it always has.
            examples:
              - idem-1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PutPortalBaseURLRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PutPortalBaseURLRequest"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Set the tenant worker portal base URL
      tags:
        - Credentials
      description: Stores or updates the authenticated tenant's worker portal base URL. The URL must use HTTPS, contain no credentials or fragment, and be at most 255 characters. The response returns the stored configuration. Registering a portal is optional. When the tenant has one, the gateway injects it as the type 0 contact of every bid proposal that carries no portalBaseUrl of its own and names no originador with a registered portal. When no portal resolves for a bid, the bid travels with the client's own contacts alone and must carry at least one contact of type 1 through 4.
      x-mint:
        href: /pt/reference/rails/consignado/put-portal-base-url
  /v1/subscriptions:
    get:
      description: Returns the tenant's streaming-hub subscriptions (keyset-paginated). Tenant scope is derived from the validated identity; it is never taken from the request.
      operationId: listSubscriptions
      parameters:
        - description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
          in: header
          name: Authorization
          schema:
            description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
            type: string
        - description: Keyset pagination cursor (the previous page's next_cursor).
          explode: false
          in: query
          name: cursor
          schema:
            description: Keyset pagination cursor (the previous page's next_cursor).
            type: string
        - description: Maximum subscriptions to return.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum subscriptions to return.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: List the tenant's hub subscriptions
      tags:
        - Subscriptions
      x-mint:
        href: /pt/reference/rails/consignado/list-subscriptions
    post:
      description: Creates a streaming-hub subscription for the tenant and returns the once-shown signing secret. The secret is shown exactly once and is never re-fetchable; the console never stores it.
      operationId: createSubscription
      parameters:
        - description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
          in: header
          name: Authorization
          schema:
            description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
            type: string
        - description: Idempotency key, forwarded to the hub's idempotency middleware, which refuses this mutation without one.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Idempotency key, forwarded to the hub's idempotency middleware, which refuses this mutation without one.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateResponse"
          description: Created
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Create a hub subscription
      tags:
        - Subscriptions
      x-mint:
        href: /pt/reference/rails/consignado/create-subscription
  /v1/subscriptions/{id}:
    delete:
      description: "Soft-deletes the tenant's subscription. Idempotent: revoking an already-revoked subscription succeeds."
      operationId: revokeSubscription
      parameters:
        - description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
          in: header
          name: Authorization
          schema:
            description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
            type: string
        - description: Idempotency key, forwarded to the hub's idempotency middleware, which refuses this mutation without one.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Idempotency key, forwarded to the hub's idempotency middleware, which refuses this mutation without one.
            type: string
        - description: Subscription id.
          in: path
          name: id
          required: true
          schema:
            description: Subscription id.
            type: string
      responses:
        "204":
          description: No Content
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Revoke a hub subscription
      tags:
        - Subscriptions
      x-mint:
        href: /pt/reference/rails/consignado/revoke-subscription
    get:
      description: Returns a single tenant subscription. NEVER returns the signing secret (only create/rotate reveal it, once).
      operationId: getSubscription
      parameters:
        - description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
          in: header
          name: Authorization
          schema:
            description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
            type: string
        - description: Subscription id.
          in: path
          name: id
          required: true
          schema:
            description: Subscription id.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Get a hub subscription
      tags:
        - Subscriptions
      x-mint:
        href: /pt/reference/rails/consignado/get-subscription
  /v1/subscriptions/{id}/endpoint:
    get:
      description: |-
        Returns one subscription's FULL delivery destination, unmasked: the webhook URL with its path and query, the queue URL with its account id, the exchange/routing-key pair, the bus name, or the synthesized pull:// URL.

        ADMIN ONLY. Every other read on this surface answers with 'endpoint_display', the show-safe rendering of the destination. This route is the one that does not, and the reason it is fenced is that a destination is a CAPABILITY, not a description of one: a webhook path routinely carries a per-subscription callback token, and anyone holding the full value can be delivered to. The operator and viewer roles are refused here by this gateway's own authorization chain, before the request reaches the hub.

        The body carries EXACTLY ONE key. No secret, no credential status, no other column of the row: this route answers a single question, and a body that grew the row's other fields would put them behind the admin action as a side effect of nobody deciding to.

        The 200 carries 'Cache-Control: private, no-store'. The body is a live delivery capability rather than a view of one, so it must not reach a browser's disk cache, a synced profile or a forward proxy, where it would outlive the session entitled to it.

        This is a FORWARD, not a local read: the gateway owns no subscription storage. The hub answers an unknown subscription, a soft-deleted one and another tenant's with the SAME 404, publishing no existence oracle, and that 404 reaches the caller unchanged. That uniformity matters more here than anywhere else on the surface: this route is reached with a strictly stronger grant, so a refusal that read differently would let an administrator of one tenant confirm that an id belongs to another.

        The tenant is derived from the validated identity and is never read from the request.
      operationId: revealSubscriptionEndpoint
      parameters:
        - description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
          in: header
          name: Authorization
          schema:
            description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
            examples:
              - Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJvcHMifQ.signature
            type: string
        - description: Subscription id.
          in: path
          name: id
          required: true
          schema:
            description: Subscription id.
            examples:
              - 0192f1a0-0000-7000-8000-0000000000ff
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EndpointResponse"
          description: OK
          headers:
            Cache-Control:
              schema:
                description: "Always \"private, no-store\": the body is the unmasked delivery destination and must not be cached."
                type: string
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Reveal a subscription's full destination (admin only)
      tags:
        - Subscriptions
      x-mint:
        href: /pt/reference/rails/consignado/reveal-subscription-endpoint
  /v1/subscriptions/{id}/health:
    get:
      description: |-
        Rolls one subscription's delivery record into a single non-secret view: outcome counts over the hub's window and over the last 24 hours, dead-lettered and poison-event counts, the auto-disable verdict, the success rate and the consumer lag.

        It answers the question none of the other subscription reads can: whether the events this tenant subscribed to are ACTUALLY ARRIVING. Listing a subscription proves it is registered and enabled; only this shows whether the endpoint behind it has been accepting deliveries.

        'auto_disabled' and 'success_rate' are NULLABLE and null is not the zero value of either. A null 'auto_disabled' means the hub holds no endpoint-health row yet, which is not the same fact as false ("checked, and healthy"). A null 'success_rate' means no delivery attempt has reached a terminal outcome yet, which is not the same fact as 0.0 ("every attempt failed"). A client that reads either null as its zero value reports a healthy endpoint as broken, or a broken one as fine.

        'disabled_reason', 'last_success_at' and 'last_failure_at' are null when there is nothing to report, and the key is always present.

        'status' and 'verification_state' are FREE strings carried through from the hub, not a closed vocabulary this gateway pins. The hub may add a value, and a client should render an unrecognized one by its identifier rather than refuse the response.

        This is a FORWARD, not a local read: the gateway owns no subscription storage. The hub answers an unknown subscription and another tenant's subscription with the SAME 404, publishing no existence oracle, and that 404 reaches the caller unchanged. This gateway does not reinterpret it, because splitting it into "no such subscription" and "not yours" would state something the hub deliberately refused to state.

        The tenant is derived from the validated identity and is never read from the request.
      operationId: getSubscriptionHealth
      parameters:
        - description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
          in: header
          name: Authorization
          schema:
            description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
            examples:
              - Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJvcHMifQ.signature
            type: string
        - description: Subscription id.
          in: path
          name: id
          required: true
          schema:
            description: Subscription id.
            examples:
              - 0192f1a0-0000-7000-8000-0000000000ff
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionHealth"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Get a subscription's delivery health
      tags:
        - Subscriptions
      x-mint:
        href: /pt/reference/rails/consignado/get-subscription-health
  /v1/subscriptions/{id}/rotate:
    post:
      description: Rotates the subscription's signing secret and returns the new once-shown secret plus the overlap window during which the previous secret still verifies. The console never stores the secret.
      operationId: rotateSubscriptionSecret
      parameters:
        - description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
          in: header
          name: Authorization
          schema:
            description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
            type: string
        - description: Idempotency key, forwarded to the hub's idempotency middleware, which refuses this mutation without one.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Idempotency key, forwarded to the hub's idempotency middleware, which refuses this mutation without one.
            type: string
        - description: Subscription id.
          in: path
          name: id
          required: true
          schema:
            description: Subscription id.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RotateResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Rotate a subscription signing secret
      tags:
        - Subscriptions
      x-mint:
        href: /pt/reference/rails/consignado/rotate-subscription-secret
  /v1/subscriptions/{id}/test-delivery:
    post:
      description: Sends a synchronous signed test delivery to the subscription's endpoint via the hub's production delivery path and returns the outcome and sink status.
      operationId: testSubscriptionDelivery
      parameters:
        - description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
          in: header
          name: Authorization
          schema:
            description: Bearer token. A tenant route relays it to the streaming-hub as server-to-server auth.
            type: string
        - description: Idempotency key, forwarded to the hub's idempotency middleware.
          in: header
          name: X-Idempotency
          schema:
            description: Idempotency key, forwarded to the hub's idempotency middleware.
            type: string
        - description: Subscription id.
          in: path
          name: id
          required: true
          schema:
            description: Subscription id.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PingResponse"
          description: OK
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security:
        - BearerAuth: []
      summary: Send a synchronous test delivery
      tags:
        - Subscriptions
      x-mint:
        href: /pt/reference/rails/consignado/test-subscription-delivery
security:
  - BearerAuth: []
servers:
  - url: https://br-consignado-gw.sandbox.lerian.net
tags:
  - description: Per-tenant Dataprev credential custody and public rail configuration (upload, status, rotation, revoke, requester code, and worker portal base URL)
    name: Credentials
  - description: Per-tenant streaming-hub subscription control-plane (list, create, get, rotate, revoke, and test delivery)
    name: Subscriptions
  - description: "Dataprev payroll-rail surface: FGTS balance and authorization reads, the FGTS guarantee execution, contract suspension, reactivation and term changes, the rail's own contract documents, and the on-demand reads of leilão solicitações, escriturações, repasses and employment terminations"
    name: Consignado Rail
  - description: "Synchronous rail command surface: the operations a bancarizador without the lender drives over HTTP."
    name: Consignado Rail Commands
  - description: "Gateway-owned disbursement confirmation: a client bank recording money it has ALREADY paid to a worker. It crosses no government boundary and proxies no Dataprev operation."
    name: Consignado Disbursement
  - description: "Per-tenant self-service outbound Dataprev rail throughput: read and set this tenant's own requests-per-second, including a deliberate pause at zero"
    name: Consignado Throughput
  - description: "The B3 instrument code (Código IF) of an averbado contract: informed once by the bancarizador after B3 registers the CCB, and read back"
    name: Consignado Registro B3
