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 User

Overview

Permanently remove a single tenant user by userId.

On success, the API reports how many users and related memberships were deleted. Use this for one-off removals from an admin detail view; prefer Bulk Delete Users when removing many accounts at once.

When to use this endpoint?

Use Delete User when:

  • An admin removes one user from the tenant workspace.
  • You need to clean up a test or inactive account by its _id.
  • A confirmation dialog already collected a single target user id.
  • You want a deletion summary that includes related membership cleanup counts.
DELETE{baseUrl}/api/{apiVersion}/client/users/:userId
Authentication
Required (Bearer token)
Tenant-scoped
Yes (tenant DB - requires x-client-id)

Request Headers

HeaderValueDescription
is-tenanttrueTargets the tenant DB ("true", needs x-client-id).
x-client-id{{clientId}}Tenant (client) id. Uses the {{clientId}} variable.

Path Parameters

ParameterExampleDescription
userIdstringUser _id (24-char Mongo ObjectId).

Success Response (HTTP 200 OK)

When deletion succeeds, the API returns counts for users and related members removed.

json
1{2  "success": true,3  "message": "User deleted successfully",4  "data": {5    "usersDeleted": 1,6    "membersDeleted": 47  },8  "error": null9}

Common Errors

HTTP 200 OK means the user was deleted. Deletion fails when the user does not exist or the request is not authenticated.

HTTP 404 Not Found - Not found

json
1{2  "success": false,3  "message": "User not found",4  "data": null,5  "error": "User not found"6}
CodeReason
400 Bad RequestRequired headers are missing or userId is invalid.
401 UnauthorizedAccess Token is missing, invalid, or expired.
404 Not FoundUser not found for the given userId.
500 Internal Server ErrorAn unexpected error occurred while deleting the user.

Best Practices

  • Confirm the target user in the UI before calling delete - this action is permanent.
  • Handle 404 Not Found gracefully if the user was already removed.
  • Refresh List Users after a successful delete so the directory stays accurate.
  • Use Bulk Delete Users instead when removing more than one account in a single operation.

User removed

After a successful delete, return to List Users and verify the account no longer appears in the tenant directory.

PreviousUpdate userNextBulk delete users

On this page

OverviewWhen to use this endpoint?Request HeadersPath ParametersSuccess ResponseCommon ErrorsBest Practices
Back to top