Modify user
ID or email of the user to update
admin
63c04c071ad80d5322929cb1
63c04c071ad80d5322929cb1
PUT /api/user/{id_or_email} HTTP/1.1
Host: url to be defined
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 109
{
"user_role": "admin",
"user_company": "63c04c071ad80d5322929cb1",
"user_company_txn": "63c04c071ad80d5322929cb1"
}
Successful response
{
"error": {
"code": "040",
"message": "User not found"
},
"data": {
"user": {
"_id": "MMGqKihnmmqyTgAy",
"email": "[email protected]",
"password": "$2b$10$tj0TYFFNVsp1GnZo8DRO9O4nz5iGm3fVyth9FES3Is5/VbbJLEFa6",
"wallet": "CBVE3R2ZV2UWTEXROOVT5GKWOQ5HULDPMEUJWCSA5JEWVTISCNHU3KJHWU",
"user_role": "text",
"user_company": "63c04c071ad80d5322929cb1",
"user_company_txn": "63c04c071ad80d5322929cb1"
}
}
}
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: "[email protected]")
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
Last updated