Consider a resource that has, say, the enabled (true/false) property. If the API needs the "enable/disable user" operation, should it be implemented using the generic "update user" operation
PATCH /users/{user_id}
{
"enabled": true/false
}
or as
POST /users/{user_id}/enable
POST /users/{user_id}/disable
as an action?
The former approach has the benefit that we change both the enabled and other properties in a single API call.
Consider a resource that has, say, the enabled (true/false) property. If the API needs the "enable/disable user" operation, should it be implemented using the generic "update user" operation
PATCH /users/{user_id}or as
as an action?
The former approach has the benefit that we change both the enabled and other properties in a single API call.