Modify user
Last updated
Last updated
This API endpoint allows updating a user's information by either their ID or email. The endpoint is "/api/user/{id_or_email}" where {id_or_email} is either the user's ID or email. This endpoint requires an API key with the "admin" permission for security.
The request must be in JSON format and contain the following parameters:
user_role: a string representing the user's role (example: "admin")
user_company: a string representing the user's company (example: "63c04c071ad80d5322929cb1")
user_company_txn: a string representing the user's company transaction (example: "63c04c071ad80d5322929cb1")
The response is also in JSON format and contains two properties:
error: an object containing error code and message (example: code: "040", message: "User not found")
data: an object containing the updated user information including:
_id: a string representing the user's ID (example: "MMGqKihnmmqyTgAy")
email: a string representing the user's email (example: "test@gmail.com")
password: a string representing the user's password
wallet: a string representing the user's wallet
user_role: a string representing the user's role
user_company: a string representing the user's company
user_company_txn: a string representing the user's company transaction
ID or email of the user to update
admin
63c04c071ad80d5322929cb1
63c04c071ad80d5322929cb1
Successful response