Documentation Index
Fetch the complete documentation index at: https://cloud-docs.mentra.glass/llms.txt
Use this file to discover all available pages before exploring further.
Get Gallery Photos
Retrieve all photos in the user’s gallery.Endpoint
Headers
This endpoint requires glasses authentication, not regular user authentication.
Response
Success (200):Implementation
- File:
packages/cloud/src/routes/gallery.routes.ts:19-37 - Middleware:
validateGlassesAuth - Service: Uses
GalleryPhoto.findByUserId()with email from decoded token
Delete Gallery Photo
Delete a specific photo from the user’s gallery.Endpoint
Headers
Parameters
| Parameter | Type | Description |
|---|---|---|
photoId | string | The ID of the photo to delete (in URL) |
Response
Success (200):Implementation
- File:
packages/cloud/src/routes/gallery.routes.ts:44-88 - Authorization: Checks that the user owns the photo
- Cleanup: Attempts to delete physical file (non-critical)
Deletion Process
- Validates user authentication
- Verifies photo exists and user owns it
- Deletes photo record from database
- Attempts to delete physical file from
uploadsdirectory (if exists)
Error Codes
| Code | Description |
|---|---|
| 401 | Unauthorized - invalid glasses token |
| 403 | Forbidden - user doesn’t own the photo |
| 404 | Photo not found |
| 500 | Internal server error |
Data Model
Gallery photos contain:_id: Unique photo identifieruserId: Owner’s user IDuserEmail: Owner’s email addressfilename: Generated filenameuploadedAt: Upload timestampsize: File size in bytesmimeType: Image MIME typemetadata: Additional photo metadata including:requestId: The original photo request IDorigin: Source of the photo (e.g., “app”)packageName: App that requested the photo
Notes
- Gallery photos are stored in MongoDB using the
GalleryPhotomodel - Physical files are stored in the
uploadsdirectory - File deletion failures are logged but don’t fail the API request
- All endpoints require glasses authentication (not regular user authentication)
- Photos are associated with users by their email address