ReferenceHTTP API
storage
The storage router: 17 methods of the storage capability, with tier, scope, input and output.
Capability storage · scope system · mode singleton · source packages/types/src/capabilities/storage.cap.ts:30.
Every method is called at /trpc/storage.<method> — queries with GET, mutations with POST. See How to call and Authorization.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
resolve | query | admin | admin only | no |
write | mutation | admin | admin only | no |
read | query | admin | admin only | no |
exists | query | admin | admin only | no |
list | query | admin | admin only | no |
delete | mutation | admin | admin only | no |
getAvailableSpace | query | protected | view | no |
beginUpload | mutation | admin | admin only | no |
writeChunk | mutation | admin | admin only | no |
finalizeUpload | mutation | admin | admin only | no |
abortUpload | mutation | admin | admin only | no |
beginDownload | mutation | admin | admin only | no |
readChunk | query | admin | admin only | no |
endDownload | mutation | admin | admin only | no |
listLocations | query | protected | view | no |
listLocationDeclarations | query | protected | view | no |
listDrainProgress | query | protected | view | no |
storage.resolve
- Kind: query —
GET /trpc/storage.resolve - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.resolveon your hub
Input
{ location: string | string; relativePath: string }Output
stringstorage.write
- Kind: mutation —
POST /trpc/storage.write - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.writeon your hub
Input
{ location: string | string; relativePath: string; data: <custom> }Output
voidstorage.read
- Kind: query —
GET /trpc/storage.read - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.readon your hub
Input
{ location: string | string; relativePath: string }Output
<custom>storage.exists
- Kind: query —
GET /trpc/storage.exists - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.existson your hub
Input
{ location: string | string; relativePath: string }Output
booleanstorage.list
- Kind: query —
GET /trpc/storage.list - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.liston your hub
Input
{ location: string | string; prefix?: string }Output
string[]storage.delete
- Kind: mutation —
POST /trpc/storage.delete - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.deleteon your hub
Input
{ location: string | string; relativePath: string }Output
voidstorage.getAvailableSpace
- Kind: query —
GET /trpc/storage.getAvailableSpace - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitystorage, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=storage.getAvailableSpaceon your hub
Input
{ location: string | string }Output
number | nullstorage.beginUpload
- Kind: mutation —
POST /trpc/storage.beginUpload - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.beginUploadon your hub
Input
{ location: string | string; relativePath: string; sizeBytes?: number }Output
{ uploadId: string }storage.writeChunk
- Kind: mutation —
POST /trpc/storage.writeChunk - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.writeChunkon your hub
Input
{ uploadId: string; offset: number; data: <custom> }Output
voidstorage.finalizeUpload
- Kind: mutation —
POST /trpc/storage.finalizeUpload - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.finalizeUploadon your hub
Input
{ uploadId: string }Output
voidstorage.abortUpload
- Kind: mutation —
POST /trpc/storage.abortUpload - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.abortUploadon your hub
Input
{ uploadId: string }Output
voidstorage.beginDownload
- Kind: mutation —
POST /trpc/storage.beginDownload - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.beginDownloadon your hub
Input
{ location: string | string; relativePath: string }Output
{ downloadId: string; sizeBytes: number }storage.readChunk
- Kind: query —
GET /trpc/storage.readChunk - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.readChunkon your hub
Input
{ downloadId: string; offset: number; length: number }Output
<custom>storage.endDownload
- Kind: mutation —
POST /trpc/storage.endDownload - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=storage.endDownloadon your hub
Input
{ downloadId: string }Output
voidstorage.listLocations
- Kind: query —
GET /trpc/storage.listLocations - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitystorage, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=storage.listLocationson your hub
Input
{ type?: string }Output
({ id: string; type: string; displayName: string; providerId: string; config: Record<string, unknown>; nodeId?: string; isSystem?: boolean = false; enabled?: boolean; mode?: "active" | "readonly" | "drain" | "disabled"; capacity?: { totalBytes: number; availableBytes: number } | null; owned?: { bytes: number; measuredAtMs: number }; createdAt: number; updatedAt: number })[]storage.listLocationDeclarations
- Kind: query —
GET /trpc/storage.listLocationDeclarations - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitystorage, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=storage.listLocationDeclarationson your hub
Input
voidOutput
({ id: string; displayName: string; description?: string; cardinality: "single" | "multi"; access?: "local-path" | "cap-mediated"; defaultsTo?: string; defaultRoot?: "data" | "media" | "backup" })[]storage.listDrainProgress
- Kind: query —
GET /trpc/storage.listDrainProgress - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitystorage, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=storage.listDrainProgresson your hub
Input
voidOutput
({ locationId: string; startedAtMs: number; startBytes: number; bytesRemaining: number; drained: boolean; estimatedEmptyAtMs: number | null })[]