How would you implement idempotent API endpoints?

Technical