API STATUS: 🟡 IN DEVELOPMENTSupabase Auth & RLSSpecification Phase

Tenimal API — Developer Specification

Official REST API specification for Tenimal. Architected for scalable communities, interactive video courses, watch progress metrics, creator analytics, and Supabase Row Level Security.

API Status
🟡 In Development
Current Version
v1.0 (Spec)
Protocol
REST / JSON
Authentication
Supabase Auth
Database
PostgreSQL + RLS
State
Specification Only
Specification Notice — Coming Soon:The Tenimal API is currently in specification and active development. The documented endpoints represent the planned API contract and may undergo minor revisions before production deployment.
Planned Base URL: https://api.tenimal.com

1. Overview

Core architectural parameters for integrating with the Tenimal API ecosystem.

What Tenimal API Is
Unified REST platform for communities, courses, lessons, progress, and creator analytics.
Base URL (Planned)
https://api.tenimal.com
Base URL — Coming Soon
API Version & Path
/api/v1
e.g. GET /api/v1/courses
Authentication Method
Bearer <Supabase JWT>

2. API Features & Roadmap Categories

Clear separation between Phase 1 Core API specification and Phase 2 Future extensions.

Core API (Phase 1)

Specification & Initial Architecture
🟡 In Development
Users
Profile management, bio, avatar, preferencesPlanned
Courses
Publish, edit, drafts, difficulty, categoriesPlanned
Lessons
Video lessons, sequencing, duration, free previewPlanned
Progress
Watch time (sec), completed lessons, % calculationPlanned
Creators
Creator catalogs, public stats, creator dashboardsPlanned
Analytics
Course views, active students, retention curvesPlanned
Search
Sub-25ms search query across platformPlanned
Categories
Programming, Design, Business, AI, etc.Planned
Media
Supabase Storage pre-signed upload URLsPlanned

Future Extensions (Phase 2)

Roadmap Modules & Next Releases
🔵 Planned Roadmap
Payments
Stripe & monetizationPlanned
Enrollments
Access seats & enrollment grantsPlanned
Reviews & Ratings
Course feedback & 5-star ratingsPlanned
Likes & Bookmarks
Content appreciation & saved lessonsPlanned
Comments & Threads
Community discussion threadsPlanned
Notifications
Real-time user alerts & web pushPlanned
AI Assistants
OpenAI community copilot integrationPlanned

3. Endpoints Contract Directory

Detailed specs for every endpoint: Description, Authentication requirement, Roles, and Standardized JSON Response.

GET/api/v1/users/me
Auth: RequiredRole: Student / Creator / Admin
Description:Get profile details, settings, and metadata of the currently authenticated user.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "usr_94f812a4",
    "username": "alex_dev",
    "email": "alex@tenimal.info",
    "bio": "Building next-gen open source education & tech communities.",
    "avatar_url": "https://tenimal.info/avatars/alex.png",
    "account_preferences": {
      "theme": "dark",
      "notifications_enabled": true,
      "email_digest": "weekly"
    },
    "public_profile": true,
    "role": "creator",
    "created_at": "2026-01-15T10:30:00Z"
  }
}
PATCH/api/v1/users/me
Auth: RequiredRole: Student / Creator / Admin
Description:Update bio, avatar URL, reserved username handle, or preferences for current user.
Request Payload:
{
  "bio": "Full-stack developer building AI apps on Tenimal.",
  "avatar_url": "https://tenimal.info/avatars/alex_v2.png",
  "account_preferences": {
    "theme": "system",
    "notifications_enabled": true
  }
}
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "usr_94f812a4",
    "username": "alex_dev",
    "bio": "Full-stack developer building AI apps on Tenimal.",
    "avatar_url": "https://tenimal.info/avatars/alex_v2.png",
    "updated_at": "2026-08-26T01:10:00Z"
  }
}
GET/api/v1/users/:id
Auth: PublicRole: Student / Creator / Admin
Description:Get public profile details and course catalog summary by user ID.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "usr_94f812a4",
    "username": "alex_dev",
    "bio": "Full-stack developer building AI apps on Tenimal.",
    "avatar_url": "https://tenimal.info/avatars/alex.png",
    "public_profile": true,
    "joined_at": "2026-01-15T10:30:00Z"
  }
}
GET/api/v1/courses
Auth: PublicRole: Student / Creator / Admin
Description:Retrieve paginated list of published courses with category filtering and difficulty level search.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "courses": [
      {
        "id": "course_123",
        "title": "JavaScript Mastery",
        "slug": "javascript-mastery",
        "description": "Master modern ES6+, async patterns, V8 engine internals & web APIs.",
        "category": "Programming",
        "difficulty_level": "Intermediate",
        "status": "published",
        "lessons_count": 20,
        "is_featured": true,
        "creator_id": "usr_94f812a4"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "total_items": 42,
      "total_pages": 5
    }
  }
}
GET/api/v1/courses/:id
Auth: PublicRole: Student / Creator / Admin
Description:Get details of a specific course including lesson syllabus structure.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "course_123",
    "title": "JavaScript Mastery",
    "slug": "javascript-mastery",
    "description": "Master modern ES6+, async patterns, V8 engine internals & web APIs.",
    "category": "Programming",
    "difficulty_level": "Intermediate",
    "status": "published",
    "lessons_count": 20,
    "total_duration_sec": 28800,
    "is_featured": true,
    "creator": {
      "id": "usr_94f812a4",
      "username": "alex_dev",
      "avatar_url": "https://tenimal.info/avatars/alex.png"
    }
  }
}
POST/api/v1/courses
Auth: RequiredRole: Creator / Admin
Description:Create a new course draft under the authenticated creator's profile.
Request Payload:
{
  "title": "Building Real-Time Apps with Supabase & React",
  "category": "Programming",
  "difficulty_level": "Intermediate",
  "description": "Learn RLS, WebSockets, and Postgres functions step-by-step.",
  "status": "draft"
}
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "course_456",
    "title": "Building Real-Time Apps with Supabase & React",
    "status": "draft",
    "creator_id": "usr_94f812a4",
    "created_at": "2026-08-26T01:12:00Z"
  }
}
PATCH/api/v1/courses/:id
Auth: RequiredRole: Creator (Own) / Admin
Description:Update course metadata, publish/unpublish draft, or change course details.
Request Payload:
{
  "status": "published",
  "is_featured": true
}
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "course_123",
    "status": "published",
    "updated_at": "2026-08-26T01:15:00Z"
  }
}
DELETE/api/v1/courses/:id
Auth: RequiredRole: Creator (Own) / Admin
Description:Delete a course and unlink associated lesson entries.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "deleted": true,
    "id": "course_123",
    "message": "Course deleted successfully"
  }
}
GET/api/v1/courses/:id/lessons
Auth: Optional / PublicRole: Student / Creator / Admin
Description:Get ordered sequence of lessons for a course with duration & preview lock flags.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "course_id": "course_123",
    "lessons": [
      {
        "id": "les_01",
        "order": 1,
        "title": "Introduction to V8 & Event Loop",
        "duration_sec": 720,
        "is_free": true
      },
      {
        "id": "les_02",
        "order": 2,
        "title": "Promises & Async/Await",
        "duration_sec": 1140,
        "is_free": false
      }
    ]
  }
}
POST/api/v1/courses/:id/lessons
Auth: RequiredRole: Creator (Own) / Admin
Description:Add a new video or text lesson to a course syllabus.
Request Payload:
{
  "title": "Closures & Garbage Collection",
  "description": "Memory allocation and lexical environments in JS.",
  "order": 3,
  "duration_sec": 900,
  "is_free": false,
  "video_url": "https://tenimal.info/videos/les_03.mp4"
}
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "les_03",
    "course_id": "course_123",
    "order": 3,
    "title": "Closures & Garbage Collection"
  }
}
PATCH/api/v1/lessons/:id
Auth: RequiredRole: Creator (Own) / Admin
Description:Update lesson title, video URL, duration, or sequence position.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "les_03",
    "title": "Closures & Garbage Collection (Updated)",
    "updated_at": "2026-08-26T01:20:00Z"
  }
}
DELETE/api/v1/lessons/:id
Auth: RequiredRole: Creator (Own) / Admin
Description:Delete a lesson from a course.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "deleted": true,
    "id": "les_03"
  }
}
GET/api/v1/courses/:id/progress
Auth: RequiredRole: Student / Creator / Admin
Description:Get authenticated student's completion summary, completed lessons count, and watch time for a course.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "course_id": "course_123",
    "course_title": "JavaScript Mastery",
    "total_lessons": 20,
    "completed_lessons": 13,
    "completion_percentage": 65,
    "last_position_sec": 14520,
    "last_watched_lesson": {
      "id": "les_13",
      "title": "Async Generators"
    }
  }
}
POST/api/v1/lessons/:id/progress
Auth: RequiredRole: Student
Description:Initialize progress tracking or record a start event for a lesson.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "lesson_id": "les_13",
    "status": "in_progress",
    "started_at": "2026-08-26T01:22:00Z"
  }
}
PATCH/api/v1/lessons/:id/progress
Auth: RequiredRole: Student
Description:Update current video position (seconds) and mark lesson complete when finished.
Request Payload:
{
  "watch_time_sec": 840,
  "last_position_sec": 840,
  "completed": true
}
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "lesson_id": "les_13",
    "completed": true,
    "course_progress": {
      "completed_lessons": 14,
      "total_lessons": 20,
      "completion_percentage": 70
    }
  }
}
GET/api/v1/creators
Auth: PublicRole: Student / Creator / Admin
Description:Get list of top course creators on Tenimal.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": [
    {
      "id": "usr_94f812a4",
      "username": "alex_dev",
      "bio": "Software Architect & Educator",
      "courses_count": 5,
      "students_count": 12450
    }
  ]
}
GET/api/v1/creators/:id
Auth: PublicRole: Student / Creator / Admin
Description:Get detailed profile and public course catalog of a specific creator.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "id": "usr_94f812a4",
    "username": "alex_dev",
    "bio": "Software Architect & Educator",
    "stats": {
      "total_courses": 5,
      "total_students": 12450,
      "avg_rating": 4.9
    },
    "courses": [
      {
        "id": "course_123",
        "title": "JavaScript Mastery",
        "students": 4800
      }
    ]
  }
}
PATCH/api/v1/creators/me
Auth: RequiredRole: Creator / Admin
Description:Update creator dashboard settings, bio, and payout options.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "creator_id": "usr_94f812a4",
    "updated": true
  }
}
GET/api/v1/creator/analytics
Auth: RequiredRole: Creator (Own) / Admin
Description:Get global creator dashboard performance metrics: views, active students, and overall completion rates.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "period": "monthly",
    "metrics": {
      "total_views": 184500,
      "active_students": 8920,
      "overall_completion_rate": "78.4%",
      "avg_lesson_retention": "84.2%"
    }
  }
}
GET/api/v1/search?q=javascript
Auth: PublicRole: Student / Creator / Admin
Description:Unified fast search across Courses, Creators, Lessons, and Categories.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "query": "javascript",
    "results": {
      "courses": [
        {
          "id": "course_123",
          "title": "JavaScript Mastery"
        }
      ],
      "creators": [
        {
          "id": "usr_94f812a4",
          "username": "alex_dev"
        }
      ],
      "lessons": [
        {
          "id": "les_01",
          "title": "Intro to JS V8"
        }
      ],
      "categories": [
        {
          "id": "cat_prog",
          "name": "Programming"
        }
      ]
    }
  }
}
GET/api/v1/categories
Auth: PublicRole: Student / Creator / Admin
Description:Get all active platform course categories.
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": [
    {
      "id": "cat_prog",
      "name": "Programming",
      "slug": "programming"
    },
    {
      "id": "cat_des",
      "name": "Design",
      "slug": "design"
    },
    {
      "id": "cat_biz",
      "name": "Business",
      "slug": "business"
    },
    {
      "id": "cat_ai",
      "name": "AI",
      "slug": "ai"
    }
  ]
}
POST/api/v1/media/upload-url
Auth: RequiredRole: Creator / Admin
Description:Generate a controlled pre-signed upload URL for Supabase Storage with RLS validation.
Request Payload:
{
  "file_name": "lesson_14_hd.mp4",
  "file_type": "video/mp4",
  "bucket": "course-videos"
}
Standard Response Format:200 / 201 OK
{
  "success": true,
  "data": {
    "upload_url": "https://xyz.supabase.co/storage/v1/object/upload/sign/course-videos/usr_94f812a4/lesson_14.mp4?token=...",
    "expires_in_sec": 900
  }
}

4. Authentication Architecture

Tenimal delegates authentication to Supabase Auth. Every API request carries a JWT bearer token evaluated directly against PostgreSQL Row Level Security (RLS).

Authentication & Authorization Token Flow:
Tenimal App
Client Frontend
↓
Supabase Auth
JWT Issuance
↓
Access Token
Bearer <JWT>
↓
Tenimal API
REST Gateway
↓
Supabase + RLS
Postgres Security

5. Role Permissions Matrix

Exact permissions matrix mapping roles to feature operations.

FeatureStudentCreatorAdmin
View courses✅✅✅
Create course❌✅✅
Edit own course❌✅✅
Delete own course❌✅✅
Manage users❌❌✅
Analytics❌OwnAll

6. Error Handling Schema

Standardized error response structure returned by all Tenimal API endpoints upon failure.

Standardized Error Format:
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}
400 BAD_REQUESTInvalid request body or parameters.
401 UNAUTHORIZEDMissing or invalid Supabase JWT token.
403 FORBIDDENAuthenticated user lacks permission for operation.
404 NOT_FOUNDTarget resource or course ID does not exist.
429 RATE_LIMITEDRequest limit exceeded for current window.
500 INTERNAL_SERVER_ERRORUnhandled platform runtime exception.

7. Planned Rate Limits

Target rate limiting policies for production API access (Planned Policy).

Public API (Planned)
60 req/min

Applies to unauthenticated requests like course discovery, category listing, and search.

Authenticated API (Planned)
120 req/min

Applies to authenticated requests carrying a valid Supabase JWT access token.

8. SDK & Code Examples

Simulated code snippets for cURL, JavaScript, Python, and TypeScript SDK.

curl -X GET "https://api.tenimal.com/api/v1/users/me" \
  -H "Authorization: Bearer YOUR_SUPABASE_JWT_TOKEN"
Selected Endpoint: /api/v1/users/meAPI Status: In Development (Simulated Specification)

9. API Specification Changelog

Historical record of API contract revisions and planned future updates.

v1.0Initial API Specification
August 2026
  • Initial API specification released for public review.
  • Authentication architecture defined with Supabase Auth (JWT) & Postgres RLS.
  • Core Users, Courses, Lessons, Progress, Creators, Analytics, Search, and Category schemas finalized.
  • Standardized error handling payload specification defined (` success: false, error: ... `).
  • Rate limiting policies proposed (60 req/min public, 120 req/min authenticated).
  • Media upload strategy defined using Supabase Storage pre-signed URLs.
v1.1 (Planned)Course Enrollment & Community Interactions
Target: Q1 2027
  • Course enrollment and seat allocation endpoints (`POST /api/v1/courses/:id/enroll`).
  • Saved bookmarks and lesson favorites endpoints.
  • Community lesson comments and threaded discussions API.
  • Stripe integration endpoints for paid courses and digital goods.

10. Development & Release Roadmap

The step-by-step technical progression towards deploying api.tenimal.com to production.

Step 1 ✅
API Documentation
Step 2 ✅
API Specification
Step 3 ⏳
Database Schema
Step 4
Actual API Build
Step 5
Integration Testing
Step 6
api.tenimal.com
Step 7 🚀
TENIMAL API V1
Tenimal Developer Program

Get Early API Access

Reserve your username handle now to join our early developer preview ahead of our public launch in January 2027.