Automate Secure Document Upload into a Locktera Container

Use Case:
A document is uploaded through your application (e.g., user portal or admin panel). Once received, the backend:

  1. Generates a DRM manifest.

  2. Encodes the uploaded document into a .tera container.

  3. Applies dynamic access rules.

  4. Sends confirmation or audit log.

Backend Workflow Pseudocode (Python-style)

import requests

def handle_document_upload(file_path, recipient_email):
    api_url = "https://dev.locktera.com/api/v1/users/{user_id}/containers/encode"
    headers = {"Authorization": "Bearer YOUR_API_KEY"}

    # Create DRM manifest
    manifest = {
        "container_name": "HR_Onboarding_Package",
        "org_id": "your-org-id",
        "dynamic": True,
        "downloadable": False,
        "recipients": [recipient_email],
        "time": {
            "start": "2025-05-06T09:00:00Z",
            "end": "2025-05-20T17:00:00Z"
        }
    }

    # Write manifest.json to disk
    with open("manifest.json", "w") as f:
        json.dump(manifest, f)

    # Submit encoding request
    files = {
        "manifest.json": ("manifest.json", open("manifest.json", "rb"), "application/json"),
        "files": (file_path, open(file_path, "rb"), "application/pdf")
    }

    response = requests.post(api_url, headers=headers, files=files)
    return response.json()

Example manifest.json

{
  "container_name": "HR_Onboarding_Package",
  "org_id": "your-org-id",
  "dynamic": true,
  "downloadable": false,
  "recipients": [
    "new.hire@company.com"
  ],
  "time": {
    "start": "2025-05-06T09:00:00Z",
    "end": "2025-05-20T17:00:00Z"
  }
}

What This Enables:

  • Seamless integration of Locktera security into upload flows.

  • DRM protection applied automatically on each document.

  • Granular access control based on time, recipient, and more.

  • Auditability and compliance built into your content handling.