Skip to content

File stores

A file store is durable storage for files. Create a file store, attach it to projects, upload files via presigned URLs.

Create a file store

const { data: store } = await client.fileStore.create({
body: { name: "customer-docs" },
})

Attach to a project

await client.pod.project.fileStore.add({
path: { podId, id: projectId },
body: { fileStoreId: store.id },
})

Upload a file

const { data: presigned } = await client.fileStore.files.presignUpload({
path: { id: store.id },
body: { path: "reports/2026-04.pdf", contentType: "application/pdf" },
})
await fetch(presigned.url, {
method: "PUT",
body: fileBlob,
headers: { "Content-Type": "application/pdf" },
})

Download a file

const { data: presigned } = await client.fileStore.files.presignDownload({
path: { id: store.id },
query: { path: "reports/2026-04.pdf" },
})
const bytes = await fetch(presigned.url).then((r) => r.arrayBuffer())