Modify user

api-docs Redoc document (api spec)

Update user by ID or email

put
Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired
Path parameters
id_or_emailstringRequired

ID or email of the user to update

Body
user_rolestringOptionalExample: admin
user_companystringOptionalExample: 63c04c071ad80d5322929cb1
user_company_txnstringOptionalExample: 63c04c071ad80d5322929cb1
Responses
200

Successful response

application/json
put
/api/user/{id_or_email}
200

Successful response

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