API Data Models
The structured formats used across all HouseLearning API endpoints. These models define how data is stored, returned, and validated.
User
Represents an authenticated or public user.
User Object
{
"id": "5351",
"name": "Alex",
"email": "alex@example.com",
"joined": "2023-10-14T05:22:00Z",
"role": "student",
"avatar": "https://cdn.houselearning.io/avatars/5351.png"
}
Fields
- id — Unique user UUID
- name — Display name
- email — Login email
- joined — ISO string of create date
- role — student, teacher, admin
- avatar — URL for profile image
Lesson
Represents educational content inside HouseLearning.
Lesson Object
{
"id": "LSN-103",
"title": "Introduction to Math",
"path": "/lessons/math/intro",
"type": "lesson",
"isQuizAttached": true,
"updatedAt": "2024-03-02T14:10:00Z"
}
- id — Unique lesson ID
- title — Human-readable title
- path — URL path for the content
- type — lesson, quiz, worksheet
- isQuizAttached — Boolean
- updatedAt — Last modified timestamp
Analytics
Tracks page views and engagement.
Analytics Object
{
"path": "/docs/getting-started",
"views": 1284,
"uniqueUsers": 412,
"lastView": "2024-04-10T18:20:00Z"
}
- path — URL path being tracked
- views — Total visits
- uniqueUsers — Count of distinct visitors
- lastView — Timestamp of most recent hit
Error Response
Returned whenever an endpoint fails.
Error Object
{
"error": true,
"code": 404,
"message": "Resource not found",
"docs": "/docs/api/errors"
}
- error — Always true
- code — HTTP status code
- message — Human-readable explanation
- docs — Related documentation link