Skip to main content

Get App Permissions

Retrieve permissions for a specific app.

Endpoint

Headers

Parameters

Response

Success (200):
Error (403):
Error (404):
Error (500):

Implementation

  • File: packages/cloud/src/routes/permissions.routes.ts:24-76
  • Middleware: validateCoreToken
  • Authorization: Checks app ownership or published status

Access Control

Users can view permissions if:
  • App is published in the app store (appStoreStatus === 'PUBLISHED')
  • User’s organization owns the app (via X-Org-Id header)
  • User is the app developer (email matches developerId)
  • User is member of the app’s organization

Update App Permissions

Update permissions for an app you own.

Endpoint

Headers

Parameters

Request Body

Response

Success (200): Returns the updated app object with new permissions. Error (400):
Error (403):
Error (404):
Error (500):

Implementation

  • File: packages/cloud/src/routes/permissions.routes.ts:83-155
  • Validation: Validates permission types against PermissionType enum from SDK
  • Authorization: Requires app ownership

Permission Types

Available permission types (from @mentra/sdk):
  • MICROPHONE - Access to device microphone
  • LOCATION - Access to device location
  • BACKGROUND_LOCATION - Access to location in background
  • CALENDAR - Access to device calendar
  • CAMERA - Access to device camera
  • NOTIFICATIONS - Legacy notification permission (backward compatibility)
  • READ_NOTIFICATIONS - Access to read notifications
  • POST_NOTIFICATIONS - Access to post notifications
  • ALL - All available permissions

Permission Object Structure

Each permission must include:
  • type: One of the valid PermissionType enum values
  • description: String explaining why the app needs this permission (optional but recommended)

Error Codes

Notes

  • Each permission should include a description explaining its use to users
  • Permissions are validated against the SDK’s PermissionType enum
  • Organization context can be provided via X-Org-Id header
  • Only app owners can modify permissions
  • All users can view permissions for published apps
  • The endpoint uses MongoDB’s findOneAndUpdate to ensure atomic updates
  • Console logs are present in the code for debugging (lines 44-45, 51)