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

# Assess resilience & idempotency

> Idempotency keys, maintenance mode, timeouts, and correlation fields for production assess.

Production integrations should treat assess as a **critical path** with explicit retry and deduplication behavior.

## Discover capabilities

```bash theme={null}
curl -s "$CLAUSUM_API_BASE/api/v1/assess" \
  -H "Authorization: Bearer $CLAUSUM_SECRET_KEY" | jq '.version, .resilience'
```

Current API version: **1.3.0**.

## Idempotency

Send **`Idempotency-Key`** (header) or body fields `idempotency_key` / stable `order_id` + `payment_id` on retries.

* Replays with the same key return the **same decision** without double-counting velocity.
* Response may include correlation fields: `order_id`, `payment_id`, `idempotency_key`.

```bash theme={null}
curl -X POST "$CLAUSUM_API_BASE/api/v1/assess" \
  -H "Authorization: Bearer $CLAUSUM_SECRET_KEY" \
  -H "Idempotency-Key: ord-9912-attempt-1" \
  -H "Content-Type: application/json" \
  -d '{"amount":4500,"currency":"USD","email":"a@b.c","order_id":"ORD-9912"}'
```

## HTTP status codes

| Code  | Meaning                            | Suggested client behavior          |
| ----- | ---------------------------------- | ---------------------------------- |
| `200` | Assessment completed               | Enforce `decision`                 |
| `400` | Validation error                   | Fix payload                        |
| `401` | Invalid or missing API key         | Rotate / fix auth                  |
| `429` | Rate limited                       | Backoff and retry                  |
| `503` | Maintenance (`ASSESS_MAINTENANCE`) | Fail-open or queue per your policy |
| `504` | Timeout (`ASSESS_TIMEOUT`)         | Retry with same idempotency key    |

See [Errors](/reference/errors) for structured `error.code` values.

## Fail-open vs fail-closed

| Strategy        | When                                                                  |
| --------------- | --------------------------------------------------------------------- |
| **Fail-open**   | Network/503/504 — allow checkout, log incident (common for merchants) |
| **Fail-closed** | Regulated flows — block until assess succeeds                         |

Clausum does not capture payments for you — **your backend** chooses whether to call Stripe/PSP after assess.

## Release (optional)

If your integration uses assess holds, `POST /api/v1/assess/release` clears a prior decision context when a checkout is abandoned. Contact support if you need this in your flow.

## Rate limits

Partner assess is rate-limited per API key. Production multi-node deployments require **Redis (Upstash)** — otherwise you may receive `503 RATE_LIMIT_STORE_UNAVAILABLE`. See [Rate limits](/reference/rate-limits).
