RoomsRoom ManagementDelete Room

Delete a Room

Overview

This endpoint allows you to permanently delete a specified room and all its messages. After deletion, the room data and message history will be completely removed from the database and cannot be recovered.


API Endpoint

Delete a Room

Permanently delete a specified room and all its messages.

DELETE /rooms/:id

Headers

ParameterTypeRequiredDescription
IM-CLIENT-KEYstringClient key
IM-AuthorizationstringClient token

Path Parameters

ParameterTypeRequiredDescription
:idstringRoom unique identifier

Example Request

cURL Example:

curl -X "DELETE" "https://your-app.imkit.io/rooms/test-room-123" \
     -H 'IM-CLIENT-KEY: {IM-CLIENT-KEY}' \
     -H 'IM-Authorization: {IM-Authorization}' \
     -H 'Content-Type: application/json; charset=utf-8'

JavaScript Example:

const response = await axios.delete(
  "https://your-app.imkit.io/rooms/test-room-123",
  {
    headers: {
      "IM-CLIENT-KEY": `${IM_CLIENT_KEY}`,
      "IM-Authorization": `${TOKEN}`,
      "Content-Type": "application/json; charset=utf-8",
    },
  }
);

Response

Success Response (200 OK)

ParameterTypeDescription
RCnumberResponse code (0 indicates success)
RMstringResponse message
resultobjectResult of the delete operation

Result Object Fields

ParameterTypeDescription
nnumberNumber of affected documents
oknumberWhether the operation was successful (1 indicates success)

Example Response

{
  "RC": 0,
  "RM": "OK",
  "result": {
    "n": 1,
    "ok": 1
  }
}

Error Response

When a request fails, you will receive an error response containing error details. Common error scenarios include:

  • Invalid client key or authorization token
  • The specified room does not exist
  • No permission to delete the room
  • Internal server error

Use Cases

Room Management

  • Clean up unused rooms: Permanently delete rooms that are no longer active or needed
  • Data management: Remove rooms and all their associated message history when necessary

Notes

  • Permanent deletion: This operation permanently deletes the room and all its messages from the database and cannot be undone
  • Messages deleted together: All message history within the room will also be deleted
  • Make sure the room ID is correct to avoid accidentally deleting important rooms
  • After deletion, members who were in the room will no longer be able to access any related data
© 2026 FUNTEK Software Inc. All rights reserved.