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

# Idempotency

> Retry creates safely with an Idempotency-Key header.

`POST /v1/kennet/twins` and `POST /v1/kennet/batches` accept an `Idempotency-Key` header: a unique string of 1 to 255 printable ASCII characters, such as a UUID. Retrying with the same key returns the original twin or batch instead of creating another.

| Request within 24 hours | Response |
| - | - |
| Same key, same request | The original object: `202`, same `id`, headers `Location` and `Idempotent-Replayed: true` |
| Same key, different request | `409 idempotency_key_reused` |
| Same key, first request still in progress | `409 idempotency_key_in_use`, with `Retry-After` |

The same request means, for a twin, the same file name, file bytes, `end_user` and `confidential` list; for a batch, the same `requests` (each `custom_id`, `file_id` and `end_user`, in order) and `confidential` list.

A request that returns an error releases its key. Keys expire after 24 hours and are scoped to an organization and mode.


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