Should I use PATCH or PUT in my REST API?

I want to design my rest endpoint with the appropriate method for the following scenario. There is a group. Each group has a status. The group can be activated or inactivated by the admin. Should I design my end point as PUT /groups/api/v1/groups/{group id}/status/activate OR PATCH /groups/api/v1/groups/{group id} with request body like {action:activate|deactivate} 6 Answers … Read more

Use of PUT vs PATCH methods in REST API real life scenarios

First of all, some definitions: PUT is defined in Section 9.6 RFC 2616: The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If … Read more