Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
69 lines (53 loc) · 1.95 KB

File metadata and controls

69 lines (53 loc) · 1.95 KB

Delete Role

HTTP MethodURLRequires Auth
POST/api/v1/roles.deleteyes

{% hint style="info" %}

  • 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. {% endhint %}

Body Parameters

KeyExample ValueDescription
roleId*vEpePE7wK6vkYbDDxThe ID of an existing role.

Example Call

curl --location 'http://http://localhost:3000/api/v1/roles.delete' \
--header 'X-Auth-Token: x65a7F7aZZtW_H2hTgKEsp_RFxUkLPI6j0G5GNqvoyF' \
--header 'X-User-Id: CkCPNcvsvCDfmWLqC' \
--header 'Content-Type: text/plain' \
--data '{
    "roleId": "6579adcf2dd9f9d9514f6"
}'

Example Response

Success

{
    "success": true
}

Error

Any of the following errors can occur on the endpoint.

  • Authorization: Requires an authentication token for the request to be made.
  • Invalid RoleId: This occurs when the roleId does not exist on your workspace.

{% tabs %} {% tab title="Authorization" %}

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

{% endtab %}

{% tab title="Invalid RoleId" %}

{
    "success": false,
    "error": "This role does not exist [error-invalid-roleId]",
    "errorType": "error-invalid-roleId"
}

{% endtab %} {% endtabs %}

Change Log

Version Description
3.17.0 Added