Skip to main content

Deactivate User

This endpoint allows you to deactivate a user by either their userId or their uniqueUserIdentifier.


DELETE
    https:///api.deadsimplechat.com/consumer/api/v2/user/deactivate?auth=<YOUR_SECRET_KEY>

Request

DELETE /consumer/api/v2/user/deactivate

info

The auth query parameter is your private key. You can find it in your Dashboard under Developer -> Private Key.

Query Parameters

ParameterDescriptionData Type
authGo to Dashboard -> Developer -> Private Key is your authString

Request Body

A JSON object containing one of the following fields:

FieldDescriptionData Type
userIdThe unique identifier for the userString
uniqueUserIdentifierAnother unique identifier for the userString

Note: Either userId or uniqueUserIdentifier must be provided, but not both.

Responses

Success Response

A JSON object indicating that the user has been successfully deactivated:

FieldDescriptionData Type
successOperation statusboolean
messageSuccess messagestring

HTTP Status: 200 OK

Body:

{
"success": true,
"message": "user deactivated"
}

Error Responses

  • Validation Error:

    HTTP Status: 400 Bad Request

    Body:

    {
    "error": "validation error description here"
    }
  • User Not Found:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "user not found"
    }
  • Internal Server Error:

    HTTP Status: 500 Internal Server Error

    Body:

    {
    "message": "Internal server error occurred, please try again. If the problem persists then contact support and mention the eventId",
    "eventId": "example-event-id-here"
    }

Code Examples

JavaScript (Fetch API)

fetch("/consumer/api/v2/user/deactivate?auth=<YOUR_SECRET_KEY>", {
method: "DELETE",
body: JSON.stringify({
uniqueUserIdentifier: "<UNIQUE_USER_IDENTIFIER>"
// OR
// userId: "<USER_ID>"
}),
headers: {
"Content-Type": "application/json"
}
})