Files are the core resource in Blockchain Drive. Each file is pinned to IPFS and receives a content identifier (CID). Optionally, the file can be anchored on Ethereum for tamper-proof provenance. Files may be encrypted client-side before upload; the encryption metadata travels alongside the CID. All file endpoints require an authenticated session. A 401 is returned when the session cookie is absent or expired.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ankit-bista/Final-Project/llms.txt
Use this file to discover all available pages before exploring further.
POST /upload
Uploads a file to IPFS and records it in the database. The request must bemultipart/form-data. Maximum file size is 500 MB.
The raw file bytes. Use the field name
file.Override the file’s display name. Defaults to the original filename from the multipart upload.
Free-text description stored alongside the file record.
JSON-encoded encryption metadata produced by the client before upload (algorithm, IV, encrypted key, etc.). See
/api/encryption/encrypt for the shape.Numeric ID of a collaborative drive to associate this file with. The caller must have at least
editor role on that drive.Numeric ID of a folder within the drive. Ignored when
driveId is absent.Always
true on success.IPFS content identifier for the uploaded file.
Application-level hash used for integrity verification, or
null if not computed.| Status | Error code | Condition |
|---|---|---|
403 | QUOTA_EXCEEDED | The file would exceed the user’s personal storage quota |
403 | DRIVE_QUOTA_EXCEEDED | The file would exceed the target drive’s quota |
403 | ROLE_FORBIDDEN | The user’s drive role does not permit uploads |
GET /files
Lists files owned by the authenticated user, or files within a specific drive or folder.Filter to files in this collaborative drive. The caller must have at least
viewer role.Further filter to a specific folder within the drive.
Unique file ID.
Display name of the file.
IPFS content identifier.
File size in bytes.
Application-level integrity hash.
Ethereum transaction hash if the file has been anchored on-chain.
Encryption metadata, or
null for unencrypted files.Drive this file belongs to, or
null for personal storage.Folder this file belongs to, or
null for the drive root.POST /delete/:id
Permanently removes a file record. Only the file owner can delete.Numeric ID of the file to delete.
GET /files/:id/content
Streams the raw file bytes from IPFS. The response setsContent-Type and Content-Disposition: inline headers based on the stored file name.
Numeric ID of the file.
403 ACCESS_DENIED, 404 NOT_FOUND, 502 IPFS_FETCH_FAILED.
GET /files/:id/crypto
Returns the encryption metadata needed to decrypt a file client-side. TheencryptedKey field is scoped to the caller: owners receive the owner-encrypted key; shared users receive the key that was encrypted specifically for them when the file was shared.
Numeric ID of the file.
Whether the file was encrypted before upload.
Encryption algorithm, e.g.
AES-256.Base64-encoded initialization vector.
The file encryption key, encrypted with the caller’s public key.
IPFS CID of the (encrypted) file bytes.
Original file name before encryption.
MIME type of the plaintext file.
GET /files/:id/view-url
Returns a signed in-app viewer URL that can be embedded in an iframe or opened in the Blockchain Drive viewer.Numeric ID of the file.
Absolute URL to the in-app file viewer.
POST /files/:id/anchor
Submits an Ethereum transaction to anchor the file’s CID on-chain, creating a tamper-proof provenance record.Numeric ID of the file to anchor.
Always
true.Ethereum transaction hash of the anchor transaction.
Anchoring costs gas. The transaction is submitted from the server-side signing key configured via environment variables. The
txHash is stored against the file record and returned in GET /files as tx_hash.POST /files/:id/link
Creates a time-limited, publicly accessible link to a file. The link resolves via the IPFS gateway without requiring authentication.Numeric ID of the file.
Positive integer. How long the link remains valid. Defaults to
60 if omitted or 0.The shareable link URL.
ISO 8601 timestamp when the link expires.
GET /l/:token
Resolves an expiring link token and redirects to the IPFS gateway. No authentication required — this endpoint is designed for public sharing.The opaque token from a
POST /files/:id/link response.| Status | Condition |
|---|---|
302 | Token valid — redirects to {IPFS_GATEWAY_URL}/ipfs/{cid} |
404 | Token not found |
410 | Token has expired |
GET /files/:id/comments
Lists all comments left on a file. The caller must have at leastviewer access.
Numeric ID of the file.
POST /files/:id/comments
Adds a comment to a file. The caller must have at leastviewer access.
Numeric ID of the file.
Comment content. Must be non-empty.
GET /me
Returns profile and storage quota information for the authenticated user.Internal user ID.
Display username.
Account role:
admin, uploader, or commenter.Total allocated storage in bytes.
Storage consumed across all files in bytes.
Remaining quota in bytes.
GET /share-target
Looks up another user by username or wallet address. Use this before sharing a file to retrieve the recipient’s encryption public key.A username or Ethereum wallet address.
Internal user ID of the target.
Ethereum wallet address.
MetaMask encryption public key, if the user has registered one.
Display username.