Remove Chat Room Member
This endpoint allows you to remove a member from a chat room. It ensures that a user's access and permissions within a chat room can be revoked when necessary.
DELETE
https://api.deadsimplechat.com/consumer/api/v2/room/:roomId/member
Request
DELETE /consumer/api/v2/room/:roomId/member
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 |
Path Parameters
Parameter | Description | Data Type |
---|---|---|
roomId | The unique identifier for the chat room | String |
Body Parameters
Parameter | Description | Data Type |
---|---|---|
uniqueUserIdentifier | Unique Identifier for the user | String |
Responses
Success Response
A JSON object confirming the successful removal of the user from the chat room.
HTTP Status: 200 OK
Body:
{
"success": true,
"message": "user removed as member"
}
Error Responses
Invalid request body:
HTTP Status:
400 Bad Request
Body:
{
"error": { ...validation details... }
}Invalid API Key:
HTTP Status:
401 Unauthorized
Body:
{
"error": "Invalid API Key"
}User not found:
HTTP Status:
400 Bad Request
Body:
{
"message": "user not found"
}Specified chat room not found:
HTTP Status:
400 Bad Request
Body:
{
"message": "chatRoom not found"
}User not a member of the chat room:
HTTP Status:
400 Bad Request
Body:
{
"success": false,
"message": "user is not a member of the chat room"
}
Code Examples
JavaScript (Fetch API)
fetch("https://api.deadsimplechat.com/consumer/api/v2/room/<ROOM_ID>/member?auth=<YOUR_SECRET_KEY>", {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
uniqueUserIdentifier: '<USER_IDENTIFIER>'
})
})