Skip to content
Docs menu

files

Repo files: presigned multipart upload/download against object storage, and tree listing

5 operations · 17 schemas

GET /v1/repos/{owner}/{repo}/tree

List repo files

getRepoTree · scope none

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

getRepoTree parameters
NameInTypeDescription
ownerrequiredpathHandle

Repo owner handle (username or org slug).

reporequiredpathSlug

Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

prefixquerystring

length ≤ 1024

Only paths starting with this prefix.

limitqueryinteger

default 500 · ≥ 1 · ≤ 1000

Page size (tree listings allow larger pages).

cursorquerystring

length ≤ 512

Opaque cursor from the previous page's next_cursor.

Responses

getRepoTree responses
StatusDescriptionBody
200

Page of file entries.

TreePage
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json

POST /v1/repos/{owner}/{repo}/files/presign-upload

Presign a batch multipart upload

presignUpload · scope key:write

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

presignUpload parameters
NameInTypeDescription
ownerrequiredpathHandle

Repo owner handle (username or org slug).

reporequiredpathSlug

Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

Request body

application/json · required · PresignUploadRequest

presignUpload request body
FieldTypeDescription
filesrequiredarray of PresignUploadFile

items 1–100

replace_episodesboolean

default false

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 409, and nothing in the batch is linked.

Responses

presignUpload responses
StatusDescriptionBody
200

Presigned upload targets, one per requested file.

PresignUploadResponse
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json
413

A file exceeds the size limit or the account is over quota.

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json
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.

Problemapplication/problem+json

POST /v1/repos/{owner}/{repo}/files/complete

Complete a batch multipart upload

completeUpload · scope key:write

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

completeUpload parameters
NameInTypeDescription
ownerrequiredpathHandle

Repo owner handle (username or org slug).

reporequiredpathSlug

Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

Request body

application/json · required · CompleteUploadRequest

completeUpload request body
FieldTypeDescription
uploadsrequiredarray of CompletedUpload

items 1–100

replace_episodesboolean

default false

The same allowance as on presignUpload. Another upload may have linked episode files at these paths since the presign.

Responses

completeUpload responses
StatusDescriptionBody
200

Files recorded.

CompleteUploadResponse
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json
413

These files would put the account over its storage quota.

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json
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.

Problemapplication/problem+json

POST /v1/repos/{owner}/{repo}/files/presign-download

Presign downloads

presignDownload · scope none

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

presignDownload parameters
NameInTypeDescription
ownerrequiredpathHandle

Repo owner handle (username or org slug).

reporequiredpathSlug

Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

Request body

application/json · required · PresignDownloadRequest

presignDownload request body
FieldTypeDescription
pathsrequiredarray of FilePath

items 1–100

count_downloadboolean

default true

Set false when you read a file to show it on a page. The hub then leaves the repo's download count alone. See Repo.downloads_30d for what counts.

Responses

presignDownload responses
StatusDescriptionBody
200

Presigned download URLs.

PresignDownloadResponse
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

POST /v1/repos/{owner}/{repo}/files/delete

Delete files (batch unlink)

deleteFiles · scope key:write

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

deleteFiles parameters
NameInTypeDescription
ownerrequiredpathHandle

Repo owner handle (username or org slug).

reporequiredpathSlug

Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

Request body

application/json · required · FileDeleteRequest

deleteFiles request body
FieldTypeDescription
pathsrequiredarray of FilePath

items 1–100

Responses

deleteFiles responses
StatusDescriptionBody
200

Deletion summary.

FileDeleteResponse
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json
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.

Problemapplication/problem+json

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

object

TreePage fields
FieldTypeDescription
itemsrequiredarray of RepoFileEntry
next_cursorrequiredstring | null

PresignUploadRequest

object

PresignUploadRequest fields
FieldTypeDescription
filesrequiredarray of PresignUploadFile

items 1–100

replace_episodesboolean

default false

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 409, and nothing in the batch is linked.

PresignUploadResponse

object

PresignUploadResponse fields
FieldTypeDescription
uploadsrequiredarray of UploadTarget
expires_atrequiredstring (date-time)

When the presigned part URLs expire.

CompleteUploadRequest

object

CompleteUploadRequest fields
FieldTypeDescription
uploadsrequiredarray of CompletedUpload

items 1–100

replace_episodesboolean

default false

The same allowance as on presignUpload. Another upload may have linked episode files at these paths since the presign.

CompleteUploadResponse

object

CompleteUploadResponse fields
FieldTypeDescription
filesrequiredarray of RepoFileEntry

PresignDownloadRequest

object

PresignDownloadRequest fields
FieldTypeDescription
pathsrequiredarray of FilePath

items 1–100

count_downloadboolean

default true

Set false when you read a file to show it on a page. The hub then leaves the repo's download count alone. See Repo.downloads_30d for what counts.

PresignDownloadResponse

object

PresignDownloadResponse fields
FieldTypeDescription
filesrequiredarray of DownloadTarget

FileDeleteRequest

object

FileDeleteRequest fields
FieldTypeDescription
pathsrequiredarray of FilePath

items 1–100

FileDeleteResponse

object

FileDeleteResponse fields
FieldTypeDescription
deletedrequiredarray of FilePath
missingrequiredarray of FilePath

Requested paths that did not exist (ignored).

RepoFileEntry

object

RepoFileEntry fields
FieldTypeDescription
pathrequiredFilePath
sizerequiredinteger

≥ 0

Bytes.

etagstring | null

Object-store ETag (multipart ETags are not content hashes).

sha256Sha256 | null
mimestring | null

length ≤ 255

Detected media type.

certifiedread-onlyCertifiedBadge | null

Set by getRepoTree, by the file's sha256. Always null in the completeUpload response, which does not read the certification list.

updated_atrequiredstring (date-time)

PresignUploadFile

object

PresignUploadFile fields
FieldTypeDescription
pathrequiredFilePath
sizerequiredinteger

≥ 0 · ≤ 53687091200

Bytes; v0 single-file limit 50 GiB.

sha256requiredSha256
content_typestring | null

length ≤ 255

UploadTarget

object

UploadTarget fields
FieldTypeDescription
pathrequiredFilePath
upload_idrequiredstring

Multipart upload id; echo it back on complete.

part_sizerequiredinteger

Bytes per part (v0 fixed 100 MiB; last part may be short).

partsrequiredarray of UploadPart

CompletedUpload

object

CompletedUpload fields
FieldTypeDescription
pathrequiredFilePath
upload_idrequiredstring
partsrequiredarray of CompletedPart

items ≥ 1

DownloadTarget

object

DownloadTarget fields
FieldTypeDescription
pathrequiredFilePath
urlrequiredstring (uri)
expires_atrequiredstring (date-time)

Sha256

string

pattern ^[a-f0-9]{64}$

Lowercase hex SHA-256.

UploadPart

object

UploadPart fields
FieldTypeDescription
part_numberrequiredinteger

≥ 1

urlrequiredstring (uri)

CompletedPart

object

CompletedPart fields
FieldTypeDescription
part_numberrequiredinteger

≥ 1

etagrequiredstring