RealTimeX
Sign inStart for free
RealTimeXAPI Documentationv1
IntroductionAuthenticationBase URLHeadersError codes
GETGet profilePATCHUpdate profilePATCHChange passwordGETList conversationsGETConversation metadata keysGETGet conversationGETConversation messagesPATCHUpdate conversationDELDelete conversationPOSTBulk delete conversationsGETList messagesGETMessage metadata keysPATCHUpdate messageDELDelete messagePOSTBulk delete messagesGETList usersGETUser metadata keysGETGet userPATCHUpdate userDELDelete userPOSTBulk delete users
Sample requestsSample responsesStatus codesAppendixChangelog
API ReferenceAPI endpointsPlatform

Delete Conversation

Overview

Permanently delete a single conversation and its related messages and membership records.

The success response reports how many conversations, messages, and members were removed so you can confirm cleanup in admin tools and audit logs.

When to use this endpoint?

Use Delete Conversation when:

  • An admin removes one conversation from the tenant workspace.
  • You need to clean up a specific thread and its messages permanently.
  • The UI offers a single-item delete action (not bulk selection).

To remove many conversations at once, use Conversations → Bulk Delete Conversations instead.

DELETE{baseUrl}/api/{apiVersion}/client/conversations/:conversationId
Authentication
Required (Bearer token)
Tenant-scoped
Yes (tenant DB - requires x-client-id)

Request Headers

HeaderValueDescription
AuthorizationBearer <access_token>Access Token from Login Client or Register Client.
is-tenanttrueTargets the tenant DB ("true", needs x-client-id).
x-client-id{{clientId}}Tenant (client) id. Uses the {{clientId}} variable.

Path Parameters

ParameterExampleDescription
conversationIdstringConversation _id (24-char Mongo ObjectId).

Success Response (HTTP 200 OK)

Deletion removes the conversation plus cascaded messages and members. Counts are returned in data.

json
1{2  "success": true,3  "message": "Conversation deleted successfully",4  "data": {5    "conversationsDeleted": 1,6    "messagesDeleted": 42,7    "membersDeleted": 38  },9  "error": null10}

Error Responses

HTTP 404 Not Found - Not found

json
1{2  "success": false,3  "message": "Conversation not found",4  "data": null,5  "error": "Conversation not found"6}

Notes & Validation Rules

  • Conversation not found (HTTP 404 - Not found)

Common Errors

Delete fails when the conversation does not exist or the request is not authenticated for the tenant.

CodeReason
400 Bad RequestconversationId is missing or not a valid ObjectId.
401 UnauthorizedAccess Token is missing, invalid, or expired.
404 Not FoundConversation not found for the given conversationId.
500 Internal Server ErrorAn unexpected error occurred while deleting the conversation.

Best Practices

  • Treat delete as irreversible - confirm in the UI before calling the API.
  • Use the returned messagesDeleted and membersDeleted counts for audit or toast feedback.
  • Prefer Bulk Delete Conversations when removing multiple IDs in one request.
  • Refresh list views after a successful delete so removed threads disappear immediately.

Conversation removed

Return to Conversations → List Conversations to confirm the thread is gone, or continue cleanup with Bulk Delete Conversations.

PreviousUpdate conversationNextBulk delete conversations

On this page

OverviewWhen to use this endpoint?Request HeadersPath ParametersSuccess Response (HTTP 200 OK)Error ResponsesNotesCommon ErrorsBest Practices
Back to top