Core Resource • Hosted Campaign Documents

Documents API Reference

Upload, host, and link PDF menus, property brochures, and marketing flyers directly to dynamic QR codes with quarantine virus scanning and secure delivery.

File Limits & Storage Caps

Free Trial: 5 MB per PDF, max 1 document, 30-day retention window.

Pro (₹399/mo): 25 MB per PDF, 1 GB storage pool, indefinite retention.

Business (₹999/mo): 100 MB per PDF, 10 GB storage pool, indefinite retention.

Credit Deductions & Magic Bytes

Registering a new hosted document consumes 2 QR Credits. Replacing an existing document preserves the printed QR link and consumes 0 additional credits.

All uploads undergo magic-byte inspection (validating %PDF- header) before being moved from quarantine to storage.

GET/api/v1/documents

List Hosted Documents

Returns paginated documents uploaded to your workspace.

Authentication: Bearer Token / x-api-key
Required Scope: documents:read
curl -X GET "https://qrnaly.com/api/v1/documents?page=1&limit=20" \
  -H "Authorization: Bearer qrs_live_your_api_key_here"
POST/api/v1/documents

Upload / Register Hosted Document

Uploads or registers a document into workspace campaign storage. Consumes 2 QR Credits.

Authentication: Bearer Token / x-api-key
Required Scope: documents:write
Quota Impact: Consumes 2 QR Credits
Headers: Idempotency-Key (optional)

Example cURL (Base64 Payload)

curl -X POST "https://qrnaly.com/api/v1/documents" \
  -H "Authorization: Bearer qrs_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "Autumn_Tasting_Menu.pdf",
    "fileBase64": "JVBERi0xLjQKJcTl8uXr..."
  }'

Successful Response (HTTP 201)

{
  "data": {
    "id": "pdf_01j8m4...",
    "workspaceId": "ws_01j8m1...",
    "slug": "p_88a2bc...",
    "filename": "Autumn_Tasting_Menu.pdf",
    "fileSize": 1048576,
    "status": "active",
    "tier": "pro",
    "viewUrl": "https://qrnaly.com/p/p_88a2bc...",
    "scanCount": 0,
    "createdAt": "2026-10-06T10:20:00.000Z"
  },
  "creditsDeducted": 2,
  "balance": {
    "remaining": 48,
    "limit": 50
  },
  "message": "Document registered successfully."
}
GET/api/v1/documents/:id

Get Document by ID

Retrieves document metadata, file size, and public download URL.

curl -X GET "https://qrnaly.com/api/v1/documents/pdf_01j8m4" \
  -H "Authorization: Bearer qrs_live_your_api_key_here"
DELETE/api/v1/documents/:id

Delete Document

Permanently removes a document binary from storage and frees storage quota.

curl -X DELETE "https://qrnaly.com/api/v1/documents/pdf_01j8m4" \
  -H "Authorization: Bearer qrs_live_your_api_key_here"