Delete Role

Post
/api/v1/roles.delete

Permission required: access-permissions

  • Roles that have the protected value as true can't be deleted (such as: admin, moderator, user and so on).
  • You cannot delete roles that are assigned to users. To do that, you must first remove this role from all the users.

Changelog

Version Description
3.17.0 Added
Header parameters
X-User-Id
stringRequired

The authenticated user ID.

ExamplerbAXPnMktTFbNpwtJ
X-Auth-Token
stringRequired

The authenticated user token.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
Body parameters
object
roleId
string Required

The ID of an existing role.

Example6579adcf2dd9f9d9514f6
Responses
200

OK

Success
{
  "success": true
}
object
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "The role properties are invalid. [error-invalid-role-properties]",
  "errorType": "error-invalid-role-properties"
}
Example 2
{
  "success": false,
  "error": "Accessing permissions is not allowed [error-action-not-allowed]",
  "errorType": "error-action-not-allowed"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string