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

# Lift a negotiated write-off's release hold

> Removes the `NEGOTIATED` hold of a write-off (queue `NEGOTIATED_HOLD`).

<Info>**Providers:** Lerian (PCR).</Info>

<Warning>**Under development.** This endpoint can change before it is released.</Warning>

**How it works**

- Send a `reason` and `evidence`. Both are required.
- It does not release the amount. The release follows the usual rule: settlement on the route and the agreement's credit date.



## OpenAPI

````yaml /pt/openapi/v3-current/payments-pcr.yaml post /v1/collections/write-offs/{write_off_id}/unhold
openapi: 3.1.0
info:
  title: Payments PCR preview
  version: 2026-11-23-preview
  description: >-
    Preview of Payments with boleto collections through Lerian (PCR), CNAB 240,
    electronic payers (DDA), bill payments, and shared administration. This
    reference includes current behavior and planned changes. Read each
    operation's provider information: some operations support BTG only today.
    The preview is under development and can change before release. Confirm
    availability with Lerian before integration.


    The webhooks section describes notices Payments sends to your callback URL.
    Verify the signature and timestamp before processing a notice. Use the
    eventId and X-Webhook-Id described by each notice to detect repeated
    delivery. Do not assume delivery order.
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security: []
tags:
  - description: >-
      Tenant-level setup: connecting the banking provider and configuring where
      status notifications are delivered.
    name: Admin
  - description: Issuing, querying and cancelling boletos, and retrieving the rendered PDF.
    name: Boletos
  - name: CNAB Agreements
    description: >-
      CNAB agreements: the link between a Lerian-provider collections agreement
      and the CNAB 240 Lerian files of one account, with its remittance and
      return sequence numbers (NSA) and its return cut times. Every operation of
      this section answers 422 PBP-0900 to a tenant without CNAB 240 enabled.
  - name: CNAB Remittances
    description: >-
      CNAB remittances: the CNAB 240 Lerian remittance files of an organization,
      each received whole, validated and stored encrypted, its title lines
      executed afterwards. A file already received is answered with its stored
      receipt; a new one answers 422 PBP-0900 to a tenant without CNAB 240
      enabled.
  - name: CNAB Returns
    description: >-
      CNAB 240 Lerian return files, one per agreement and cut, built from the
      journal of what happened to the titles that entered by remittance, and
      their download. Every operation of this section answers 422 PBP-0900 to a
      tenant without CNAB 240 enabled.
  - description: >-
      Boleto collections agreements and their reconciliation with the
      beneficiary base of the PCR: the consumption of each beneficiary inventory
      the PCR publishes and the divergences it raises, which carry only
      agreement and situation attributes, never a document or a name. Every
      operation of this section answers 422 PBP-0830 to a tenant without
      collections enabled.
    name: Collections Agreements
  - description: >-
      Boleto collections audit trail: every operation and configuration action,
      append-only, with its author, instant, reason, evidence and the module's
      fields before and after it. Every operation of this section answers 422
      PBP-0830 to a tenant without collections enabled.
    name: Collections Audit
  - description: >-
      Boleto collections beneficiaries: the enablement of the tenant's accounts
      for collections, in batches of up to 5,000 accounts, and the progress and
      per-item outcome of the enablement and bulk adoption batches. Every
      operation of this section answers 422 PBP-0830 to a tenant without
      collections enabled.
    name: Collections Beneficiaries
  - name: Collections Credit Entries
    description: >-
      Boleto collections credit entries: what the credit of each write-off moves
      in the ledger, one entry per write-off and phase, the RELEASE to the
      available balance of the title's account and the CHARGEBACK of a write-off
      cancelled after its release, with where each entry stands with the ledger
      and, when it is not posted, why, as a closed code and never the ledger's
      own text. Every operation of this section answers 422 PBP-0830 to a tenant
      without collections enabled.
  - description: >-
      Boleto collections operation queues: each case that waits for an operator
      and already has its state in collections, with its reason, since when it
      waits and the operations that act on it, read over the states collections
      keeps rather than from a list of its own. Each queue counts the items
      whose age reached its age limit, a per-tenant operational parameter. Every
      operation of this section answers 422 PBP-0830 to a tenant without
      collections enabled.
    name: Collections Operation Queues
  - description: >-
      Boleto collections commands to the PCR: each registration, change and
      write-off sent to the PCR of the institution, with the idempotency key it
      keeps across attempts, its attempts, its next attempt and the last answer
      that did not accept it, never the body sent. Every operation of this
      section answers 422 PBP-0830 to a tenant without collections enabled.
    name: Collections PCR Commands
  - description: >-
      Boleto collections notice subscription of the tenant's connection to the
      PCR: its synchronization with the PCR, the rotation of the secret the PCR
      signs the notices with, the deliveries of notices the PCR recorded for it,
      and the redelivery of a notice whose delivery failed. Every operation of
      this section answers 422 PBP-0830 to a tenant without collections enabled.
    name: Collections PCR Connection
  - description: >-
      Boleto collections notices received from the PCR: each event the PCR of
      the institution delivered to collections, stored once per connection and
      event, with where its processing stands and what it was matched with,
      never the body received. Every operation of this section answers 422
      PBP-0830 to a tenant without collections enabled.
    name: Collections PCR Notices
  - description: >-
      Boleto collections pooled accounts: the links of accounts that issue under
      the agreement of a pooled account, whose holder stays the beneficiary
      while the account's holder is the final one. A link registers nothing at
      Núclea. Every operation of this section answers 422 PBP-0830 to a tenant
      without collections enabled.
    name: Collections Pooled Accounts
  - description: >-
      Boleto collections setup: the tenant's business settings, with the default
      agreement template, the automatic enablement and the retention periods,
      and the tenant's connection to the PCR of its institution. Every operation
      of this section answers 422 PBP-0830 to a tenant without collections
      enabled.
    name: Collections Settings
  - description: >-
      Boleto collections titles: each boleto collections issues at the PCR of
      the institution, with its four state axes (registration, situation at the
      base, credit and block), never the data of a payer or of a beneficiary.
      The barcode and the digitable line are answered only while the title is
      REGISTERED. Every operation of this section answers 422 PBP-0830 to a
      tenant without collections enabled.
    name: Collections Titles
  - name: Collections Write-offs
    description: >-
      Boleto collections write-offs: each write-off of a collections title the
      PCR of the institution notified, with its route, its settlement, the state
      of its credit, its hold and its cancellation deadline, never the data of a
      payer. Every operation of this section answers 422 PBP-0830 to a tenant
      without collections enabled.
  - description: >-
      Aggregated counts, amounts and breakdowns over a period, for boletos and
      for payments.
    name: Dashboards
  - name: Electronic payers
    description: >-
      Electronic payer (DDA): adhesion of the institution's customer to
      electronic presentment of boletos, its accounts and aggregates, and the
      outcome of each request. Under development: can change before it is
      released.
  - description: >-
      The notices Payments posts to the tenant's callback URL, one per type
      enabled in enabledEvents, each signed with the configuration's secret.
      Each item describes the body, the delivery headers, when the notice is
      sent and which providers send it. The webhook is the channel of the first
      delivery: delivery will later move to Lerian's Streaming Hub, which will
      then be the only channel, with a change of subscription and a migration
      plan communicated to the client.
    name: Notices
  - description: >-
      Paying bankslips, utility bills and DARF tax slips, and querying those
      payments.
    name: Payments
  - name: Presented boletos
    description: >-
      Boletos of other institutions presented to the electronic payer: list,
      detail, acceptance and authorized third parties. Under development: can
      change before it is released.
paths:
  /v1/collections/write-offs/{write_off_id}/unhold:
    post:
      tags:
        - Collections Write-offs
      summary: Lift a negotiated write-off's release hold
      description: >-
        Removes the `NEGOTIATED` hold of a write-off (queue `NEGOTIATED_HOLD`).


        <Info>**Providers:** Lerian (PCR).</Info>


        <Warning>**Under development.** This endpoint can change before it is
        released.</Warning>


        **How it works**


        - Send a `reason` and `evidence`. Both are required.

        - It does not release the amount. The release follows the usual rule:
        settlement on the route and the agreement's credit date.
      operationId: unholdWriteOff
      parameters:
        - $ref: '#/components/parameters/WriteOffIdPath'
        - $ref: '#/components/parameters/IdempotencyKeyHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvidencedActionRequest'
      responses:
        '200':
          description: >-
            OK. The action is recorded in the audit trail. `outcome` tells
            whether the effect is applied or follows in the background.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResult'
        '400':
          description: >-
            Bad Request.


            - `PBP-0001`: a parameter, header or body is malformed.

            - `PBP-0012`: `Idempotency-Key` is missing, is not a UUID, or is the
            nil UUID.


            See the [error
            list](/pt/reference/interfaces/payments-btg/payments-error-list) for
            every code.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0001:
                  summary: 'PBP-0001: Malformed request'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0001
                    title: Bad Request
                    status: 400
                    detail: validation failed
                    code: PBP-0001
                PBP-0012:
                  summary: 'PBP-0012: Idempotency-Key missing'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0012
                    title: Idempotency Key Required
                    status: 400
                    detail: Idempotency-Key header is required and must be a UUID
                    code: PBP-0012
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0003:
                  summary: 'PBP-0003: Invalid credential'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0003
                    title: Unauthorized
                    status: 401
                    detail: authentication required
                    code: PBP-0003
          description: >-
            Unauthorized.


            - `PBP-0003`: the credential is missing or invalid, or does not
            identify a tenant. Get a valid bearer token.
        '403':
          description: >-
            Forbidden.


            - `PBP-0004`: the credential does not have the `collections`
            `operate` permission.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0004:
                  summary: 'PBP-0004: No permission'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0004
                    title: Forbidden
                    status: 403
                    detail: permission denied
                    code: PBP-0004
        '404':
          description: >-
            Not Found.


            - `PBP-0005`: the tenant has no write-off with this id. A resource
            of another tenant gets the same answer.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0005:
                  summary: 'PBP-0005: Write-off not found'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0005
                    title: Not Found
                    status: 404
                    detail: write-off not found
                    code: PBP-0005
        '409':
          description: >-
            Conflict.


            - `PBP-0007`: an earlier request under the same `Idempotency-Key` is
            still running. It answers this for at most 5 minutes. After that,
            the same key returns the stored answer, or 500 `PBP-0002` when it
            cannot be replayed, or runs the request again when no answer was
            kept. Retry under the same key after a few seconds. Do not switch
            keys: the earlier request can still take effect.

            - `PBP-0814`: a worker is processing the target right now. Retry
            later under the same `Idempotency-Key`.


            See the [error
            list](/pt/reference/interfaces/payments-btg/payments-error-list) for
            every code.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0007:
                  summary: 'PBP-0007: Same key still running'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0007
                    title: Request In Progress
                    status: 409
                    detail: >-
                      a request with this idempotency key is already being
                      processed
                    code: PBP-0007
                PBP-0814:
                  summary: 'PBP-0814: Target claimed by a worker'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0814
                    title: ITEM_CLAIMED_BY_WORKER
                    status: 409
                    detail: the target is being processed by a worker
                    code: PBP-0814
        '422':
          description: >-
            Unprocessable Entity.


            - `PBP-0006`: the body does not match the schema, for example a
            missing or short `reason`. The body needs `reason` and `evidence`.

            - `PBP-0802`: the write-off has no `NEGOTIATED` hold. The state is
            in `details.currentState`. The action may already be done.

            - `PBP-0013`: the same `Idempotency-Key` was sent with another body.
            Use a new key for a new request.

            - `PBP-0830`: the tenant does not have the collections module.
            Retrying does not change the answer.


            See the [error
            list](/pt/reference/interfaces/payments-btg/payments-error-list) for
            every code.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0006:
                  summary: 'PBP-0006: Invalid body'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0006
                    title: Unprocessable Entity
                    status: 422
                    detail: reason must have at least 10 characters
                    code: PBP-0006
                PBP-0802:
                  summary: 'PBP-0802: No NEGOTIATED hold'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0802
                    title: Action Not Allowed In State
                    status: 422
                    detail: the write-off has no NEGOTIATED hold
                    code: PBP-0802
                PBP-0013:
                  summary: 'PBP-0013: Key reused with another body'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0013
                    title: Idempotency Key Conflict
                    status: 422
                    detail: >-
                      The request body does not match the original request for
                      this idempotency key.
                    code: PBP-0013
                PBP-0830:
                  summary: 'PBP-0830: Collections not enabled'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0830
                    title: Collections Not Enabled
                    status: 422
                    detail: Collections Not Enabled
                    code: PBP-0830
        '500':
          description: >-
            Internal Server Error. The `detail` is a fixed text.


            - `PBP-0002`: an unexpected failure, or the stored answer of this
            key cannot be replayed. The earlier request may have taken effect.
            Contact support. Do not resend under a new key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0002:
                  summary: 'PBP-0002: Unexpected failure'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0002
                    title: Internal Server Error
                    status: 500
                    detail: internal error
                    code: PBP-0002
      security:
        - BearerAuth: []
components:
  parameters:
    WriteOffIdPath:
      name: write_off_id
      in: path
      required: true
      description: Identifier of the write-off in collections.
      schema:
        type: string
        format: uuid
    IdempotencyKeyHeader:
      name: Idempotency-Key
      in: header
      required: true
      description: >-
        Idempotency key of the client, a UUID. Missing or invalid: 400
        `PBP-0012`; an earlier request with the same key still running: 409
        `PBP-0007`; the same key with another body: 422 `PBP-0013`. Afterwards,
        the same key returns the stored answer.
      schema:
        type: string
        format: uuid
        examples:
          - 5f2b8a8e-3c1d-4f7a-9b2e-6d4c1a0e9f11
  schemas:
    EvidencedActionRequest:
      type: object
      description: >-
        Action with a mandatory reason and evidence (lift a hold, reverse, close
        manually).
      additionalProperties: false
      required:
        - reason
        - evidence
      properties:
        reason:
          $ref: '#/components/schemas/Reason'
        evidence:
          $ref: '#/components/schemas/Evidence'
    ActionResult:
      additionalProperties: false
      properties:
        action:
          description: What the action did.
          enum:
            - RELEASE_WRITE_OFF
            - CANCEL_SCHEDULED_RELEASE
            - UNHOLD_WRITE_OFF
            - REVERSE_WRITE_OFF
            - REPROCESS_CREDIT_ENTRY
            - REPROCESS_PCR_COMMAND
            - CLOSE_PCR_COMMAND
            - SETTLE_SUBMISSION_FAILURE
            - ASSOCIATE_PCR_NOTICE
            - DISCARD_PCR_NOTICE
            - APPLY_PCR_NOTICE
            - WRITE_OFF_LATE_REGISTRATION
            - ENABLE_ACCOUNT
            - CREATE_ENABLEMENT_BATCH
            - APPROVE_ENABLEMENT
            - REJECT_ENABLEMENT
            - DISABLE_BENEFICIARY
            - CORRECT_AGREEMENT_DIVERGENCE
            - ADOPT_AGREEMENT_DIVERGENCE
            - BULK_ADOPT_AGREEMENT_DIVERGENCES
            - CREATE_AGREEMENT
            - UPDATE_AGREEMENT
            - CLOSE_AGREEMENT
            - REPROCESS_AGREEMENT_CLOSURE
            - FORCE_CLOSE_AGREEMENT
            - LINK_POOLED_ACCOUNT
            - REMOVE_POOLED_ACCOUNT_LINK
            - PUT_PCR_CONNECTION
            - PUT_COLLECTIONS_SETTINGS
            - SYNC_PCR_SUBSCRIPTION
            - ROTATE_PCR_NOTICE_SECRET
            - REDELIVER_PCR_NOTICE
          examples:
            - REDELIVER_PCR_NOTICE
          type: string
        auditActionId:
          description: Entry created in the audit trail.
          examples:
            - 3fa85f64-5717-4562-b3fc-2c963f66afa6
          format: uuid
          type: string
        outcome:
          description: >-
            APPLIED: the local effect is written and, when there is an external
            effect, it is confirmed. ENQUEUED: the action is recorded under a
            stable key and its effect follows asynchronously, at the PCR or the
            ledger.
          enum:
            - APPLIED
            - ENQUEUED
          examples:
            - ENQUEUED
          type: string
        targetId:
          description: Identifier of the resource the action acted on.
          examples:
            - 7c9e6679-7425-40de-944b-e07fc1f90ae7
          format: uuid
          type: string
        targetState:
          description: >-
            State of the target after the action, as far as collections knows it
            when it answers.
          examples:
            - FAILED
          maxLength: 64
          type: string
        targetType:
          description: Kind of resource the action acted on.
          enum:
            - TITLE
            - WRITE_OFF
            - CREDIT_ENTRY
            - PCR_COMMAND
            - PCR_NOTICE
            - BENEFICIARY
            - ENABLEMENT_BATCH
            - AGREEMENT
            - AGREEMENT_DIVERGENCE
            - POOLED_ACCOUNT_LINK
            - PCR_CONNECTION
            - PCR_SUBSCRIPTION
            - PCR_WEBHOOK_DELIVERY
            - COLLECTIONS_SETTINGS
            - ACCOUNT
          examples:
            - PCR_WEBHOOK_DELIVERY
          type: string
      required:
        - auditActionId
        - action
        - targetType
        - targetId
        - outcome
        - targetState
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          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
    Reason:
      type: string
      description: >-
        Reason for the action, required. Text of the operator; must not carry
        personal data.
      minLength: 10
      maxLength: 500
      examples:
        - STR credit checked on the reserves account statement of 11/10.
    Evidence:
      additionalProperties: false
      properties:
        description:
          description: What the evidence shows. Holds no file and no personal data.
          examples:
            - Extrato STR com o crédito do NUOp informado.
          maxLength: 1000
          minLength: 5
          type: string
        reference:
          description: 'Where the evidence is: a document, a ticket or a statement.'
          examples:
            - CHAMADO-2026-11-0042
          maxLength: 256
          type: string
      required:
        - description
      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: 'Never returned: the service drops the rejected value.'
      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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.