VR Packages API
VR Packages API
Manage VR APK packages for immersive learning experiences.
Endpoints
GET /api/vr-packages- List VR packages for the tenantPOST /api/vr-packages- Create a new VR package (metadata only)
GET /api/vr-packages
List all VR packages for the authenticated user's tenant.
Authentication
Requires authentication via session cookie or Bearer token.
Response
{
"packages": [
{
"id": "uuid",
"tenant_id": "uuid",
"title": "Safety Training VR",
"description": "Immersive workplace safety training",
"version": "1.0.0",
"storage_path": "tenant-id/vr/1234567890_safety.apk",
"storage_backend": "supabase",
"file_size_bytes": 52428800,
"package_name": "com.company.safetytraining",
"min_sdk": 29,
"target_platforms": ["quest2", "quest3"],
"checksum": "sha256hash",
"status": "active",
"created_at": "2025-01-15T10:00:00Z",
"created_by": "uuid"
}
]
}
Error Responses
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Authentication required |
| 404 | PROFILE_NOT_FOUND | User profile not found |
| 500 | DB_ERROR | Database error |
POST /api/vr-packages
Create a new VR package record (metadata only). For file upload, use /api/vr-packages/upload.
Authentication
Requires authentication. User must be an instructor, admin, or super_admin.
Request Body
{
"title": "Safety Training VR",
"description": "Immersive workplace safety training",
"version": "1.0.0",
"storage_path": "tenant-id/vr/1234567890_safety.apk",
"storage_backend": "supabase",
"file_size_bytes": 52428800,
"package_name": "com.company.safetytraining",
"min_sdk": 29,
"target_platforms": ["quest2", "quest3"],
"checksum": "sha256hash"
}
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Package title (1-255 chars) |
| description | string | No | Package description |
| version | string | No | Package version (default: "1.0.0") |
| storage_path | string | Yes | Path in storage bucket |
| storage_backend | string | No | "r2" or "supabase" (default: "supabase") |
| file_size_bytes | number | Yes | File size in bytes |
| package_name | string | No | Android package name |
| min_sdk | number | No | Minimum Android SDK version |
| target_platforms | array | No | Target VR platforms |
| checksum | string | No | SHA256 checksum |
Response (201 Created)
{
"package": {
"id": "uuid",
"title": "Safety Training VR",
"status": "active",
...
}
}
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request body |
| 401 | UNAUTHORIZED | Authentication required |
| 403 | FORBIDDEN | Insufficient permissions |
| 404 | PROFILE_NOT_FOUND | User profile not found |
| 500 | DB_ERROR | Database error |
Example Requests
List Packages
curl -X GET "https://api.allurelms.com/api/vr-packages" \
-H "Authorization: Bearer YOUR_TOKEN"
Create Package
curl -X POST "https://api.allurelms.com/api/vr-packages" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Safety Training VR",
"storage_path": "tenant/vr/safety.apk",
"file_size_bytes": 52428800
}'
Related
- VR Package Upload - Upload APK files
- VR Sessions - Track learner progress
- Activity Types - VR APK activity type