Delete role
What this does: Soft deletes a custom role from the workspace. The role is marked as deleted but not permanently removed from the database.
Important restrictions:
- Base roles (Root, CEO, Team Leader, Staff, Guest) cannot be deleted
- Only custom roles created by users can be deleted
- Attempting to delete a base role will return an error
What happens to users:
- All users currently assigned to this role are automatically reassigned to the default Staff role
- This ensures no users are left without a valid role assignment
- The reassignment happens automatically and cannot be prevented
What happens to child roles:
- If other roles inherit from this role (have this role as parentId), they will need to be updated separately
- Child roles are not automatically updated when parent is deleted
- You should update child roles before deleting the parent, or reassign them to a different parent
Use cases:
- Remove obsolete roles that are no longer needed
- Clean up test roles created during development
- Consolidate roles by removing redundant ones
- Archive roles that are temporarily not in use
Note: This is a soft delete - the role can potentially be restored if needed (depending on your data retention policies).
DELETE
/administration/roles/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredResponses
200
successbooleanrequiredOperation success flag
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X DELETE "https://leadtime.app/api/public/administration/roles/string" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const response = await fetch("https://leadtime.app/api/public/administration/roles/string", {
method: "DELETE",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});import requests
response = requests.delete(
"https://leadtime.app/api/public/administration/roles/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
)Response
{
"success": true
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions