Version: 1.0.0
Base URL: https://your-supabase-project.supabase.co/rest/v1
Authentication: Bearer Token (JWT from Supabase Auth)
- Project Overview
- Authentication
- Data Models
- Core APIs
- Real-time Features
- Error Handling
- Rate Limiting
- Webhooks
IIIT Social is a comprehensive campus social platform featuring:
- Dual Identity System: Public and Anonymous personas
- Smart Team Formation: AI-powered matching using vector embeddings
- Campus Marketplace: Gig economy for students
- Event Discovery: Unified event feed with squad formation
- Anonymous Boards: Safe space for discussions
- Real-time Messaging: Direct communication channels
- Backend: Supabase (PostgreSQL + Auth + Storage + Edge Functions)
- AI/ML: Vector embeddings for semantic matching
- Real-time: Supabase Realtime for live updates
- Storage: File storage for avatars and resumes
POST /auth/v1/signup
Content-Type: application/json
{
"email": "student@iiit.ac.in",
"password": "securePassword123",
"data": {
"full_name": "John Doe",
"student_id": "2021101001"
}
}POST /auth/v1/token?grant_type=password
Content-Type: application/json
{
"email": "student@iiit.ac.in",
"password": "securePassword123"
}POST /auth/v1/token?grant_type=refresh_token
Content-Type: application/json
{
"refresh_token": "your_refresh_token"
}Authorization: Bearer <your_jwt_token>
apikey: <your_supabase_anon_key>
Content-Type: application/jsoninterface PublicProfile {
id: string; // UUID
user_id: string; // FK to auth.users
full_name: string;
avatar_url?: string;
resume_text?: string;
skills_vector?: number[]; // AI-generated embeddings
academic_goals: {
[course_id: string]: string; // Flexible personality description
};
social_battery: string; // Flexible personality description
github_url?: string;
linkedin_url?: string;
reputation_score: number;
created_at: string;
updated_at: string;
}interface AnonProfile {
id: string;
user_id: string; // FK to auth.users
handle: string; // e.g., "Quantum Potato"
avatar_seed: string; // For generated avatars
karma: number;
created_at: string;
}interface MarketItem {
id: string;
creator_id: string; // FK to public_profiles
type: 'food_run' | 'study_help' | 'survey' | 'skill_trade';
title: string;
description: string;
reward: string;
location?: string;
deadline?: string;
status: 'open' | 'claimed' | 'completed' | 'cancelled';
claimer_id?: string; // FK to public_profiles
max_participants?: number;
current_participants: number;
tags: string[];
created_at: string;
updated_at: string;
}interface MatchRequest {
id: string;
user_id: string;
context: string; // e.g., "CS101_Project", "Hackathon_2024", "event_buddy"
course_code?: string; // e.g., "CS101", "MATH202"
event_name?: string; // e.g., "Hackathon 2024", "Cultural Fest"
role_needed?: string;
min_commitment: 'low' | 'medium' | 'high';
skills_required: string[];
description: string;
deadline?: string;
requirements_embedding?: number[];
status: 'active' | 'matched' | 'cancelled';
created_at: string;
}interface MatchResult {
user: PublicProfile;
match_score: number; // 0-100
compatibility_factors: {
academic_alignment: number;
skill_overlap: number;
commitment_match: number;
social_compatibility: number;
};
reason: string;
}interface Event {
id: string;
title: string;
description: string;
event_type: 'academic' | 'cultural' | 'sports' | 'hackathon' | 'workshop';
organizer: string;
location: string;
start_time: string;
end_time: string;
max_attendees?: number;
current_attendees: number;
tags: string[];
image_url?: string;
external_link?: string;
status: 'upcoming' | 'ongoing' | 'completed' | 'cancelled';
created_at: string;
}interface AnonymousPost {
id: string;
author_id: string; // FK to anon_profiles
board: string; // e.g., "confessions", "course_reviews"
content: string;
upvotes: number;
downvotes: number;
comment_count: number;
tags: string[];
is_reported: boolean;
created_at: string;
}interface SwipeAction {
id: string;
user_id: string;
target_id: string; // Profile, marketplace item, or match request
target_type: 'team_match' | 'event_match' | 'marketplace';
action: 'like' | 'pass' | 'super_like';
created_at: string;
}interface Match {
id: string;
user1_id: string;
user2_id: string;
match_type: 'team' | 'event' | 'marketplace';
context_id: string; // Match request or marketplace item ID
match_score: number;
status: 'pending' | 'active' | 'archived';
created_at: string;
}interface AnonymousGroup {
id: string;
name: string;
description: string;
group_type: 'study' | 'hobby' | 'support' | 'project' | 'general';
avatar_seed: string; // For generated group avatar
is_private: boolean;
max_members?: number;
current_member_count: number;
tags: string[];
created_by: string; // FK to anon_profiles
created_at: string;
}interface GroupMember {
id: string;
group_id: string;
anon_profile_id: string;
role: 'admin' | 'moderator' | 'member';
display_name: string; // Can differ from main anon handle
joined_at: string;
last_active: string;
}interface GroupMessage {
id: string;
group_id: string;
sender_id: string; // FK to group_members
content: string;
message_type: 'text' | 'image' | 'poll';
reply_to?: string; // FK to another message
upvotes: number;
created_at: string;
}GET /profiles_public?user_id=eq.{user_id}PATCH /profiles_public?user_id=eq.{user_id}
Content-Type: application/json
{
"full_name": "Updated Name",
"resume_text": "Updated resume content",
"academic_goals": {
"CS101": "Aiming for top grades, willing to put in extra hours",
"HSS": "Just want to pass and learn the basics"
},
"social_battery": "I enjoy working in small focused groups, prefer deep conversations over large gatherings"
}GET /profiles_anon?user_id=eq.{user_id}POST /functions/v1/generate-embedding
Content-Type: application/json
{
"resume_text": "Software engineer with 3 years experience...",
"academic_info": "Computer Science student, interested in AI/ML"
}GET /marketplace_items?status=eq.open&order=created_at.descGET /marketplace_items?type=eq.food_run&status=eq.openPOST /marketplace_items
Content-Type: application/json
{
"type": "food_run",
"title": "Need someone to get Tantra noodles",
"description": "Will pay 50 INR extra for delivery",
"reward": "50 INR tip",
"location": "Hostel Block A",
"deadline": "2024-01-24T18:00:00Z",
"max_participants": 1,
"tags": ["food", "urgent"]
}POST /rpc/claim_marketplace_item
Content-Type: application/json
{
"item_id": "uuid-here",
"claimer_message": "I can get this in 30 minutes"
}POST /rpc/complete_marketplace_item
Content-Type: application/json
{
"item_id": "uuid-here",
"rating": 5,
"feedback": "Great service!"
}POST /match_requests
Content-Type: application/json
{
"context": "CS101_Assignment_3",
"course_code": "CS101",
"role_needed": "Backend Developer",
"min_commitment": "medium",
"skills_required": ["Python", "Django", "PostgreSQL"],
"description": "Need help with database design for our project",
"deadline": "2024-02-01T23:59:59Z"
}POST /match_requests
Content-Type: application/json
{
"context": "event_buddy",
"event_name": "CodeFest Hackathon 2024",
"role_needed": "Frontend Developer",
"min_commitment": "high",
"skills_required": ["React", "TypeScript", "UI/UX"],
"description": "Looking for a frontend expert to team up for the hackathon",
"deadline": "2024-02-15T09:00:00Z"
}POST /functions/v1/find-teammates
Content-Type: application/json
{
"context": "CS101_Assignment_3",
"skills_required": ["Python", "Django"],
"commitment_level": "medium",
"max_results": 10
}Response:
{
"matches": [
{
"user": {
"id": "uuid-here",
"full_name": "Jane Doe",
"avatar_url": "...",
"reputation_score": 4.8
},
"match_score": 92,
"compatibility_factors": {
"academic_alignment": 95,
"skill_overlap": 88,
"commitment_match": 100,
"social_compatibility": 85
},
"reason": "Strong Python skills, similar commitment level, excellent past collaboration ratings"
}
]
}POST /rpc/accept_team_match
Content-Type: application/json
{
"match_request_id": "uuid-here",
"partner_id": "uuid-here",
"message": "Looking forward to working together!"
}GET /rpc/get_team_swipe_queue?match_request_id=uuid-here&limit=20Response:
{
"candidates": [
{
"profile": {
"id": "uuid-here",
"full_name": "Jane Doe",
"avatar_url": "...",
"skills_vector": [...],
"reputation_score": 4.8
},
"match_score": 92,
"compatibility_factors": {
"academic_alignment": 95,
"skill_overlap": 88,
"commitment_match": 100,
"social_compatibility": 85
},
"preview_reason": "Strong Python skills, high collaboration rating"
}
],
"queue_position": 1,
"total_candidates": 15
}GET /rpc/get_marketplace_swipe_queue?user_location=string&item_type=string&limit=20GET /rpc/get_event_swipe_queue?event_id=uuid-here&limit=20POST /swipe_actions
Content-Type: application/json
{
"target_id": "uuid-here",
"target_type": "team_match",
"action": "like"
}GET /matches?user_id=eq.{user_id}&status=eq.active&order=created_at.descGET /rpc/get_team_match_list?match_request_id=uuid-here&sort_by=match_score&limit=50GET /marketplace_items?status=eq.open&order=match_score.descResponse includes match_score for personalized ranking based on user profile.
GET /events?status=eq.upcoming&order=start_time.ascGET /events?event_type=eq.hackathon&start_time=gte.2024-01-24T00:00:00ZPOST /event_participants
Content-Type: application/json
{
"event_id": "uuid-here",
"looking_for_squad": true,
"preferred_squad_size": 4,
"skills_offered": ["React", "Node.js"]
}GET /rpc/find_event_squad?event_id=uuid-here&max_results=5GET /anonymous_posts?board=eq.confessions&order=created_at.descPOST /anonymous_posts
Content-Type: application/json
{
"board": "course_reviews",
"content": "CS101 midterm was unexpectedly difficult...",
"tags": ["CS101", "midterm", "difficulty"]
}POST /rpc/vote_anonymous_post
Content-Type: application/json
{
"post_id": "uuid-here",
"vote_type": "upvote" // or "downvote"
}POST /rpc/report_post
Content-Type: application/json
{
"post_id": "uuid-here",
"reason": "inappropriate_content",
"details": "Contains offensive language"
}GET /anonymous_groups?order=current_member_count.descGET /anonymous_groups?group_type=eq.study&tags=cs.{"CS101","algorithms"}POST /anonymous_groups
Content-Type: application/json
{
"name": "CS101 Study Squad",
"description": "Anonymous study group for CS101 students to share notes and discuss concepts",
"group_type": "study",
"is_private": false,
"max_members": 50,
"tags": ["CS101", "algorithms", "study"]
}POST /rpc/join_anonymous_group
Content-Type: application/json
{
"group_id": "uuid-here",
"display_name": "Quantum Potato" // Can differ from main anon handle
}POST /rpc/leave_anonymous_group
Content-Type: application/json
{
"group_id": "uuid-here"
}GET /group_messages?group_id=eq.uuid-here&order=created_at.desc&limit=50POST /group_messages
Content-Type: application/json
{
"group_id": "uuid-here",
"content": "Has anyone figured out question 3 on the assignment?",
"message_type": "text"
}GET /group_members?group_id=eq.uuid-herePOST /rpc/update_group_member_role
Content-Type: application/json
{
"group_id": "uuid-here",
"member_id": "uuid-here",
"new_role": "moderator"
}POST /rpc/create_dm_channel
Content-Type: application/json
{
"other_user_id": "uuid-here",
"initial_message": "Hi! Saw your marketplace post about CS help"
}POST /messages
Content-Type: application/json
{
"channel_id": "uuid-here",
"content": "When would be a good time to meet?",
"message_type": "text"
}GET /messages?channel_id=eq.uuid-here&order=created_at.ascGET /notifications?user_id=eq.{user_id}&is_read=eq.false&order=created_at.descinterface Notification {
id: string;
user_id: string;
type: 'team_match' | 'marketplace_claim' | 'event_reminder' | 'message' |
'group_invite' | 'post_reply' | 'reputation_change';
title: string;
content: string;
action_url?: string;
is_read: boolean;
created_at: string;
}PATCH /notifications?id=eq.{notification_id}
Content-Type: application/json
{
"is_read": true
}POST /rpc/mark_all_notifications_readPOST /rpc/global_search
Content-Type: application/json
{
"query": "machine learning",
"filters": {
"types": ["users", "groups", "marketplace", "events"],
"tags": ["AI", "ML"]
},
"limit": 20
}POST /rpc/search_users_by_skills
Content-Type: application/json
{
"skills": ["React", "Node.js"],
"min_reputation": 4.0,
"limit": 10
}POST /rpc/discover_similar_users
Content-Type: application/json
{
"based_on": "skills_and_interests",
"limit": 15
}GET /rpc/get_trending_topics?time_window=24h&limit=10Response:
{
"topics": [
{
"tag": "CS101",
"mention_count": 47,
"growth_rate": 2.3,
"context": "exam_prep"
}
]
}const subscription = supabase
.channel('marketplace')
.on('postgres_changes', {
event: '*',
schema: 'public',
table: 'marketplace_items'
}, handleMarketplaceUpdate)
.subscribe()const messageSubscription = supabase
.channel(`channel:${channelId}`)
.on('postgres_changes', {
event: 'INSERT',
schema: 'public',
table: 'messages',
filter: `channel_id=eq.${channelId}`
}, handleNewMessage)
.subscribe()const boardSubscription = supabase
.channel('anonymous_boards')
.on('postgres_changes', {
event: 'INSERT',
schema: 'public',
table: 'anonymous_posts'
}, handleNewPost)
.subscribe()const groupSubscription = supabase
.channel(`group:${groupId}`)
.on('postgres_changes', {
event: 'INSERT',
schema: 'public',
table: 'group_messages',
filter: `group_id=eq.${groupId}`
}, handleGroupMessage)
.subscribe()const matchSubscription = supabase
.channel(`matches:${userId}`)
.on('postgres_changes', {
event: 'INSERT',
schema: 'public',
table: 'matches',
filter: `user1_id=eq.${userId}||user2_id=eq.${userId}`
}, handleNewMatch)
.subscribe()const notificationSubscription = supabase
.channel(`notifications:${userId}`)
.on('postgres_changes', {
event: 'INSERT',
schema: 'public',
table: 'notifications',
filter: `user_id=eq.${userId}`
}, handleNotification)
.subscribe(){
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input data",
"details": {
"field": "email",
"reason": "Invalid email format"
},
"timestamp": "2024-01-24T10:30:00Z",
"request_id": "req_123456789"
}
}| Code | Status | Description |
|---|---|---|
UNAUTHORIZED |
401 | Invalid or expired token |
FORBIDDEN |
403 | Insufficient permissions |
VALIDATION_ERROR |
400 | Invalid input data |
NOT_FOUND |
404 | Resource not found |
CONFLICT |
409 | Resource already exists |
RATE_LIMITED |
429 | Too many requests |
INTERNAL_ERROR |
500 | Server error |
{
"error": {
"code": "EMBEDDING_GENERATION_FAILED",
"message": "Failed to generate skill embeddings",
"details": {
"provider": "openai",
"reason": "API quota exceeded"
}
}
}| Category | Limit | Window |
|---|---|---|
| Authentication | 10 requests | 1 minute |
| Profile Updates | 20 requests | 5 minutes |
| Marketplace | 100 requests | 1 minute |
| Team Matching | 50 requests | 5 minutes |
| Messaging | 200 requests | 1 minute |
| Anonymous Posts | 30 requests | 5 minutes |
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200{
"event": "marketplace.item.claimed",
"data": {
"item_id": "uuid-here",
"creator_id": "uuid-here",
"claimer_id": "uuid-here",
"claimed_at": "2024-01-24T10:30:00Z"
}
}{
"event": "team.match.found",
"data": {
"match_request_id": "uuid-here",
"requester_id": "uuid-here",
"matched_user_id": "uuid-here",
"match_score": 92,
"matched_at": "2024-01-24T10:30:00Z"
}
}{
"event": "anonymous.post.reported",
"data": {
"post_id": "uuid-here",
"reporter_id": "uuid-here",
"reason": "inappropriate_content",
"reported_at": "2024-01-24T10:30:00Z"
}
}{
"event": "swipe.match.created",
"data": {
"match_id": "uuid-here",
"user1_id": "uuid-here",
"user2_id": "uuid-here",
"match_type": "team",
"match_score": 92,
"created_at": "2024-01-24T10:30:00Z"
}
}{
"event": "group.created",
"data": {
"group_id": "uuid-here",
"name": "CS101 Study Squad",
"group_type": "study",
"created_by": "uuid-here",
"created_at": "2024-01-24T10:30:00Z"
}
}{
"event": "group.member.joined",
"data": {
"group_id": "uuid-here",
"member_id": "uuid-here",
"display_name": "Quantum Potato",
"joined_at": "2024-01-24T10:30:00Z"
}
}POST /functions/v1/generate-test-data
Content-Type: application/json
{
"type": "users",
"count": 50
}POST /functions/v1/generate-test-data
Content-Type: application/json
{
"type": "marketplace",
"count": 20
}GET /healthResponse:
{
"status": "healthy",
"version": "1.0.0",
"timestamp": "2024-01-24T10:30:00Z",
"services": {
"database": "operational",
"auth": "operational",
"storage": "operational",
"edge_functions": "operational",
"realtime": "operational"
}
}- Documentation: Full API Reference
- Community: Discord Server
- Issues: GitHub Repository
- Email: api-support@iiitsocial.com
Last Updated: January 24, 2026
API Version: 1.0.0