پرش به مطلب اصلی

Delete User API

POST /deleteUser

Description

This API endpoint allows an admin to delete an existing user by providing the user's unique identifier. Deleting a user will remove the user and all associated data from the system.

Request Body

The request utilizes GraphQL to perform the deleteUser mutation.

Mutation:

mutation deleteUser ($id: Int) {
deleteUser (id: $id)
}

Variables:

{
"id": 0
}
  • id (Int): The unique identifier of the user to be deleted.

Response:

  • Success (200 OK):

    • If the deletion is successful, the response will not return additional data, confirming that the user has been deleted.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid user ID, missing required fields, or server errors.

Note:

Ensure that the id corresponds to an existing user that needs to be deleted. Once deleted, the user's data cannot be recovered, so make sure to back up any necessary information before performing this action. Only admins with the appropriate permissions can delete users from the system.