Skip to main content

Introduction

The Study Sync API provides programmatic access to all platform features including study plan management, resource tracking, user progress, and notifications. The API is RESTful, uses JSON for request and response bodies, and requires Firebase authentication.

Base URL

https://your-domain.com/api

Authentication

All API endpoints (except some GET endpoints marked as public) require authentication using Firebase ID tokens. Include the token in the Authorization header:
Authorization: Bearer YOUR_FIREBASE_ID_TOKEN
See the Authentication page for detailed information.

Response Format

All API responses follow a consistent JSON format:

Success Response

{
  "data": {
    // Response data here
  }
}

Error Response

{
  "error": "Error message describing what went wrong"
}

HTTP Status Codes

The API uses standard HTTP status codes:
CodeDescription
200Success - Request completed successfully
201Created - Resource created successfully
400Bad Request - Invalid request parameters
401Unauthorized - Missing or invalid authentication token
403Forbidden - Authenticated but lacking permissions
404Not Found - Resource doesn’t exist
500Internal Server Error - Something went wrong on the server

Common Error Codes

error
string
Error message describing what went wrong
Common error messages:
  • "No token provided" - Missing Authorization header
  • "Invalid or expired token" - Firebase token is invalid or has expired
  • "Access denied" - User doesn’t have permission to access the resource
  • "Invalid study plan ID" - Provided ID is not a valid MongoDB ObjectId
  • "Study plan not found" - Resource with the given ID doesn’t exist

Rate Limiting

Currently, there are no rate limits enforced. This may change in the future as the platform scales.

Pagination

Endpoints that return lists support pagination through query parameters:
page
integer
default:"1"
Page number to retrieve
limit
integer
default:"9"
Number of items per page
Paginated responses include metadata:
{
  "plans": [...],
  "pagination": {
    "currentPage": 1,
    "totalPages": 5,
    "totalPlans": 42,
    "hasNextPage": true,
    "hasPrevPage": false
  }
}

Object IDs

Study Sync uses MongoDB ObjectIds for resource identification. Valid ObjectIds are 24-character hexadecimal strings. Valid: 507f1f77bcf86cd799439011 Invalid: invalid-id

API Endpoints

Study Plans

Instances

Resources

User Progress

Users

Notifications

Reviews

Background Jobs

  • GET /api/cron/reminders - Process deadline reminders (automated via Vercel Cron)
The cron endpoint is triggered automatically by Vercel Cron jobs and requires a CRON_SECRET for authorization. It processes all active instances with upcoming deadlines and sends email reminders based on user preferences.

SDKs and Libraries

Currently, there are no official SDKs. The API can be accessed using standard HTTP clients in any programming language.

Changelog

API changes and updates will be documented here.

Build docs developers (and LLMs) love