PhantomDocs API Reference
Programmatic access to document upload, token management, webhooks, and the embeddable viewer. Base URL: http://localhost:5001
Authentication
Add Authorization: Bearer <token> (session token from /v1/auth/login) or X-API-Key: pk_live_... (API key from /v1/api-keys) to authenticated endpoints.
Authentication
PhantomDocs supports two authentication methods: user session tokens (PASETO Bearer tokens) obtained via login, and API keys (pk_live_...) for programmatic access.
POST
/v1/auth/registerRegister a new user accountâ–¾
POST
/v1/auth/loginLog in and receive a session tokenâ–¾
GET
/v1/auth/meGet the authenticated user profile🔒 Bearer token▾
API Keys
API keys (pk_live_...) let you authenticate machine-to-machine requests without a user session. Pass the key in the X-API-Key header.
POST
/v1/api-keysCreate a new API key🔒 Bearer token▾
GET
/v1/api-keysList API keys (keys are masked)🔒 Bearer token▾
DELETE
/v1/api-keys/:idRevoke an API key🔒 Bearer token▾
Documents
Upload, list, view, download, and delete documents. All document payloads must be base64-encoded. The server encrypts the content with AES-256-GCM.
POST
/v1/documentsUpload a new document🔒 Bearer or API key▾
GET
/v1/documentsList all documents owned by the authenticated user🔒 Bearer or API key▾
GET
/v1/documents/:id/viewRender the document as an inline HTML viewerâ–¾
GET
/v1/documents/:id/downloadDownload a self-contained HTML fileâ–¾
DELETE
/v1/documents/:idDelete a document and revoke all its tokens