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

# Retract an event

> Withdraw one recorded fact, totally. The fact stays readable, contributes to nothing, and every figure derives again without it.

A retraction withdraws one recorded fact — a cancellation, an acceleration, a write-off, a rollover, a return, a cession — totally: no amount, no scope, no partial version survives. The withdrawn fact stays readable with the `retraction` block on it, and every derivation runs as if it had never been recorded. [Correcting mistakes](/lending/corrections) carries what recomputes and what cannot be retracted.

## Path parameters

<ParamField path="tenant_id" type="string" required>
  The Tenancy acting.
</ParamField>

<ParamField path="loan_id" type="string" required>
  The Loan whose fact it is.
</ParamField>

<ParamField path="event_id" type="string" required>
  The event, as the Loan's `events[]` carries it.
</ParamField>

## Body

<ParamField body="on" type="string" required>
  The day the fact was found to be an error, never defaulted.
</ParamField>

<ParamField body="reference" type="string" required>
  Your name for the retraction, in the one act namespace of the Tenancy.
</ParamField>

<ParamField body="actor" type="string" required>
  Whoever withdrew it, your own reference.
</ParamField>

<ParamField body="basis" type="string" required>
  Why, in your words.
</ParamField>

<ParamField body="context" type="object">
  Stored, echoed beside the retraction, read by nothing.
</ParamField>

## Response

`201` with [the whole Loan](/api-reference/loans/read) as it now derives: the state its remaining facts produce, and the withdrawn event carrying `retraction` — `on`, `recorded_at`, and the withdrawing act's own account. Retry `200`; a differing body under the recorded `reference`, `409` `reference_reused`.

## Refusals

| Condition | Status and code | The instrument instead |
| - | - | - |
| The event is the issuance | <Badge color="orange">422</Badge> `not_retractable` | [A cancellation](/api-reference/loans/cancellation), which records that the disbursement never happened |
| The fact is already retracted | <Badge color="red">409</Badge> `already_retracted` | Nothing — it already contributes to nothing |
| A cession stands in force and the event is not it | <Badge color="red">409</Badge> `cession_in_force` | Retract the cession first; every correction is then available again |
| The retraction states no date | <Badge color="orange">422</Badge> `invalid_event` | State the day the fact was found to be an error |

<RequestExample>
  ```bash Retract theme={null}
  BODY='{
    "on": "2026-03-05",
    "reference": "retract-0001",
    "actor": "ops-0007",
    "basis": "the cancellation was recorded on the wrong loan"
  }'

  curl -X POST "https://api.capcells.com/v1/tenants/$TENANT_ID/loans/$LOAN_ID/events/$EVENT_ID/retraction" \
    -H "Authorization: $(capcells_sign "$CAPCELLS_API_KEY" POST "/v1/tenants/$TENANT_ID/loans/$LOAN_ID/events/$EVENT_ID/retraction" "$BODY")" \
    -H "Content-Type: application/json" \
    -d "$BODY"
  ```
</RequestExample>

<ResponseExample>
  ```json 201, the withdrawn fact theme={null}
  {
    "state": "active",
    "events": [
      { "id": "a5ff8602-8b4d-4284-a666-cb32e96264c8", "kind": "issued", "occurred_on": "2026-03-02", … },
      {
        "id": "f320eedd-93ea-4db2-8292-53df58ab9473",
        "kind": "cancelled",
        "occurred_on": "2026-03-03",
        "retraction": {
          "on": "2026-03-05",
          "recorded_at": "2026-08-31T11:13:11.330357Z",
          "act": {
            "reference": "retract-0001",
            "actor": "ops-0007",
            "basis": "the cancellation was recorded on the wrong loan"
          }
        },
        "act": {
          "reference": "cancel-0001",
          "actor": "ops-0007",
          "basis": "agreed in error: wrong client selected at the desk"
        }
      }
    ],
    …
  }
  ```

  ```json 422 The issuance theme={null}
  {
    "error": "loan: that fact cannot be retracted: a5ff8602-8b4d-4284-a666-cb32e96264c8 is the issuance of c68c7355-0598-4cf4-a69a-b6b4ea10a5c4 — cancel the loan instead, which records that the disbursement never happened",
    "code": "not_retractable"
  }
  ```

  ```json 409 Already retracted theme={null}
  {
    "error": "loan: the fact is already retracted: f320eedd-93ea-4db2-8292-53df58ab9473",
    "code": "already_retracted"
  }
  ```
</ResponseExample>


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