What is the difference between PUT and PATCH?
PUT replaces an entire resource with the data you send, while PATCH updates only the specific fields you include. If you PUT a user but leave out the email, the email can be wiped, because PUT means replace the whole thing. PATCH is safer for partial updates because it only touches the fields you provide.
A simple example
Say a user has a name and an email. To change only the email, PATCH lets you send just the email field. With PUT you should send the full user object, because anything you leave out may be reset.
PATCH /users/42
{ "email": "new@site.com" } // only email changes
PUT /users/42
{ "name": "Ann", "email": "new@site.com" } // full replace
The clean summary interviewers want is PUT replaces the whole resource and PATCH updates part of it. Adding that PUT is idempotent while PATCH may or may not be earns extra credit.
Common follow up questions
Related interview questions
Want the full API Design guide?
Read every API Design concept with notes, diagrams, and code in one place. Track your progress as you go.
Open the API Design guide All API Design questions