EasyExperience level: 0-2 years · 3-5 years1 min read

PUT vs PATCH — which do you use to update a resource, and why does it matter?

Reviewed by Gurusankar M.

Asked inInfosysTCSCognizantAccenture
#put#patch#idempotency#partial update#rest
Report issue

Short Answer

PUT replaces the entire resource (send the full representation) and is idempotent. PATCH applies a partial modification (only changed fields) and isn't necessarily idempotent. Use PUT for full replacement, PATCH for partial updates — and document the PATCH format (merge vs JSON Patch).

On this page

Concept Made Simple

Coffee Chat Question

“PUT vs PATCH — which do you use to update a resource, and why does it matter?”

Remember It Faster

Mind Map Answer

PUT
full replace, idempotent
PATCH
partial update, maybe not idempotent
Gotcha
PUT with missing fields can null them

Learn by Doing

Hands-on Keyboard

http
PUT /users/101        { "name":"John", "email":"j@x.com" }  # full
PATCH /users/101      { "email":"new@x.com" }                # partial

Think Beyond the Expected

What If?

A client sends PUT with only the changed field and other fields get wiped — why?

PUT means 'replace the whole resource' — fields omitted from the body are treated as removed/defaulted. The client either must send the complete representation with PUT, or use PATCH for partial updates. This is a very common API bug.

Real World

Accidental data loss from partial PUTs is a frequent API bug; teams standardize on PATCH (often JSON Merge Patch) for edits and reserve PUT for full replacement or upsert.

Interviewer's Expectation

Keywords they're listening for:

  • PUT replaces, PATCH partial
  • PUT idempotent
  • missing fields on PUT
  • PATCH format (merge/JSON Patch)

Common Mistakes

  • Using PUT for partial updates (wipes fields)
  • Assuming PATCH is always idempotent
  • Not documenting the PATCH body format

Best Practices

  • PATCH for partial edits, PUT for full replace
  • Pick and document a PATCH format
  • Validate the full body on PUT

Follow-up Questions

  1. Is PATCH idempotent? When is it / isn't it?
  2. JSON Merge Patch vs JSON Patch (RFC 6902)?
  3. Can PUT create a resource (upsert)?

Continue Learning with AI

Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.

Plain-language foundations

I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner.

Topic: HTTP Methods (REST APIs)
Interview question: "PUT vs PATCH — which do you use to update a resource, and why does it matter?"

Please:
1. Explain the core idea in simple, plain language, using an everyday analogy.
2. Define any technical terms you use.
3. Walk through one small, concrete example.
4. Finish with a single sentence I can easily remember.

Keep the tone friendly and assume I'm new to this topic.
Open inChatGPTGeminiClaude

Was this answer helpful?

Affiliate links

Equipment for a comfortable, productive setup.

As an Amazon Associate I earn from qualifying purchases.