> This page is for version v2.
> For other versions, use one of these documentation indexes:
> - v1 (default): https://developers.outpave.com/v1/llms.txt
> - v2: https://developers.outpave.com/v2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.outpave.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.outpave.com/_mcp/server.

# Idempotency

Every `POST` except `/access-token` requires an `Idempotency-Key` header. Without it the request returns `400 IDEMPOTENCY_KEY_REQUIRED`.

```bash
curl -X POST "https://$API_HOST/api/v2/cards/$CARD_ID/freeze" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Account-Holder: $ACCOUNT_HOLDER_ID" \
  -H "Idempotency-Key: 5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Choosing a key

* Use a new UUID v4 for each operation.
* A key is 1 to 255 visible ASCII characters. A value in double quotes is accepted and the quotes are removed.
* Generate the key before the first attempt and store it with your own record of the operation, so every retry sends the same key.

## How retries behave

| You send                                              | You get                                                                                                                                                        |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The same key and the same request                     | The first response, with `Idempotent-Replayed: true`. Its status and body are the same, including any problem's `requestId`. The `X-Request-Id` header is new. |
| The same key while the first request is still running | `409 IDEMPOTENCY_IN_PROGRESS`. Retry later with the same key.                                                                                                  |
| The same key with a different request                 | `409 IDEMPOTENCY_KEY_REUSED`. The request is refused.                                                                                                          |
| A new key                                             | A new operation.                                                                                                                                               |

A key can be used again 30 days after its operation completes.

## Unknown outcomes

Some operations ask an external party to act. When no definite answer comes back, the API returns `502 OPERATION_OUTCOME_UNKNOWN`. Retry later with the same key. Retries return this response until the outcome is known, then the final response. Never switch to a new key for the same operation.