Overview
Instances represent a user’s active enrollment in a study plan. Each instance has its own schedule, reminders, and tracks completion independently. When created, instances snapshot the study plan’s resources at that moment.List Instances
GET /api/instances
Get user’s study plan instances. Requires authentication.
Query Parameters
Filter by status:
active- Currently active instancescompleted- Finished instancespaused- Paused instances
Filter by specific study plan ID
Response
Array of instance objects
Create Instance
POST /api/instances
Create a new study plan instance. Snapshots the plan’s resources at creation time.
Request Body
Study plan ID to create instance from
Start date (ISO 8601 format)
End date/deadline (ISO 8601 format). Must be after startDate.
Daily reminder time in HH:MM format
Optional resource scheduling information
Response
“Instance created successfully”
The created instance object
Get Instance
GET /api/instances/:id
Get a specific instance with full details including resources and progress.
Path Parameters
Instance ID
Response
Returns the instance object with additional fields:Array of resource objects with completion status
Full study plan details including resources
Update Instance
PUT /api/instances/:id
Update an instance. Only the owner can update.
Path Parameters
Instance ID
Request Body
All fields are optional. Only include fields to update.Start date (ISO 8601)
End date (ISO 8601)
Status:
active, completed, or pausedProgress percentage (0-100)
Reminder time (HH:MM)
Enable/disable reminders
Custom reminder schedule
Instance notes
Per-resource notes as key-value pairs:
{ resourceId: "note text" }Custom resource titles
Reorder/modify instance resources (uses snapshotResourceIds)
Response
“Instance updated successfully”
Updated instance object
Delete Instance
DELETE /api/instances/:id
Delete an instance. Only the owner can delete.
Path Parameters
Instance ID
Response
“Instance deleted successfully”
Key Concepts
Resource Snapshotting
When an instance is created, it snapshots the study plan’s resources at that moment:- Stored in
snapshotResourceIdsfield - Independent of future study plan changes
- Ensures instance stability even if plan is modified
Progress Tracking
Progress is tracked globally per user per resource:- Completing a resource in one instance marks it complete everywhere
- Use the User Progress API to manage completion status
- Instance tracks which resources are completed via
completedResourcesarray
Automatic Updates
The API automatically calculates:totalTimeandcompletedTimebased on resource metadataresourcePercentandtimePercentfor progress trackingremainingTimefor schedulinglastAccessedAtwhen instance is viewed