# How long is an Idempotency-Key kept?

> An Idempotency-Key is kept for at least 24 hours. What a repeat returns in that time, what the key is scoped to, and when the key is released early.

Source: https://esigncomply.com/docs/kb/how-long-is-an-idempotency-key-kept

Last updated November 25, 2026

An Idempotency-Key is kept for at least 24 hours. During that time Esign Comply answers a repeat of the same `POST` with the original response and creates nothing twice. A daily job deletes keys that are more than 24 hours old. A key belongs to one domain, one environment and one path, and holds up to 255 characters.

## What happens when I send the same Idempotency-Key again?

| Case | Result |
|---|---|
| Same key, same path, same body byte for byte | The original response again, with the header `Idempotent-Replayed: true` |
| Same key, same path, different body | `409` [`idempotency_conflict`](https://esigncomply.com/docs/api/errors.md#idempotency_conflict) |
| Same key while the first request is still running | `409` `idempotency_conflict` with `Retry-After: 1` |
| The first request ended in an error, `4xx` or `5xx` | The key is released. Send the request again with the same key. |

Only a request that succeeded is remembered. A response that shows a secret once, such as a new API key or a webhook secret, is never stored for replay.

## What is an Idempotency-Key scoped to?

The domain, the environment (test or live), the HTTP method and the exact path. The same string on another path is a different key, so `POST /v1/sessions` and the completion of one session never collide. Only `POST` requests sent with a secret key or a client token read the header.

## Which value do I use for an Idempotency-Key?

Build it from your own stable identifiers for the business action, not from a timestamp:

```bash
curl https://esigncomply.com/v1/sessions \
  -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: signup-user_7c1d-1" \
  -d '{
    "profile": "prof_signup_4f1a",
    "signer": { "external_id": "user_7c1d" },
    "documents": [{ "document": "doc_8Hq2", "version": "current" }],
    "context": { "url": "http://localhost:3000/signup" }
  }'
```

Change the key when you mean a new action. A new session after the first one expired needs a new key: the old key replays the response that holds the expired session.

## When can I reuse an Idempotency-Key for a new request?

After the daily job has deleted it. The job runs once a day and removes every key that is more than 24 hours old, so a key is free again between 24 and 48 hours after its first use. Until then, the same key with a different body returns `idempotency_conflict`.

## Related

- [API conventions: idempotency](https://esigncomply.com/docs/api.md#idempotency)
- [Node SDK: request options](https://esigncomply.com/docs/sdk/node.md#request-options)
- [How long does a session last?](https://esigncomply.com/docs/kb/how-long-does-a-session-last.md)
- [Are webhooks retried?](https://esigncomply.com/docs/kb/are-webhooks-retried.md)
