PATCH
Applies partial modifications to a resource. Only the fields in the request body are updated. PATCH should be idempotent when possible.
Properties
- Safe
- No
- Idempotent
- Yes
- Has body
- Yes
Typical use cases
Partial updates, field-level changes (e.g., update only email)
cURL example
curl -X PATCH -H "Content-Type: application/json" -d '{"email":"alex@updated.com"}' https://api.example.com/users/1Typical response
{"id":1,"name":"Alex","email":"alex@updated.com"}Common status codes
200 OK204 No Content400 Bad Request404 Not Found409 Conflict500 Server Error
Comparison with similar methods
PATCH updates only specified fields; PUT replaces the whole resource.