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

Path Parameters

organizationId
string
required
Organization ID
id
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"
  }
}

System Role Cannot Be Deleted

{
  "error": {
    "code": "SYSTEM_ROLE",
    "message": "System roles cannot be deleted",
    "details": {
      "role": "owner"
    }
  }
}

Code Examples

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