Skip to main content
Hcfs • 2 mins read

HCFS REST API Reference

HCFS REST API Reference

The authoritative description of every HCFS HTTP endpoint. Each endpoint has its own page with request shape, response shape, status codes, and a working curl example.

Before reading an endpoint page, skim auth.md and errors.md — every endpoint assumes that model.

  • Base URL: https://<server>/
  • Transport: HTTPS (TLS terminated upstream)
  • Content types: application/json for request/response bodies, multipart/form-data for uploads, application/octet-stream for ciphertext downloads

Prerequisites

PageWhat it covers
auth.mdBearer-token model, identity resolution, 401 / 403 behaviour
errors.mdNetworkResponse<T> envelope, error-code catalog, optimistic concurrency

Endpoint index

File lifecycle — HCFS native (end-to-end encrypted)

EndpointMethodPurpose
/uploadPOSTUpload a signed manifest + ciphertext for one file
/download/{ss58}/{folder_hash}/{file_id}GETStream the ciphertext back, with metadata headers
/delete/{ss58}/{folder_hash}/{file_id}DELETERemove ciphertext + metadata for one file

File lifecycle — S3-compatible gateway (server-side only)

EndpointMethodPurpose
/uploadPOSTUpload a plain file with account_ss58 + file fields (no manifest, no client-side encryption)
/download/{ss58}/{file_id}GETStream file by ID without folder scope
/delete/{ss58}/{file_id}DELETERemove file by ID without folder scope

State and discovery

EndpointMethodPurpose
/get_state/{ss58}/{folder_hash}GETPaginated listing of every file in a folder
/browse/{ss58}/{folder_hash}GETDirectory-scoped tree listing with subfolder aggregates
/search_files/{ss58}GETCross-folder file search with filters, sort, pagination
/register_relative_paths/{ss58}/{folder_hash}POSTBackfill plaintext relative paths for legacy rows

Folder lifecycle

EndpointMethodPurpose
/register_folderPOSTDeclare a new sync folder under an SS58 address
/list_folders/{base_address}GETEnumerate every folder a user has registered
/unregister_folderDELETERemove a folder and every file record it owns

Rename

EndpointMethodPurpose
/rename_filesPOSTAtomic batch rename — re-keys file records without touching storage

Resumable / chunked upload

EndpointMethodPurpose
/upload/sessionPOSTOpen a chunked upload session
/upload/session/{id}/chunk/{index}PUTUpload one chunk (≤ 16 MiB)
/upload/session/{id}/statusGETInspect session progress and resume point
/upload/session/{id}/finalizePOSTAssemble chunks and commit the file
/upload/session/{id}DELETEAbort and clean up a session

Response envelope

Every endpoint's JSON body is shaped as one of:

{ "Success": { ... endpoint-specific payload ... } }
{ "Conflict": { "error": "...", "message": "...", "current_revision_id": [...], "current_revision_seq": 0 } }
{ "Error": { "error": "<code>", "message": "<human-readable>" } }

See errors.md for the code catalog and the optimistic-concurrency rules that produce Conflict.


Authentication in one line

Send Authorization: Bearer <token>. The server resolves the token to an SS58 address and refuses requests whose URL {ss58_address} segment does not match. See auth.md.