Skip to main content

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

Query Parameters

ParameterDescriptionData Type
authYour Secret Key for AuthenticationString

Path Parameters

ParameterDescriptionData Type
roomIdThe unique identifier for the chat roomString

Body Parameters

ParameterDescriptionData Type
uniqueUserIdentifierUnique Identifier for the userString

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>'
})
})