Overview
The Universities & Courses APIs provide comprehensive management capabilities for educational institutions, course content, trainer assignments, and student enrollment within the TalentG platform.
Base URL
https://talentg.vercel.app/api
Authentication
University and course management APIs require authentication. Access levels vary based on user roles:
Admin : Full access to all operations
Trainer : Access to assigned universities and courses
Student : Read-only access to enrolled courses
Authorization : Bearer <supabase_jwt_token>
Content-Type : application/json
University Management
List Universities
Create University
Update University
Delete University
Course Management
List Courses
Create Course
Update Course
Delete Course
Trainer Assignments
Assign Trainer to University
Get Trainer Assignments
Student Enrollment
Enroll Student
Get Course Students
Analytics & Reporting
Course Analytics
Error Handling
Common Error Codes
Code HTTP Status Description
UNAUTHORIZED401 User not authenticated FORBIDDEN403 Insufficient permissions for operation NOT_FOUND404 University, course, or resource not found VALIDATION_ERROR400 Invalid input data CONFLICT409 Resource conflict (duplicate assignment, etc.) CAPACITY_EXCEEDED400 Course capacity exceeded
{
"success" : false ,
"error" : {
"code" : "VALIDATION_ERROR" ,
"message" : "Invalid course data" ,
"details" : {
"field" : "max_students" ,
"message" : "Maximum students cannot exceed 100"
}
}
}
Rate Limiting
Read operations : 1000 requests per hour per user
Write operations : 500 requests per hour per user
Bulk operations : 50 requests per hour per user
Analytics : 100 requests per hour per user
SDK Examples
JavaScript - Create Course
Python - Get University Courses
const createCourse = async ( universityId , courseData ) => {
const token = await getSupabaseToken ();
const response = await fetch ( `/api/universities/ ${ universityId } /courses` , {
method: 'POST' ,
headers: {
'Authorization' : `Bearer ${ token } ` ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ( courseData )
});
return response . json ();
};
// Usage
const newCourse = await createCourse ( 'uni_123' , {
title: 'Advanced React Development' ,
description: 'Master modern React patterns' ,
category: 'technology' ,
trainer_id: 'user_456' ,
duration_hours: 40 ,
max_students: 25 ,
price: 20000
});
Course Categories
The following course categories are supported:
Category Description
technologyProgramming, IT, and tech skills businessManagement, finance, and business skills designUI/UX, graphic design, and creative skills marketingDigital marketing and sales skills data_scienceAnalytics, ML, and data processing soft_skillsCommunication, leadership, and interpersonal skills
Enrollment Status Flow
pending : Initial enrollment, payment pending
active : Enrolled and access granted
completed : Course finished successfully
dropped : Student withdrew from course
suspended : Temporarily suspended due to policy violation
Course deletion will permanently remove all associated enrollments, progress, and materials. Use archive status instead for inactive courses.