Skip to main content
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 DB

Response

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 DB
string
Access tier (e.g., “free”, “premium”, “enterprise”)
boolean
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’s upsert 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 + service combination must be unique

Default Values

When creating a new entitlement:
  • tier: “free”
  • isPremium: false
  • connected: true (set by database default)
  • customStorageLimit: null
  • customApiKeyLimit: null
  • Polar fields: null

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

service
enum<string>
Available options:
DROP,
MAILS,
VAULT,
DB

Response

200 - application/json

Service entitlements

entitlements
object[]