Skip to content

Delete user endpoint

Alvin Cheng edited this page Apr 23, 2023 · 3 revisions

Description

This is the delete user endpoint, this endpoint will delete a user's account along with all the messages. The server will accept a 'user' argument for the user to delete from the database. Furthermore, this endpoint will return a status of '401' on invalid api key, '200' on success, '500' on an internal server error and '400' when the user does not exist. Here is an example on how to call the endpoint below!!

Example

post("http://<URL>/api/delete-user?key=<YOUR_API_KEY>", {
  username: "<USERNAME>",
})
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.error(err);
  });
Clone this wiki locally