Dashboard API
Base path: /api/dashboard
All dashboard endpoints require JWT authentication via the Authorization: Bearer <token> header.
GET /api/dashboard/stats
Get aggregated dashboard statistics for the authenticated user.
Auth: Required (JWT) Feature gate: None
Response:
{
"success": true,
"data": {
"totalContents": 42,
"monthlyContents": 7,
"usageRate": 70,
"planLimit": 10
}
}
| Field | Type | Description |
|---|---|---|
totalContents | number | Total H5P content items across all time |
monthlyContents | number | Contents created in the current billing month |
usageRate | number | Percentage of monthly plan limit used (0-100). 0 when plan limit is unlimited (-1). |
planLimit | number | Maximum contents allowed per month for the user's plan. -1 means unlimited. |
Errors:
| Status | Body | Condition |
|---|---|---|
| 500 | { "success": false, "error": "Failed to fetch dashboard stats" } | Database query failure or user not found |
GET /api/dashboard/activity
Get recent content activity feed for the authenticated user.
Auth: Required (JWT) Feature gate: None
Response:
{
"success": true,
"data": [
{
"id": "content-uuid",
"type": "created",
"contentTitle": "World Geography Quiz",
"contentType": "H5P.MultiChoice",
"timestamp": "2026-03-20T14:30:00.000Z"
},
{
"id": "content-uuid",
"type": "edited",
"contentTitle": "World Geography Quiz",
"contentType": "H5P.MultiChoice",
"timestamp": "2026-03-21T09:15:00.000Z"
}
]
}
| Field | Type | Description |
|---|---|---|
id | string | Content identifier |
type | "created" | "edited" | "deleted" | "generated" | Activity type |
contentTitle | string | H5P content title (from h5p.json) |
contentType | string | H5P main library (e.g. H5P.MultiChoice) |
timestamp | string | ISO 8601 timestamp of the activity |
Results are sorted by timestamp descending. Maximum 10 items returned.
Errors:
| Status | Body | Condition |
|---|---|---|
| 500 | { "success": false, "error": "Failed to fetch activity" } | Database or filesystem error |
GET /api/dashboard/quick-access
Get quick access data: most frequently used content types and new feature announcements.
Auth: Required (JWT) Feature gate: None
Response:
{
"success": true,
"data": {
"frequentTypes": [
{ "type": "H5P.MultiChoice", "count": 12, "label": "Multiple Choice" },
{ "type": "H5P.Blanks", "count": 5, "label": "Fill in the Blanks" }
],
"newFeatures": [
{
"id": "branching-scenario",
"title": "Branching Scenario",
"description": "Create interactive decision-tree scenarios powered by AI"
},
{
"id": "analytics-dashboard",
"title": "Analytics Dashboard",
"description": "Track learner progress and content performance"
},
{
"id": "content-remixer",
"title": "Content Remixer",
"description": "Convert existing content to different H5P types"
}
]
}
}
| Field | Type | Description |
|---|---|---|
frequentTypes | ContentTypeUsage[] | Top 5 most used content types for this user |
frequentTypes[].type | string | H5P library identifier |
frequentTypes[].count | number | Number of contents created with this type |
frequentTypes[].label | string | Human-readable label |
newFeatures | NewFeature[] | Platform feature announcements |
newFeatures[].id | string | Feature identifier |
newFeatures[].title | string | Feature title |
newFeatures[].description | string | Feature description |
Errors:
| Status | Body | Condition |
|---|---|---|
| 500 | { "success": false, "error": "Failed to fetch quick access data" } | Database error |