Skip to main content
DELETE
/
app
/
v1
/
organizations
/
{organizationId}
/
roles
/
{roleId}
Delete Role
curl --request DELETE \
  --url https://api.example.com/app/v1/organizations/{organizationId}/roles/{roleId}

Path Parameters

organizationId
string
required
Organization ID
roleId
string
required
Role ID

Response

{
  "message": "Role successfully deleted",
  "id": "role123"
}
Deleting a role will remove it from all users who have it assigned. Consider the impact on user permissions before deleting.

Error Responses

Role Not Found

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Role not found"
  }
}

Role In Use

{
  "error": {
    "code": "ROLE_IN_USE_BY_USERS",
    "message": "Cannot delete a role that is used in users user123, user456"
  }
}

Code Examples

curl -X DELETE "https://api.metabind.ai/app/v1/organizations/org123/roles/role123" \
  -H "Authorization: Bearer YOUR_JWT"