Encode & Securely Deliver a Database

Here's an example demonstrating how to encode a database dump (e.g., .sql, .sqlite, .csv, etc.) into a secure Locktera container with dynamic DRM and deliver it to authorized recipients.

Encode & Securely Deliver a Database

Endpoint:
POST /users/{user_id}/containers/encode

Headers:

Authorization: Bearer YOUR_API_KEY
Content-Type: multipart/form-data

Form Data:

  • manifest.json – describes DRM and access policies.

  • files – your database dump file (e.g., prod_backup.sql or customer_data.sqlite).

manifest.json Example:

{
  "container_name": "Q2_Production_DB_Backup",
  "org_id": "your-org-id",
  "dynamic": true,
  "downloadable": false,
  "recipients": [
    "lead.admin@client.com",
    "sec.engineer@auditfirm.io"
  ],
  "time": {
    "start": "2025-05-07T00:00:00Z",
    "end": "2025-06-01T23:59:59Z"
  },
  "ip": {
    "allow": ["198.51.100.10"]
  },
  "geo": {
    "block": [
      { "country": "RU" },
      { "country": "CN" }
    ]
  }
}

Example cURL Command:

curl -X POST https://dev.locktera.com/api/v1/users/1234/containers/encode \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "manifest.json=@manifest.json;type=application/json" \
  -F "files=@prod_backup.sql;type=application/octet-stream"

Result:

  • The database file is encrypted into a .tera container.

  • Only specified recipients with valid geo/IP and time context can decrypt it.

  • Downloading is disabled — content is view-only unless updated via PATCH.