PersonalCloud API

Use your API key to upload, download, and manage files from other projects.

Authentication

Send your API key as a Bearer token in the Authorization header.

Command
curl -H "Authorization: Bearer pcu_xxx" \
  https://personal-cloud.dev/api/v1/files/initiate

Quick start (connect your app)

Create a key, store it in env vars, and follow the 3-step upload flow.

  1. Create an API key in Docs → API Keys.
  2. Store it as an env var (e.g. PC_API_KEY).
  3. Initiate → upload to MinIO → complete.
Command
// Example (Node / Next.js)
const apiKey = process.env.PC_API_KEY;
const initiate = await fetch("https://personal-cloud.dev/api/v1/files/initiate", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    name: "photo.jpg",
    contentType: "image/jpeg",
    sizeBytes: fileBuffer.length
  })
}).then(r => r.json());

await fetch(initiate.uploadUrl, { method: "PUT", body: fileBuffer });

await fetch("https://personal-cloud.dev/api/v1/files/complete", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ fileId: initiate.fileId })
});

Upload flow

Initiate, upload to MinIO, then complete.

Command
# 1) Initiate
curl -X POST https://personal-cloud.dev/api/v1/files/initiate \
  -H "Authorization: Bearer pcu_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"photo.jpg","contentType":"image/jpeg","sizeBytes":12345}'
Command
# 2) Upload to MinIO
curl -X PUT "<uploadUrl>" --data-binary @photo.jpg
Command
# 3) Complete
curl -X POST https://personal-cloud.dev/api/v1/files/complete \
  -H "Authorization: Bearer pcu_xxx" \
  -H "Content-Type: application/json" \
  -d '{"fileId":"FILE_ID"}'

Download

Generate a signed download URL.

Command
curl -H "Authorization: Bearer pcu_xxx" \
  https://personal-cloud.dev/api/v1/files/FILE_ID/download

Public files

Mark files public, then use the public download URL.

Command
curl -X PATCH https://personal-cloud.dev/api/v1/files/FILE_ID \
  -H "Authorization: Bearer pcu_xxx" \
  -H "Content-Type: application/json" \
  -d '{"isPublic":true}'
Command
curl "https://personal-cloud.dev/api/v1/public/files/FILE_ID/download?token=PUBLIC_TOKEN"