Backend & systems·API and interface design
you make the endpoint a PUT with a client-chosen id, so a nervous client can send it three times without creating three records.
Idempotent HTTP method
Also calledsafe method, PUT vs POST
The HTTP contract that GET, PUT and DELETE can be repeated without additional effect, while POST cannot. Clients, proxies and retry libraries rely on it, so a PUT with non-idempotent behaviour will be retried into a bug by infrastructure you do not control. If you need a non-idempotent create to be retry-safe, take an idempotency key.