Set user status
PATCH/v1/admin/user/:user_id
Set user status
The patch_user_status endpoint allows an admin to update the status of a user within the system. It accepts a JSON payload specifying the new status (active or inactive) and requires the target user's ID as a URL parameter. This operation checks if the requesting user has admin privileges, verifies the existence of the target user, and ensures the requested status change is valid. Upon successful execution, it logs the activity and returns a confirmation message.
Request
Path Parameters
target_user_id stringrequired
User id
user_id uuidrequired
- application/json
Body
required
user_status stringrequired
Responses
- 200
- 400
- 403
- 500
User status changed
- text/plain
- Schema
Schema
string
Invalid user status
- text/plain
- Schema
Schema
string
User is not admin
- text/plain
- Schema
Schema
string
Unexpected error
- text/plain
- Schema
Schema
string
Loading...