Magic links

A magic link is a long random token in a URL that grants access to exactly one package, for one recipient, until it expires.

Format

https://files.example.com/p/Yt9KxRz3M_aB7Le2Nq...
                          ─┬─ ──────────────┬─────────
                           │                │
                           │                └── 32-byte url-safe-base64 random token
                           └── public route prefix

Properties

Lifecycle

  1. Generated at package finalization (outbound) or creation (inbound)
  2. Sent to the recipient by email
  3. Recipient clicks → lands on download or upload page
  4. Future hits show updated use_count and last_used_at
  5. At TTL or after revoke → 410 Gone on next hit

Failure responses

StatusMeaningAudit action
410 GoneUnknown / invalid tokentoken_invalid
410 GonePast TTLtoken_expired
410 GoneManually revokedtoken_revoked

All three render the same generic "link no longer available" page to avoid leaking the exact reason to enumerators.

Security model

The token IS the auth. Anyone with the link can use it — there's no second factor. Acceptable when:

If you need stronger auth (e.g. for medical/legal data), pair with:

If a link leaks

  1. Go to the package detail page
  2. Click Revoke link — confirm
  3. All future hits return 410
  4. Audit log records admin_revoke + every prior access
  5. (Optional) Click Delete package to remove the files from disk too