What is Idempotent?

Turkish: Idempotent

An idempotent operation leaves the system in the same final state whether the same request runs once or several times.

What Does Idempotent Mean?

An idempotent operation leaves the system in the same final state even if the same command runs more than once. “Set this user’s email to a@example.com” has the same result when repeated. “Subtract 100 from the balance” changes the result every time.

In HTTP, GET, HEAD, PUT, and DELETE are considered idempotent by semantics. GET should read data. PUT sets a resource to a full requested representation. DELETE may be sent again, but the final state is still that the resource is gone. POST usually starts a new operation, so it is not idempotent by default.

Why It Matters

Network drops, timeouts, and client retries are common in distributed systems. A client may not know whether the first request reached the server. Idempotent design allows safe retries and reduces uncertainty in API integrations.

Practical Design

In resource-oriented REST API design, method semantics should be chosen carefully, and write operations should be protected with unique constraints and transactions. For flows that are not naturally idempotent, such as payments or order creation, an idempotency key is often used.