Remove User
Use this API endpoint to remove a user from the system. This action will flag the user as removed, erase their membership in all chat rooms, and if they have an active WebSocket connection, it will send them an "user_not_found" error message.
DELETE
https://api.deadsimplechat.com/consumer/api/v2/user
Request
DELETE /consumer/api/v2/user
info
The auth
query parameter is your private key. You can find it in your Dashboard under Developer -> Private Key.
Query Parameters
Parameter | Description | Data Type |
---|---|---|
auth | Go to Dashboard -> Developer -> Private Key is your auth | String |
Request Body
The request body can have one of the two properties:
Parameter | Description | Data Type |
---|---|---|
userId | The unique ID of the user to be removed | String |
uniqueUserIdentifier | An alternative unique identifier for a user | String |
Note: Either userId
or uniqueUserIdentifier
is required, but not both.
Responses
Success Response
A JSON object containing the following fields:
Field | Description | Data Type |
---|---|---|
success | Indicates operation success | Boolean |
message | A success message | String |
HTTP Status: 200 OK
Body:
{
"success": true,
"message": "user removed"
}
Error Responses
User Not Found:
HTTP Status:
400 Bad Request
Body:
{
"message": "user not found"
}Validation Error:
HTTP Status:
400 Bad Request
Body:
{
"error": "[Detailed validation error]"
}Internal Server Error:
HTTP Status:
500 Internal Server Error
Body:
{
"message": "Internal server error occurred, please try again. If the problem persists then contact support and mention the eventId",
"eventId": "[UUID representing the event]"
}
Code Examples
JavaScript (Fetch API)
fetch("/consumer/api/v2/user?auth="+private_key, {
method: "DELETE",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
uniqueUserIdentifier: "<UNIQUE_USER_IDENTIFIER>"
// OR
// userId: "<USER_ID_TO_REMOVE>"
})
})