Delete user
Permanently delete a user from both database and authentication system.
This endpoint performs a hard delete of the user, removing them from both the platform database AND the authentication system. This operation is IRREVERSIBLE. The user will immediately lose access and cannot log in. All user data is permanently removed.
Context: - HARD DELETE: User permanently removed from database and authentication system - Synchronizes deletion across platform database and authentication system - User immediately loses all access to the system - Cannot be undone - use with extreme caution - For temporary deactivation, update user status to inactive instead - User's created flows and executions may remain (check cascade rules) - No response body returned (204 No Content status)
Behavior: 1. Validates user exists by ID 2. Deletes user from authentication system 3. Deletes user record from platform database 4. Returns 204 No Content if successful 5. Returns 404 if user not found Side Effects: - User permanently removed from system - User's login credentials invalidated - Active sessions terminated immediately - User's API tokens revoked - May affect flows/executions depending on cascade rules
WARNING - Data Loss: This operation PERMANENTLY DELETES: - User profile information - User authentication credentials - User role and permissions - May affect user's flows and executions (check before deletion)
Use Cases: - Remove user after offboarding from organization - Comply with GDPR "right to be forgotten" requests - Clean up test users after development - Remove accounts created by mistake - Automated cleanup of inactive trial users
Safer Alternative: For reversible deactivation without deletion: 1. Update user status to inactive via user update endpoint 2. User account preserved but login disabled 3. Can be reactivated later if needed
Pre-Deletion Checklist: - Verify user_id is correct - Check if user owns flows or executions - Consider reassigning user's resources - Backup user data if needed for records - Confirm deletion is intentional
Related Endpoints: - GET /admin/users/{user_id} - Verify user before deletion - GET /admin/organizations/{id}/users - Check organization membership - POST /admin/users - Create new user if deleted by mistake
Header Parameters
Path Parameters
Unique identifier of the user to delete.
Response
Response Attributes
Standard error detail structure.
This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.
Show child attributes
Response Attributes
Standard error detail structure.
This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.
Show child attributes
Response Attributes
Standard error detail structure.
This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.
Show child attributes
Response Attributes
Show child attributes
Response Attributes
Standard error detail structure.
This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.