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

# Idempotency

> Retry POST requests safely.

Send an `Idempotency-Key` header on `POST` requests. If the network drops after FastCAC acted but
before you got the answer, retry with the same key and you get the original response back instead
of a second registration.

```bash theme={null}
curl https://api.fastcac.com/v1/registrations \
  -H "Authorization: Bearer $FASTCAC_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1182-create" \
  -d '{"external_id": "order-1182", "proposed_names": ["Ada Foods Ventures"]}'
```

* Use a value unique to the operation: a UUID, or your own order id plus the action. Up to 255
  characters.

* A successful (`2xx`) response is kept for 24 hours. Retrying with the same key and the same
  request returns it again, with the header `Idempotent-Replayed: true`.

* The same key with a different request is a `409 idempotency_key_reused`:

  ```json theme={null}
  {
    "error": {
      "type": "idempotency_error",
      "code": "idempotency_key_reused",
      "message": "This Idempotency-Key was used for a different request.",
      "param": null,
      "request_id": "req_ePT5LinP29madPXjGae6SMNT"
    }
  }
  ```

* A retry while the first request is still running gets `409 idempotency_request_in_progress`.
  Wait a moment and retry.

* Failed requests aren't stored, so you can fix the request and reuse the key.

* Keys are separate per organization and per mode.

`GET`, `PATCH` and `DELETE` don't need a key: repeating them has the same effect as sending them
once.


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