Delete User

Deletes a list of users specified in the request body. It provides details on the status of deletions, including any errors or failed deletions. Requires admin permissions to run this API.

Resource name:

/api/v1/users

Request Method:

DELETE

Request parameters:

Parameter Type Description
Body Array of strings List of usernames to delete.

Request example:

Copy
[
    "user1",
    "user2",
    "user3"
]                

cURL Example:

Copy
curl --cookie "PHPSESSID=<PHP SESSION ID>" -X DELETE "https://<localhost>/api/v1/users" \
-H "Content-Type: application/json" \
-d '[
    "user1",
    "user2",
    "user3"
]'

Status codes:

Code Description
200 Users deleted successfully.
400 Bad Request: Validation error or invalid input.
401 Unauthorized: User authentication failed.
403 Forbidden: User lacks the necessary permissions.
404 Not Found: User(s) not found.
423 Locked: Resource is locked.
429 Too Many Requests: Rate limit exceeded.
500 Internal Server Error: An unexpected error occurred.
503 Service Unavailable: The service is unavailable.

Response parameters:

Parameter Type Description
deleted_users Array of strings List of successfully deleted usernames.
failed_users Array of strings List of usernames that could not be deleted.
error_details String Details about errors that occurred during the request.
status String HTTP status code representing the result.

Response example success 200:

Copy
{
    "status": "100 CONTINUE",
    "deleted_users": [
        "string"
    ],
    "failed_users": [
        "string"
    ],
    "error_details": "string"
}        

Response example failure 400:

Copy
{
  "error": "string",
  "description": "string",
  "fieldErrors": [
    {
      "field": "string",
      "error": "string"
    }
  ]
}            

Response example failure 404:

Copy
{
  "status": "NOT_FOUND",
  "failed_users": [
    "string"
  ],
  "error_details": "string"
}