Link Search Menu Expand Document

Deactivate

/api/v2/user/deactivate

Post

users


Purpose

To allow an user to deactivate his / her account.

Body Content [input]

{
    uid: string,
    password: string,
}

Returns if valid [output]

{
    message: string,
    error: 0
}

What the API does

  • Checks if there is a record in the users collection with the uid supplied [404].
  • Compares the saved hashed password with a hashed version of the password supplied to check if the password is correct [401].
  • Checks if the deactivated field of the record is set to false [400].
  • Updates and saves the record in the users collection, setting the deactivated field to true.