Your app's isolated storage area
#Each connected application gets one private storage area per user, created on first upload inside the user's "Connected apps" project. Your tokens can reach only that area: never the user's other files, and never another application's files. Users can see, download and delete what you stored from their dashboard. Disconnecting your app does not delete them.
Files count toward the user's single account quota, shared by all apps. OzVault stores the bytes as you send them; encrypt sensitive content in your app if it should be unreadable to the storage operator.
Upload a file (up to 4 MiB)
#POST the raw bytes as application/octet-stream to /v1/app/files with storage:app:write. name is a relative path (no leading slash, no .. segments, up to 512 characters). Optional query parameters: contentType, sha256 (verified before storing) and replace=true, which overwrites an existing file of the same name and also requires storage:app:delete. Without replace, an existing name returns 409 NAME_EXISTS. Empty files are not supported.
const API = "https://api.ozvault.lol";
// Single request, up to 4 MiB (4,194,304 bytes)
const response = await fetch(API + "/v1/app/files?" + new URLSearchParams({
name: "reports/2026-10-10.json",
contentType: "application/json",
}), {
method: "POST",
headers: {
Authorization: "Bearer " + accessToken,
"Content-Type": "application/octet-stream",
},
body: JSON.stringify(report),
});
const file = await response.json();
if (!response.ok) throw new Error(file.error.code + ": " + file.error.message);
// { id, name, size, contentType, sha256, createdAt }import httpx
r = httpx.post(
"https://api.ozvault.lol/v1/app/files",
params={"name": "exports/today.csv", "contentType": "text/csv"},
headers={"Authorization": f"Bearer {access_token}", "Content-Type": "application/octet-stream"},
content=csv_bytes,
timeout=60,
)
r.raise_for_status()
file = r.json() # {"id": ..., "name": ..., "size": ..., "sha256": ...}{
"id": "1f0a6a52-5d7e-4c35-9a28-0f1f8c2b7d11",
"name": "reports/2026-10-10.json",
"size": 18234,
"contentType": "application/json",
"sha256": "9f2c...e1",
"createdAt": "2026-10-10T09:14:03.512Z"
}Resumable uploads for large files
#Files up to the published maximum object size (256 MB by default) use a reservation: POST /v1/app/uploads with name, size, optional contentType and replace, and a UUID idempotencyKey. The response contains uploadUrl, a short-lived uploadToken and chunkBytes. PATCH each chunk to uploadUrl with Upload-Offset, then POST uploadUrl/complete with the SHA-256 of the whole file. Quota is reserved at the start, so concurrent uploads can never exceed the user's capacity.
import { createHash, randomUUID } from "node:crypto";
export async function uploadLarge(accessToken, name, bytes, contentType = "application/octet-stream") {
const start = await fetch("https://api.ozvault.lol/v1/app/uploads", {
method: "POST",
headers: { Authorization: "Bearer " + accessToken, "Content-Type": "application/json" },
body: JSON.stringify({ name, size: bytes.length, contentType, idempotencyKey: randomUUID() }),
});
const upload = await start.json();
if (!start.ok) throw new Error(upload.error.message);
// Chunks go to uploadUrl with the short-lived uploadToken, not the access token.
const auth = { Authorization: "Bearer " + upload.uploadToken };
for (let offset = upload.offset; offset < bytes.length; offset += upload.chunkBytes) {
const r = await fetch(upload.uploadUrl, {
method: "PATCH",
headers: { ...auth, "Content-Type": "application/octet-stream", "Upload-Offset": String(offset) },
body: bytes.subarray(offset, offset + upload.chunkBytes),
});
if (!r.ok) throw new Error((await r.json()).error.message); // on network errors, GET uploadUrl for the committed offset
}
const sha256 = createHash("sha256").update(bytes).digest("hex");
const done = await fetch(upload.uploadUrl + "/complete", {
method: "POST",
headers: { ...auth, "Content-Type": "application/json" },
body: JSON.stringify({ sha256 }),
});
return done.json(); // { id, name, size, contentType, sha256, createdAt }
}List, inspect and download
#GET /v1/app/files lists live files (optional prefix, limit up to 100 and cursor for the next page). GET /v1/app/files/{id} returns metadata. GET /v1/app/files/{id}/content streams the bytes as an attachment with X-Content-SHA256 and X-Ozvault-Content-Type headers. Verify the checksum after download.
GET https://api.ozvault.lol/v1/app/files?prefix=reports/&limit=50
Authorization: Bearer ova_...
{ "items": [ { "id": "1f0a...", "name": "reports/2026-10-10.json", "size": 18234, "contentType": "application/json", "sha256": "9f2c...", "createdAt": "..." } ], "nextCursor": null }import { createHash } from "node:crypto";
const r = await fetch("https://api.ozvault.lol/v1/app/files/" + fileId + "/content", {
headers: { Authorization: "Bearer " + accessToken },
});
if (!r.ok) throw new Error((await r.json()).error.code);
const bytes = Buffer.from(await r.arrayBuffer());
const expected = r.headers.get("X-Content-SHA256");
if (createHash("sha256").update(bytes).digest("hex") !== expected) throw new Error("Integrity check failed");
const originalType = r.headers.get("X-Ozvault-Content-Type");Delete files
#DELETE /v1/app/files/{id} with storage:app:delete moves the file to the user's trash. The user can restore it for 30 days; trashed bytes still count toward their quota until the retention period ends.
curl -X DELETE https://api.ozvault.lol/v1/app/files/1f0a6a52-5d7e-4c35-9a28-0f1f8c2b7d11 -H "Authorization: Bearer ova_..."
{"ok":true,"trashRetentionDays":30}Clear documentation is part of the product.