Services
Service Access Management
Get and update service entitlements
GET
Get Service Entitlements
Endpoints
GET /api/services
Retrieves service entitlements for the authenticated user. Can be filtered by service type.Query Parameters
string
Optional. Filter by service:
DROP, MAILS, VAULT, or DBResponse
array
Array of service entitlement objects
POST /api/services
Creates or updates a service entitlement for the authenticated user. Uses upsert logic (creates if doesn’t exist, updates if exists).Request
ServiceIdentifier
required
Service identifier:
DROP, MAILS, VAULT, or DBstring
Access tier (e.g., “free”, “premium”, “enterprise”)
Premium access flag
object
Custom access flags (JSON object)
object
Service-specific metadata (JSON object)
number
Custom storage limit in bytes
number
Custom API key limit
string
Polar customer ID
string
Polar subscription ID
string
Polar subscription status
Response
object
Created or updated entitlement object
Implementation Details
Code Reference
Status Codes
OK
Success
Bad Request
Validation error
Unauthorized
Missing or invalid authentication token
Example Requests
Get All Services
Get Specific Service
Update Service Entitlement
Upsert Behavior
The POST endpoint uses Prisma’supsert operation:
- If entitlement exists: Updates only provided fields, preserves others
- If entitlement doesn’t exist: Creates new entitlement with provided values and defaults
- Unique constraint:
userId+servicecombination must be unique
Default Values
When creating a new entitlement:tier: “free”isPremium: falseconnected: true (set by database default)customStorageLimit: nullcustomApiKeyLimit: null- Polar fields: null
Get Service Entitlements