VR Packages API

VR Packages API

Manage VR APK packages for immersive learning experiences.

Endpoints

  • GET /api/vr-packages - List VR packages for the tenant
  • POST /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

StatusCodeDescription
401UNAUTHORIZEDAuthentication required
404PROFILE_NOT_FOUNDUser profile not found
500DB_ERRORDatabase 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"
}
FieldTypeRequiredDescription
titlestringYesPackage title (1-255 chars)
descriptionstringNoPackage description
versionstringNoPackage version (default: "1.0.0")
storage_pathstringYesPath in storage bucket
storage_backendstringNo"r2" or "supabase" (default: "supabase")
file_size_bytesnumberYesFile size in bytes
package_namestringNoAndroid package name
min_sdknumberNoMinimum Android SDK version
target_platformsarrayNoTarget VR platforms
checksumstringNoSHA256 checksum

Response (201 Created)

{
  "package": {
    "id": "uuid",
    "title": "Safety Training VR",
    "status": "active",
    ...
  }
}

Error Responses

StatusCodeDescription
400VALIDATION_ERRORInvalid request body
401UNAUTHORIZEDAuthentication required
403FORBIDDENInsufficient permissions
404PROFILE_NOT_FOUNDUser profile not found
500DB_ERRORDatabase 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