> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Averbate a portability whose origin exclusion already ran

> 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 this gateway does not yet wire. 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 response instead of being resubmitted to the rail, as on the averbação and CCB-attachment routes. This route does not yet have durable Postgres-backed replay storage, so, unlike the bid route, that guarantee does not survive a Redis eviction or restart.



## OpenAPI

````yaml en/openapi/v3-current/consignado.yaml post /v1/consignado/portabilidade/{numero_unico}/averbacao
openapi: 3.1.0
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, disbursement confirmation, portability,
    refinancing, renegotiation, FGTS guarantees, reconciliation, funds,
    assignments, usage, throughput, and event subscriptions. Secret material is
    written to the tenant secret store and is never returned by any operation.
  license:
    name: Lerian Studio General License
  title: Lerian Consignado API
  version: v1.0.0
servers:
  - url: https://consignado.sandbox.lerian.net
security:
  - BearerAuth: []
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: >-
      Tenant-scoped consignado gateway usage: priced billable-unit aggregation
      per competência
    name: Consignado Usage
  - 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. Each shares its command implementation with
      the equivalent lender event trigger.
    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
paths:
  /v1/consignado/portabilidade/{numero_unico}/averbacao:
    post:
      tags:
        - Consignado Rail Commands
      summary: Averbate a portability whose origin exclusion already ran
      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 this gateway does not yet wire. 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 response instead of being
        resubmitted to the rail, as on the averbação and CCB-attachment routes.
        This route does not yet 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
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    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 for the same reason as numeroContrato
            above.
          examples:
            - Trabalhador 99999999999
          maxLength: 100
          minLength: 1
          type: string
        numeroContrato:
          description: >-
            Contract number being averbado. Manual 008 §5.3.1 publishes 2-15
            characters; the mirrored Swagger publishes maxLength 20 for the same
            field — the wider bound is accepted here so a value the rail itself
            would honour is never rejected first.
          examples:
            - '199971600000'
          maxLength: 20
          minLength: 2
          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.
          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
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          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
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````