Zum Inhalt springen
Leadtime
Deutsch
Esc
navigateopen⌘Jpreview

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 · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
idstringrequired
Responses
200
successbooleanrequired
Operation 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"
Response
{
  "success": true
}