Skip to content

What it is

Idempotent means applying an operation once or many times produces the same result, so retries are safe by construction.

An idempotent operation has a fixed point. Calling it once sets the system to state X. Calling it a second, third or hundredth time leaves the system in state X. The critical property is not the number of executions; it is the absence of cumulative effects.

PUT /users/42 {name: "Ana"} is idempotent: whether it runs once or ten times, user 42 ends up named Ana. POST /users is not: each call creates a new user. DELETE /users/42 is idempotent in effect (user 42 ends up deleted) even if the second call returns 404: the state after one deletion equals the state after ten.