Sending the sameDocumentation Index
Fetch the complete documentation index at: https://docs.letmepost.dev/llms.txt
Use this file to discover all available pages before exploring further.
POST /v1/posts request twice should publish exactly one post. That’s what the Idempotency-Key header buys you.
How it works
Pass a unique key — typically a UUID v4 — on every write:header.txt
idempotency_conflict so you don’t accidentally publish two different posts under one key.
When to use a key
- Every retry path. Network blip, lambda re-invocation, Temporal workflow restart — pin them to a key the caller computes deterministically.
- Every webhook handler that publishes. Webhooks are at-least-once; keys make idempotent processing a one-line addition.
- Every CI / cron job that posts on a schedule.
What counts as the “same request”
The replay cache keys on:- API key
- HTTP method + path
- The exact
Idempotency-Keyheader - A SHA-256 hash of the request body
idempotency_conflict — that’s a feature, not a bug. It catches the case where you reused a key by mistake but actually meant to publish something different.
TTL
Replay records are kept for 24 hours after the first request, then evicted. Beyond 24h the same key is treated as fresh, so don’t rely on long-lived dedup; that’s what idempotent application logic is for.Generating keys
UUID v4 from any standard library is fine. For deterministic retries, hash the upstream event id (e.g., your Temporal workflow run id):key-strategies.ts
What this is not
Idempotency keys do not deduplicate based on content. Two different keys, same body, will publish two posts. That’s the contract — the key is the unit of “this is the same request”; we don’t second-guess.See also
POST /v1/postsreference for the parameter on the endpoint itself.idempotency_conflictfor the error you’ll see on a key-with-different-body collision.