# Review and apply accounting hold rules

Preview deal hold/release and clawback decisions from current evidence. Apply only a reviewed token with an explicit reason; save_defaults requires administrator access. Requires books write access even for previews.

Access class: `workspace:books`.

## Endpoint

`POST /v1/accounting/hold-clawback-rules/run`

## Request body

Content type: `application/json`.

```json
{
  "action": "string",
  "afterId": 1,
  "allDue": true,
  "dealId": 1.5,
  "expected": {},
  "limit": 1,
  "reason": "string",
  "rules": {
    "clawbackBasis": "string",
    "clawbackSharePpm": 1,
    "holdDays": 1,
    "releaseAfterDays": 1,
    "releaseAfterPayments": 1
  }
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "applied": true,
    "decisions": [
      {
        "afterClawbackMinor": 1.5,
        "afterState": "string",
        "beforeClawbackMinor": 1.5,
        "beforeState": "string",
        "currency": "string",
        "dealId": 1.5,
        "defaultAmountMinor": 1.5,
        "defaultedOn": "string",
        "reasons": [
          "string"
        ],
        "reference": "string",
        "releaseEligible": true,
        "releaseOn": "string",
        "rules": {
          "clawbackBasis": "string",
          "clawbackSharePpm": 1.5,
          "holdDays": 1.5,
          "releaseAfterDays": 1.5,
          "releaseAfterPayments": 1.5
        },
        "successfulPayments": 1.5,
        "token": "string"
      }
    ],
    "nextAfterId": 1
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
