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
Parameter | Description | Data Type |
---|---|---|
auth | Go to Dashboard -> Developer -> Private Key is your auth | String |
Request Body
A JSON object containing one of the following fields:
Field | Description | Data Type |
---|---|---|
userId | The unique identifier for the user | String |
uniqueUserIdentifier | Another unique identifier for the user | String |
Note: Either
userId
oruniqueUserIdentifier
must be provided, but not both.
Responses
Success Response
A JSON object indicating that the user has been successfully deactivated:
Field | Description | Data Type |
---|---|---|
success | Operation status | boolean |
message | Success message | string |
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"
}
})