API Endpoints Reference
This document provides a comprehensive reference of all API endpoints available in TalentG, organized by category with detailed parameter and response specifications.API Architecture
Base URL
Authentication
All API endpoints require authentication via Supabase JWT tokens:Response Format
All responses follow a consistent JSON structure:Authentication & User Management
POST /api/auth/create-profile
Create or update user profile after authentication.
Request Body:
POST /api/profile-picture
Upload and update user profile picture.
Request: multipart/form-data
file: Image file (max 10MB, formats: JPG, PNG, WebP)
POST /api/user-avatar
Synchronize user avatar across the system.
Request Body:
Assessment System
POST /api/assessments/save
Save assessment results and trigger AI analysis.
Request Body:
GET /api/assessments/[id]
Retrieve assessment results by ID.
Path Parameters:
id: Assessment UUID
POST /api/generate-strength-analysis
Generate AI-powered personality analysis.
Request Body:
POST /api/strength-finder-pdf
Generate and download assessment PDF report.
Request Body:
Admin & Management
GET /api/admin/users
Retrieve paginated list of all users.
Query Parameters:
page: number (default: 1)limit: number (default: 50)role: string (optional filter)search: string (optional search)
POST /api/admin/manage-users
Create, update, or deactivate user accounts.
Request Body:
GET /api/admin/analytics
Retrieve system-wide analytics and metrics.
Query Parameters:
period: “day” | “week” | “month” | “year” (default: “month”)metrics: string[] (optional filters)
POST /api/trainer/manage-courses
Create and manage training courses (Trainer role).
Request Body:
GET /api/universities/students
Retrieve university student data and analytics.
Query Parameters:
universityId: uuidpage: numberlimit: numberstatus: “active” | “inactive” | “graduated”
POST /api/manage-plans
Manage subscription plans and user entitlements.
Request Body:
Content & Media
POST /api/uploadthing/*
File upload handling via UploadThing service.
Request: multipart/form-data
file: File to uploadfolder: Destination foldermetadata: Additional file metadata
POST /api/storage/upload
Direct file upload to Supabase Storage.
Request: multipart/form-data
file: File to uploadbucket: Storage bucket namepath: File path within bucket
POST /api/test-upload
Test file upload functionality.
Request: multipart/form-data
file: Test file
Gamification & Analytics
GET /api/leaderboard
Retrieve leaderboard rankings and statistics.
Query Parameters:
period: “daily” | “weekly” | “monthly” | “all-time”category: “overall” | “assessments” | “courses” | “internships”limit: number (default: 50)
GET /api/analytics/dashboard
Retrieve personalized dashboard analytics.
Query Parameters:
userId: uuid (required)period: “week” | “month” | “quarter” | “year”
GET /api/important-dates
Retrieve calendar events and important dates.
Query Parameters:
userId: uuidstartDate: ISO date stringendDate: ISO date stringtype: “assignment” | “class” | “deadline” | “event”
Communication
POST /api/feedback/submit
Submit feedback and reviews.
Request Body:
GET /api/announcements
Retrieve system announcements and notifications.
Query Parameters:
userId: uuidcategory: “general” | “academic” | “system” | “urgent”unreadOnly: booleanlimit: number
POST /api/debug/log
Submit debug information and error reports.
Request Body:
Error Handling
Common Error Responses
Authentication Error:Rate Limiting
Rate Limit Headers
All API responses include rate limiting information:Rate Limits by Endpoint Category
| Category | Limit | Window | Reset Behavior |
|---|---|---|---|
| Authentication | 10 req/min | 60s | Sliding window |
| Assessment | 50 req/min | 60s | Sliding window |
| File Upload | 20 req/min | 60s | Sliding window |
| Analytics | 100 req/min | 60s | Sliding window |
| Admin Operations | 200 req/min | 60s | Sliding window |
Webhook Endpoints
POST /api/webhooks/stripe
Handle Stripe payment webhooks.
Headers:
POST /api/webhooks/uploadthing
Handle UploadThing file processing webhooks.
Request Body: UploadThing webhook payload
API Versioning
Version Strategy
- Current Version: v1 (implicit in base path)
- Future Versions:
/api/v2/for breaking changes - Deprecation: 6-month deprecation period for breaking changes
Version Headers
Testing
API Testing Tools
- Postman Collection: Available in
/docs/api-reference/ - Swagger UI: Interactive API documentation
- cURL Examples: Provided for each endpoint
Test Environment
- Base URL:
http://localhost:3000/api - Test Data: Pre-populated test users and assessments
- Rate Limiting: Disabled in development environment