Skip to main content
Authentication Required: These endpoints require ADMIN role for export, SUPERADMIN role for import.

Export Server Data

GET /api/server/export

Export all server data including users, files, URLs, settings, and metrics.

Request

nometrics
string
Exclude metrics from export (reduces file size significantly). Any value enables this option.
counts
string
Return only entity counts instead of full export. Set to "true" to enable.
Full export with metrics
curl -X GET https://your-zipline.com/api/server/export \
  -H "Authorization: YOUR_ADMIN_TOKEN" \
  -o zipline_export.json
Export without metrics
curl -X GET "https://your-zipline.com/api/server/export?nometrics=true" \
  -H "Authorization: YOUR_ADMIN_TOKEN" \
  -o zipline_export.json
Get export counts only
curl -X GET "https://your-zipline.com/api/server/export?counts=true" \
  -H "Authorization: YOUR_ADMIN_TOKEN"

Response (Counts Only)

When counts=true:
Example Response
{
  "users": 12,
  "files": 1542,
  "urls": 89,
  "folders": 34,
  "invites": 8,
  "thumbnails": 1203,
  "metrics": 1440
}

Response (Full Export)

Returns a JSON file with the following structure:
versions
object
Version information
request
object
Export request metadata
data
object
Exported data
The export includes metadata only. Actual file contents must be backed up separately from your datasource (S3 bucket, local storage, etc.).

Import Server Data

POST /api/server/import/v4

Import data from a Zipline v4 export file.
SUPERADMIN Only: This endpoint requires SUPERADMIN role.

Request

export4
object
required
Complete Zipline v4 export object
config
object
Import configuration options
Import full export
curl -X POST https://your-zipline.com/api/server/import/v4 \
  -H "Authorization: YOUR_SUPERADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d @zipline_export.json
Import and merge with current user
curl -X POST https://your-zipline.com/api/server/import/v4 \
  -H "Authorization: YOUR_SUPERADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "export4": { ... },
    "config": {
      "mergeCurrentUser": "clxxx123456789"
    }
  }'

Response

imported
object
Count of successfully imported entities
Example Response
{
  "imported": {
    "users": 8,
    "oauthProviders": 5,
    "quotas": 3,
    "passkeys": 12,
    "folders": 28,
    "files": 1204,
    "tags": 45,
    "urls": 67,
    "invites": 4,
    "metrics": 1440
  }
}

Import Behavior

Conflict Handling

The import process skips entities that already exist:
  • Users: Skipped if username or ID already exists
  • OAuth Providers: Skipped if provider + oauthId combination exists
  • Quotas: Skipped if user already has a quota
  • Passkeys: Skipped if passkey name already exists for user
  • Folders: Skipped if folder name already exists for user
  • Files: Skipped if file name already exists
  • Tags: Skipped if tag name + user + createdAt combination exists
  • URLs: Skipped if code already exists for user
  • Invites: Skipped if invite code already exists for inviter

User Merging

When mergeCurrentUser is set:
  • Files, URLs, folders, and tags from the specified user ID are imported under your current user
  • User profile data (avatar, totpSecret, view settings) are merged
  • Useful for migrating your personal data between instances

Data Relationships

The import preserves relationships:
  • Folder parent-child hierarchies
  • File-folder associations
  • Tag-file associations
  • User ownership of all entities

Rate Limiting

This endpoint is rate-limited to 1 request per 5 seconds due to the intensive nature of imports.

Body Size Limit

Import endpoint accepts up to 24GB request body to support large exports.

Errors

  • 403 Forbidden: Not a SUPERADMIN
  • 400 Bad Request: Invalid export format
  • 429 Too Many Requests: Rate limit exceeded
Import does not restore file contents. You must separately restore actual files to your datasource. The import only restores metadata that tells Zipline about those files.

Backup Strategy

For complete backups:
  1. Export metadata: Use /api/server/export
  2. Backup datasource: Copy files from S3 bucket or local storage directory
  3. Backup database: Export PostgreSQL database
  4. Store securely: Keep exports in multiple locations
To restore:
  1. Restore database: Import PostgreSQL backup or use fresh database
  2. Import metadata: Use /api/server/import/v4
  3. Restore files: Copy files back to datasource

Export Format Versions

  • v4: Current format (Zipline v3+)
  • v3: Legacy format (deprecated)
Always use v4 for new exports. The v3 import endpoint exists for migration from older Zipline versions.

Build docs developers (and LLMs) love