Get Profile
Retrieves the authenticated user’s profile. Automatically creates a profile if one doesn’t exist.Response
User profile object
Example Request
Example Response
Update Profile
Updates the authenticated user’s profile information.Request Body
User display name
User biography/description
Profile image URL
Preferred currency (ISO 4217 code)
Response
Updated profile object
Example Request
Delete Account
Deletes the authenticated user’s account and all associated data.Response
Success confirmation message
Example Request
Notes
List Learners (Admin/Instructor)
Retrieves a list of all learners (users with user_type = “user”). Requires admin or instructor authentication.Query Parameters
Search by name or email
Filter by enrollment status: “all”, “enrolled”, “not-enrolled”
Response
Array of learner objects
Example Request
Example Response
Get Learner Purchases (Admin/Instructor)
Retrieves all purchases (payments) for a specific learner. Requires admin or instructor authentication.Path Parameters
Learner UUID
Response
Array of purchase objects
Example Request
User Types
The platform supports three user types:| User Type | Description | Permissions |
|---|---|---|
| user | Regular learner | Enroll in courses, view content, submit quizzes |
| instructor | Course creator | All learner permissions + create courses |
| admin | Platform administrator | Full access to all features and data |
Profile Auto-Creation
When a new user signs up, the GET/api/profile endpoint automatically:
- Checks if a profile exists
- If not, creates one with:
user_type: “user” (default)name: Derived from email or user metadatacurrency: “USD” (default)
- Returns the profile
Error Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Profile or user not found |
| 500 | Internal Server Error |