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

# Renegotiate a contract closed by employment-link termination

> 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 an averbação of the authenticated tenant that the rail acknowledged, 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.



## OpenAPI

````yaml en/openapi/v3-current/consignado.yaml post /v1/consignado/contracts/{numero_contrato}/renegociacao
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/contracts/{numero_contrato}/renegociacao:
    post:
      tags:
        - Consignado Rail
      summary: Renegotiate a contract closed by employment-link termination
      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 an averbação of the authenticated tenant
        that the rail acknowledged, 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.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: >-
              The NEW (renegotiated) contract number, minted by the CLIENT — the
              rail mints nothing here.
            examples:
              - Qwerty123456789
            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-renegociacao-0001
            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
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    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 an averbação
            of the authenticated tenant that the rail acknowledged, 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
    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

````