API Docs
Users Model
Activate/Deactivate a User
5min
api endpoint documentation /api/users/manage status this endpoint allows you to manage the status of a user in the system by sending a post request it is typically used for administrative purposes to update user statuses, such as activating or deactivating a user post https //admin \<your site> com/api/users/manage status accept application/json specifies that the request expects a json response accept language en us,en;q=0 9 sets the preferred language for the response authorization bearer \<jwt token> a json web token (jwt) that authenticates the request replace \<jwt token> with a valid token content type application/json specifies the format of the request body, which is json the request body should be in json format, containing the following fields id string the id of the user whose status is being managed token string a valid authentication token (jwt) that provides permission for this operation json { "id" "634441cecbb5901d133039f8", "token" "eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9 " } post sends a request to update the user's status fetch("https //admin \<your site> com/api/users/manage status", { "headers" { "accept" "application/json", "accept language" "en us,en;q=0 9", "authorization" "bearer eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9 ", "content type" "application/json" }, "body" "{\\"id\\" \\"634441cecbb5901d133039f8\\",\\"token\\" \\"eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9 \\"}", "method" "post" }); the api will return a json response indicating the success or failure of the operation \[success] 200 { "message" "user status updated successfully", "status" "success" } \[failure] 401 { "message" "invalid token or user id", "status" "error" } this api requires a valid jwt token for authentication ensure that the token is included in the authorization header as bearer \<jwt token> ensure that the id in the request body matches the user whose status you want to manage the request must include a valid jwt token for authentication without it, the request will be rejected with a 401 unauthorized error