Delete Roles

Deletes roles specified in the request body. Requires admin permissions to run this API.

Resource name: /api/v1/roles

Request Method: DELETE

Request parameters

Parameter Type Description
Request Body array of strings List of role names to be deleted. Each role name is a string

Request example

Copy
[
  "role1",
  "role2",
  "role3"
]

cURL Example

Copy
curl -X DELETE "https://<localhost>/api/v1/roles" \
-H "Content-Type: application/json" \
-d '[
  "role1",
  "role2",
  "role3"
]'

Status codes

Code Description
200 Roles successfully deleted.
400 Bad Request - Invalid input provided.
401 Unauthorized - Authentication required.
403 Forbidden - Insufficient permissions.
404 Not Found - Role(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 - Service is currently unavailable.

Response parameters

Parameter Type Description
successRoles array of strings List of successfully deleted roles.
failedRoles array of strings List of roles that failed to be deleted.
errorDetails object Details about the errors for failed deletions.

Response example success 200

Copy
{
  "successRoles": [
    "string"
  ],
  "failedRoles": [
    "string"
  ],
  "errorDetails": {
    "message": "string",
    "additionalInfo": "string",
    "details": {
      "additionalProp1": [
        "string"
      ],
      "additionalProp2": [
        "string"
      ],
      "additionalProp3": [
        "string"
      ]
    }
  },
  "status": "100 CONTINUE"
}

Response example failure 400

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