Delete Role
    • Dark
      Light
    • PDF

    Delete Role

    • Dark
      Light
    • PDF

    Article summary

    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

    VersionDescription
    3.17.0Added
    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

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.