List files
const url = 'https://example.com/v1/files?limit=25';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/files?limit=25' \ --header 'Authorization: Bearer <token>'Cursor-paginated, newest change first. Each file with its Latest (no bytes). Deleted files aren’t listed. Filters: ?ownerRunId=, ?projectId=, ?contentType= (Latest’s, exactly). With authorization on, only files in projects the caller can read are listed; with ?ownerRunId= of a run of the caller’s own (one that acts for them), run on the project is enough too. On a runtime that doesn’t keep files, /v1/files isn’t served (404 route-not-found).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”1..100. Default 25.
Where the previous page ended: its nextCursor, as it came. A runtime that seals cursors takes one only for the same list, filters and caller, within a day; otherwise 400 bad-input, and the list starts again without it. Absent → first page.
Only the files whose version 1 this run made.
Only one project’s files (its id, a UUID).
Only the files whose Latest has this type, exactly.
Responses
Section titled “Responses”A page of files.
object
A file the runtime keeps, with every edit as a version, and its Latest: the highest version that isn’t deleted.
object
The file’s id: the blobId of its version 1’s bytes, which names the file through every later version.
The project it belongs to. Reading it needs read there, or run for a file of the caller’s own; changing it needs write.
Its name: Latest’s.
Who made version 1: user:<id> or service_account:<id>.
The run that made version 1, when one did.
The highest number it has had, deleted versions included.
Its pinned versions, lowest first.
One version of a file. Numbers start at 1, only grow, and are never reused. A deleted or purged version keeps its record, so the runs that used it still name it.
object
The file’s id: the blobId of its version 1’s bytes, which names the file through every later version.
The stored bytes. Two versions of one file can share them.
The file’s name when this version was made.
MIME type, as the writer declared it.
Sha256 of the bytes, hex-encoded, lowercase.
Labels the writer gave this version.
object
Latest when this version was made. Absent on version 1.
The version a restore copied the bytes of.
How it was made: a person’s or a key’s upload, a restore, a run’s tool, or a run’s model.
Who made it: user:<id> or service_account:<id>, or run:<id> for a run’s tool or model.
The run that made it, when one did.
The run’s tool call that made it.
The tool that made it.
When a newer version replaced it as Latest. Absent on Latest: when Latest is deleted, the version that’s Latest again has none.
A version’s keep mark: it can’t be deleted, and retention never purges it.
object
Who pinned it: user:<id> or service_account:<id>.
When retention dropped its bytes (the file_version domain). Its number, hash, size and maker stay.
When its newest version was made, or its Latest last moved.
Example
{ "data": [ { "latest": { "madeVia": "upload" } } ]}ownerRunId or projectId is not an id (a UUID).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.
The database was too busy to answer in time (database-busy), or the authorization store couldn’t be reached (authz-backend-unavailable); Retry-After (whole seconds) says when to try again.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.