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

# Reliable Requests

> Use Idempotency-Key headers and structured backoff retries to avoid duplicate uploads and handle transient errors cleanly.

Network drops and timeouts happen during large audio or video uploads. The HearDraft API requires an `Idempotency-Key` header on every `POST /api/v1/transcriptions` request so your backend can retry safely without creating duplicate transcription jobs.

## Idempotency-Key rules

| Rule | Requirement |
| - | - |
| **Header name** | `Idempotency-Key` (required on `POST /api/v1/transcriptions`) |
| **Allowed format** | 8 to 128 characters matching `^[A-Za-z0-9._-]{8,128}$` |
| **Fingerprint check** | HearDraft hashes `(filename, Content-Type, Content-Length, language)` for each key |
| **Safe retry behavior** | Reusing the same key with the **exact same file metadata** returns the existing job instead of queuing a duplicate |
| **Conflict behavior** | Reusing a key with different file metadata returns `409 IDEMPOTENCY_CONFLICT` |
| **In-flight collision** | Retrying while the initial upload is still streaming returns `409 UPLOAD_IN_PROGRESS` |

### Recommended key format

Tie the key to your own stable media asset identifier and version, rather than generating a fresh random UUID on every retry attempt:

```text theme={null}
Idempotency-Key: podcast-ep142-master-v1
```

## Safe retry strategy

* **Retry with exponential backoff + jitter** on `429`, `503`, `409 UPLOAD_IN_PROGRESS`, or network timeouts — always keeping the **same `Idempotency-Key`** and identical payload.
* **Do not retry** on `400`, `401`, `403`, `409 IDEMPOTENCY_CONFLICT`, `411`, `413`, or `415` without fixing the request parameters, credentials, or file first.
* **Polling interval**: Poll `GET /api/v1/transcriptions/{id}` every 3–5 seconds for short recordings and 10–15 seconds for multi-hour files to stay comfortably inside the 120 requests/minute workspace limit.


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