> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nullpass.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Services Overview

> Service entitlements and access management

<Warning>
  **Internal Documentation Only:** If you're not a Null Tools developer, you can close this documentation or visit the [Apps section](/apps/coming-soon) to learn more about using Null Pass in your applications.
</Warning>

## Overview

Null Pass manages access to multiple services through a unified entitlement system. Each user can have entitlements for different services with tier-based access control, custom limits, and subscription integration.

## Supported Services

<CardGroup cols={2}>
  <Card title="DROP" icon="cloud-arrow-up">
    File storage and sharing service
  </Card>

  <Card title="MAILS" icon="envelope">
    Email management service
  </Card>

  <Card title="VAULT" icon="lock">
    Crypto payment processor
  </Card>

  <Card title="DB" icon="database">
    Database service access
  </Card>
</CardGroup>

## Service Entitlement Model

Each service entitlement (`UserServiceEntitlement`) contains:

<ResponseField name="id" type="string">
  Unique entitlement ID
</ResponseField>

<ResponseField name="userId" type="string">
  User ID
</ResponseField>

<ResponseField name="service" type="ServiceIdentifier">
  Service identifier: `DROP`, `MAILS`, `VAULT`, or `DB`
</ResponseField>

<ResponseField name="tier" type="string" default="free">
  Access tier (e.g., "free", "premium", "enterprise")
</ResponseField>

<ResponseField name="isPremium" type="boolean" default="false">
  Premium access flag
</ResponseField>

<ResponseField name="accessFlags" type="object">
  Custom access flags (JSON object). Used for fine-grained permission control.

  **Example (DROP):**

  ```json theme={null}
  {
    "isNullDropTeam": Boolean,
    "nullDropTeamRole": "Role",
    "accessFilesPreview": Boolean,
    "accessFilesDownload": Boolean
  }
  ```
</ResponseField>

<Info>
  **accessFlags Values:**

  * `"founder"` - Founder role
  * `"dev"` - Developer role
  * `"moderator"` - Moderator role
  * `""` - Empty for regular member (default)
</Info>

<ResponseField name="metadata" type="object">
  Service-specific metadata (JSON object). Stores user preferences and service configuration.

  **Example (DROP):**

  ```json theme={null}
  {
    "onboarding": {
      "onboarding_completed": Boolean,
      "onboarding_uploads_completed": Boolean
    },
    "blurGalleryMedia": Boolean,
    "userAcceptedCookies": Boolean,
    "userHideProfileInfo": Boolean,
    "defaultUploadVisibility": Boolean
  }
  ```
</ResponseField>

<ResponseField name="customStorageLimit" type="number">
  Custom storage limit in bytes (null for default)
</ResponseField>

<ResponseField name="customApiKeyLimit" type="number">
  Custom API key limit (null for default)
</ResponseField>

<ResponseField name="connected" type="boolean" default="true">
  Whether service is connected/enabled
</ResponseField>

<ResponseField name="polarCustomerId" type="string">
  Polar customer ID (for subscription integration)
</ResponseField>

<ResponseField name="polarSubscriptionId" type="string">
  Polar subscription ID
</ResponseField>

<ResponseField name="polarSubscriptionStatus" type="string">
  Polar subscription status
</ResponseField>

<ResponseField name="createdAt" type="string">
  Entitlement creation timestamp
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Last update timestamp
</ResponseField>

## Database Schema

```prisma theme={null}
model UserServiceEntitlement {
  id                      String            @id @default(cuid())
  userId                  String
  service                 ServiceIdentifier
  tier                    String            @default("free")
  isPremium               Boolean           @default(false)
  accessFlags             Json?
  metadata                Json?
  connected               Boolean           @default(true)
  customStorageLimit      Int?
  customApiKeyLimit       Int?
  polarCustomerId         String?
  polarSubscriptionId     String?
  polarSubscriptionStatus String?
  createdAt               DateTime          @default(now())
  updatedAt               DateTime          @updatedAt
  user                    User              @relation(fields: [userId], references: [id], onDelete: Cascade)
}
```

## Service Identifiers

```typescript theme={null}
enum ServiceIdentifier {
  DROP
  MAILS
  VAULT
  DB
}
```

## Access Control

Service access is checked through:

1. **Tier-based**: Free, premium, enterprise tiers
2. **Premium flag**: Boolean premium access
3. **Custom limits**: Storage and API key limits
4. **Connection status**: Whether service is connected
5. **Access flags**: Custom JSON flags for fine-grained control

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Get Service Access" icon="list" href="/api-reference/services/access">
    Retrieve user's service entitlements
  </Card>

  <Card title="Update Service" icon="pen" href="/api-reference/services/access">
    Update service entitlement
  </Card>
</CardGroup>
