Skip to content

AlphaDrive REST API Reference

Nawed Hossain edited this page Sep 17, 2026 · 3 revisions

AlphaDrive provides a clean, JSON-based REST API for programmatic access, client automation, and integration.


Authentication & Headers

  • Session Cookie: alphadrive_session=<token> (HTTP-only, SameSite=Lax).
  • CSRF Header: For state-changing requests (POST, DELETE, PUT), include: X-CSRF-Token: <csrf_token>

API Endpoints

1. User & Account

  • GET /api/me Returns authenticated user details and storage quota.
  • POST /api/account/username Change personal username ({ "new_username": "..." }).
  • POST /api/account/password Change password ({ "current_password": "...", "new_password": "..." }).
  • POST /api/account/users (Admin only) — Create new user ({ "username": "...", "name": "...", "password": "...", "is_admin": bool }).

2. Files & Folders

  • GET /api/nodes?parent_id=<id> List active files and folders inside a directory.
  • GET /api/nodes/trash List items currently in trash.
  • GET /api/nodes/{id} Get metadata for a specific item.
  • POST /api/nodes/folder Create a new folder ({ "name": "...", "parent_id": "..." }).
  • POST /api/nodes/trash Move items to trash ({ "ids": ["id1", "id2"] }).
  • POST /api/nodes/restore Restore items from trash ({ "ids": ["id1", "id2"] }).
  • DELETE /api/nodes Permanently delete items ({ "ids": ["id1", "id2"] }).

3. File Transfers & Streaming

  • POST /api/upload Multi-part file upload (file, parent_id, relative_path).
  • GET /api/files/{id}/view Stream file content for browser preview (Supports Range headers).
  • GET /api/files/{id}/download Download file attachment.
  • GET /api/folders/{id}/download Download folder contents as a streamed ZIP archive.

4. Public Shares

  • GET /api/nodes/{id}/share Get active share status for an item.
  • POST /api/shares Create a public share link ({ "node_id": "...", "custom_slug": "...", "password": "...", "expires_in": "24h" }).
  • DELETE /api/shares/{id} Revoke an active public share link.
  • GET /s/{slug} Public share web page.
  • POST /s/{slug}/unlock Unlock password-protected public share.
  • GET /s/{slug}/files/{id}/view Public preview stream.
  • GET /s/{slug}/files/{id}/download Public file download.
  • GET /s/{slug}/download Public folder ZIP stream.

Clone this wiki locally