files
Repo files: presigned multipart upload/download against object storage, and tree listing
GET / v1/ repos/ {owner}/ {repo}/ tree
List repo files
Flat file listing with sizes, etags and sha256 digests (paths are /-separated keys; there are no directory objects). Filter with prefix; paginate for large repos.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
owner | path | Handle | Repo owner handle (username or org slug). |
repo | path | Slug | Repo slug. A renamed repo's former slug also finds it, and the answer names its current address. |
prefix | query | string | Only paths starting with this prefix. |
limit | query | integer | Page size (tree listings allow larger pages). |
cursor | query | string | Opaque cursor from the previous page's |
Responses
POST / v1/ repos/ {owner}/ {repo}/ files/ presign-upload
Presign a batch multipart upload
Requests presigned multipart upload URLs for up to 100 files. The client supplies each file's path, size and sha256. The sha256 is the content address and also the dedupe precheck. The server returns, per file, an upload_id and part URLs. Each part is part_size bytes, and the last part may be short. Upload the parts with HTTP PUT, collect the returned ETags, then call complete. Limits (v0): single file ≤ 50 GiB, part size 100 MiB. A file comes back with no parts when the hub already holds those bytes and the caller can already read them. That means a file of a public repo, or of a repo the caller may read. Bytes held only by a private repo the caller cannot read are uploaded like any other. Uploads that are still in progress count toward the storage quota. A file Lucen certified keeps its bytes. New bytes at its path are 409, so upload them under a new name. Only a certifier may upload to the repo that holds Lucen's certification list (403). That repo refuses a list older than the newest one the hub accepted (409). It also refuses a list the hub cannot read (409). A list upload is 503 when the hub cannot read the serial floor or the uploaded bytes. In a dataset repo, new bytes at a path that holds episodes are 409 unless replace_episodes is true. Those paths are data/, videos/ and meta/episodes/, plus meta/episodes.jsonl and meta/episodes_stats.jsonl. The batch is checked whole, before anything is linked. A second recording pushed under the same name would otherwise replace the first one's episodes.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
owner | path | Handle | Repo owner handle (username or org slug). |
repo | path | Slug | Repo slug. A renamed repo's former slug also finds it, and the answer names its current address. |
Request body
| Field | Type | Description |
|---|---|---|
files | array of PresignUploadFile | |
replace_episodes | boolean | Allow new bytes at a dataset's episode paths. Set it only when the upload holds every episode the dataset has now. Without it such a path is |
Responses
| Status | Description | Body |
|---|---|---|
200 | Presigned upload targets, one per requested file. | PresignUploadResponse |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
413 | A file exceeds the size limit or the account is over quota. | Problem |
422 | Request failed validation. | Problem |
503 | The hub cannot read Lucen's certification list right now, or the newest serial it accepted. Nothing was changed. Try again in a minute. | Problem |
POST / v1/ repos/ {owner}/ {repo}/ files/ complete
Complete a batch multipart upload
Finalizes multipart uploads previously presigned. The server completes the uploads in object storage, verifies etags, and upserts the RepoFile rows. Existing paths are overwritten, because repos have no revisions in v0. A file Lucen certified is never overwritten (409). The repo that holds Lucen's certification list follows the rules of presignUpload. So do a dataset's episode files: new bytes there are 409 unless replace_episodes is true, checked for the whole batch first. Only the account that presigned an upload completes it (409 otherwise). The storage quota is checked again here (413).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
owner | path | Handle | Repo owner handle (username or org slug). |
repo | path | Slug | Repo slug. A renamed repo's former slug also finds it, and the answer names its current address. |
Request body
| Field | Type | Description |
|---|---|---|
uploads | array of CompletedUpload | |
replace_episodes | boolean | The same allowance as on |
Responses
| Status | Description | Body |
|---|---|---|
200 | Files recorded. | CompleteUploadResponse |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
413 | These files would put the account over its storage quota. | Problem |
422 | Request failed validation. | Problem |
503 | The hub cannot read Lucen's certification list right now, or the newest serial it accepted. Nothing was changed. Try again in a minute. | Problem |
POST / v1/ repos/ {owner}/ {repo}/ files/ presign-download
Presign downloads
Returns short-lived (1 h) presigned GET URLs for up to 100 repo file paths. All-or-nothing: any unknown path fails the whole request with 404 (missing paths listed in the problem detail). Anonymous works for public repos. A request that names the repo's main file counts one download, once a day per viewer (Repo.downloads_30d). Counting is best effort and never fails or delays the answer.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
owner | path | Handle | Repo owner handle (username or org slug). |
repo | path | Slug | Repo slug. A renamed repo's former slug also finds it, and the answer names its current address. |
Request body
| Field | Type | Description |
|---|---|---|
paths | array of FilePath | |
count_download | boolean | Set false when you read a file to show it on a page. The hub then leaves the repo's download count alone. See |
Responses
| Status | Description | Body |
|---|---|---|
200 | Presigned download URLs. | PresignDownloadResponse |
404 | Resource not found (or hidden from the caller). | Problem |
422 | Request failed validation. | Problem |
POST / v1/ repos/ {owner}/ {repo}/ files/ delete
Delete files (batch unlink)
Unlinks up to 100 file rows from the repo. Content-addressed blobs are garbage-collected asynchronously once unreferenced. Unknown paths are ignored and reported back. A file Lucen certified stays until Lucen revokes it (409). While the hub cannot read Lucen's certification list, nothing is deleted (503). Only a certifier may delete from the repo that holds the list (403).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
owner | path | Handle | Repo owner handle (username or org slug). |
repo | path | Slug | Repo slug. A renamed repo's former slug also finds it, and the answer names its current address. |
Request body
| Field | Type | Description |
|---|---|---|
paths | array of FilePath |
Responses
| Status | Description | Body |
|---|---|---|
200 | Deletion summary. | FileDeleteResponse |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
422 | Request failed validation. | Problem |
503 | The hub cannot read Lucen's certification list right now, or the newest serial it accepted. Nothing was changed. Try again in a minute. | Problem |
Schemas (17)
The schemas these operations reach before any other tag’s do. A type that links elsewhere is rendered on that tag’s page.
TreePage
| Field | Type | Description |
|---|---|---|
items | array of RepoFileEntry | |
next_cursor | string | null |
PresignUploadRequest
| Field | Type | Description |
|---|---|---|
files | array of PresignUploadFile | |
replace_episodes | boolean | Allow new bytes at a dataset's episode paths. Set it only when the upload holds every episode the dataset has now. Without it such a path is |
PresignUploadResponse
| Field | Type | Description |
|---|---|---|
uploads | array of UploadTarget | |
expires_at | string (date-time) | When the presigned part URLs expire. |
CompleteUploadRequest
| Field | Type | Description |
|---|---|---|
uploads | array of CompletedUpload | |
replace_episodes | boolean | The same allowance as on |
CompleteUploadResponse
| Field | Type | Description |
|---|---|---|
files | array of RepoFileEntry |
PresignDownloadRequest
| Field | Type | Description |
|---|---|---|
paths | array of FilePath | |
count_download | boolean | Set false when you read a file to show it on a page. The hub then leaves the repo's download count alone. See |
PresignDownloadResponse
| Field | Type | Description |
|---|---|---|
files | array of DownloadTarget |
FileDeleteRequest
| Field | Type | Description |
|---|---|---|
paths | array of FilePath |
FileDeleteResponse
RepoFileEntry
| Field | Type | Description |
|---|---|---|
path | FilePath | |
size | integer | Bytes. |
etag | string | null | Object-store ETag (multipart ETags are not content hashes). |
sha256 | Sha256 | null | |
mime | string | null | Detected media type. |
certified | CertifiedBadge | null | Set by |
updated_at | string (date-time) |
PresignUploadFile
UploadTarget
| Field | Type | Description |
|---|---|---|
path | FilePath | |
upload_id | string | Multipart upload id; echo it back on |
part_size | integer | Bytes per part (v0 fixed 100 MiB; last part may be short). |
parts | array of UploadPart |
CompletedUpload
| Field | Type | Description |
|---|---|---|
path | FilePath | |
upload_id | string | |
parts | array of CompletedPart |
DownloadTarget
| Field | Type | Description |
|---|---|---|
path | FilePath | |
url | string (uri) | |
expires_at | string (date-time) |
Sha256
Lowercase hex SHA-256.
UploadPart
| Field | Type | Description |
|---|---|---|
part_number | integer | |
url | string (uri) |
CompletedPart
| Field | Type | Description |
|---|---|---|
part_number | integer | |
etag | string |