Add API root endpoint for /api/users/

Added UsersAPIRoot view that returns available user-related
endpoints when accessing /api/users/ directly.

All API endpoint groups now have discoverable root endpoints:
- /api/ - Main API root
- /api/users/ - User endpoints
- /api/tasks/ - Task endpoints (already had TaskListCreateAPIView)
- /api/sync/ - Sync endpoints (already had sync view)
- /api/notifications/ - Notification endpoints (already had NotificationListAPIView)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Keith Smith
2025-12-26 17:26:50 -07:00
co-authored by Claude Sonnet 4.5
parent d1720bebb3
commit ab06bc4fc9
2 changed files with 20 additions and 0 deletions
+1
View File
@@ -9,6 +9,7 @@ from . import views
# API URLs (to be included under /api/users/) # API URLs (to be included under /api/users/)
api_urlpatterns = [ api_urlpatterns = [
path('', views.UsersAPIRoot.as_view(), name='api-users-root'),
path('register/', views.RegisterAPIView.as_view(), name='api-register'), path('register/', views.RegisterAPIView.as_view(), name='api-register'),
path('verify-email/', views.VerifyEmailAPIView.as_view(), name='api-verify-email'), path('verify-email/', views.VerifyEmailAPIView.as_view(), name='api-verify-email'),
path('resend-verification/', views.ResendVerificationEmailAPIView.as_view(), name='api-resend-verification'), path('resend-verification/', views.ResendVerificationEmailAPIView.as_view(), name='api-resend-verification'),
+19
View File
@@ -31,6 +31,25 @@ User = get_user_model()
# API Views # API Views
# ============================================================================= # =============================================================================
class UsersAPIRoot(APIView):
"""API root for users endpoints."""
permission_classes = [permissions.AllowAny]
def get(self, request):
return Response({
'endpoints': {
'register': '/api/users/register/',
'login': '/api/users/token/',
'refresh_token': '/api/users/token/refresh/',
'verify_email': '/api/users/verify-email/',
'resend_verification': '/api/users/resend-verification/',
'profile': '/api/users/profile/',
'change_password': '/api/users/change-password/',
'devices': '/api/users/devices/',
}
})
class RegisterAPIView(generics.CreateAPIView): class RegisterAPIView(generics.CreateAPIView):
"""API endpoint for user registration.""" """API endpoint for user registration."""