Skip to main content

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

CodeHTTP StatusDescription
UNAUTHORIZED401User not authenticated
FORBIDDEN403Insufficient permissions for operation
NOT_FOUND404University, course, or resource not found
VALIDATION_ERROR400Invalid input data
CONFLICT409Resource conflict (duplicate assignment, etc.)
CAPACITY_EXCEEDED400Course capacity exceeded

Error Response Format

{
  "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

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:
CategoryDescription
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

  1. pending: Initial enrollment, payment pending
  2. active: Enrolled and access granted
  3. completed: Course finished successfully
  4. dropped: Student withdrew from course
  5. 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.