Skip to content
Esc
↑↓navigate↵open⌘Jpreview

List a version's files

Returns the version’s source files with paths, sizes, and content hashes, read from the runtime’s file catalog.

GET/v1/spaces/{spaceId}/versions/{versionId}/files
Authorization
AuthorizationBearer token · headerrequired

Better Auth session, OAuth access token, OAuth client-credentials token, or sfm_ Space machine credential.

Path parameters
spaceIdstringrequired
versionIdstringrequired
Query parameters
qstring

Return only files whose path contains this text.

min length 1 · max length 255
viewstring

Which catalog to list: uploaded (the default) is what the publisher uploaded before any transform; served is what this version actually answers with.

Allowed:uploadedserved
Responses
200

Response for status 200

$schemastring<uri>

Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.

dataobjectrequired
Show properties
versionIdstringrequired
viewstringrequired
Allowed:uploadedserved
filesobject[]required
Show properties
Array of object
pathstringrequired

Version-relative POSIX path. Canonicalized at intake to UTF-8 NFC, percent-decoded exactly once; max 1,024 bytes in canonical form.

sizeintegerrequired

File size in bytes.

min 0 · max 9007199254740991
sha256string

Optional SHA-256 content digest, 64 lowercase hex characters without the sha256: prefix. Omit it to let the runtime hash uploaded bytes; include it to upload by content address, with the digest verified as the bytes land.

matches ^[0-9a-f]{64}$
contentTypestring

Optional content type for serving metadata.

sourceUrlstring<uri>

Optional HTTPS URL the runtime can fetch directly for this file instead of receiving bytes from the client.

previewablebooleanrequired
generatedPreviewobject | nullrequired
Show properties
Any of:
object
kindstringrequired
statusstringrequired
Allowed:readypending
keystringrequired
cacheScopestringrequired
Allowed:hashversion-path
contentTypestringrequired
widthintegerrequired
max 9007199254740991
heightintegerrequired
max 9007199254740991
null
null
indexobjectrequired
Show properties
entriesobject[]required
Show properties
Array of object
keystringrequired
selectorobjectrequired
Show properties
One of:
object
kindstringrequired
sha256stringrequired
object
kindstringrequired
pathstringrequired
primaryPathstringrequired
pathsstring[]required
countintegerrequired
min 0 · max 9007199254740991
sizeintegerrequired
min 0 · max 9007199254740991
totalBytesintegerrequired
min 0 · max 9007199254740991
contentTypesstring[]required
previewablebooleanrequired
generatedPreviewobject | nullrequired
Show properties
Any of:
object
kindstringrequired
statusstringrequired
Allowed:readypending
keystringrequired
cacheScopestringrequired
Allowed:hashversion-path
contentTypestringrequired
widthintegerrequired
max 9007199254740991
heightintegerrequired
max 9007199254740991
null
null
searchTextstringrequired
byHashobjectrequired
byPathobjectrequired
searchobjectrequired
Show properties
querystring | nullrequired
totalintegerrequired
min 0 · max 9007199254740991
matchedintegerrequired
min 0 · max 9007199254740991
default

Problem details (RFC 9457). Any 4xx/5xx response is one application/problem+json document.

$schemastring<uri>

Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.

typestringrequired

Problem type URI resolving to the error docs page. The server derives it mechanically from code against the docs origin.

titlestringrequired

Short human-readable summary of the problem type. The server derives it mechanically from code.

statusintegerrequired

HTTP status code of this response, repeated in the body.

min -9007199254740991 · max 9007199254740991
detailstringrequired

Human-readable failure explanation for this occurrence.

codestringrequired

Stable snake_case error code naming the failed public contract.

pointerstring

RFC 6901 JSON Pointer into the failing request field, for example "/files/37/path", on validation failures.

detailsobject

Machine-readable context for the error code.

fixstring

One sentence on what to do about this error code, the same text as the type page. Read it before retrying.

suggestionsstring[]

Actionable recovery steps safe to show in dashboards, SDKs, and CLI output.

nextstring[]

Copy-pasteable commands or API requests an agent can run next.

requestIdstringrequired

The request id to quote when contacting support.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.spacefast.com/v1/spaces/string/versions/string/files' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "$schema": "http://example.com",
  "data": {
    "versionId": "string",
    "view": "uploaded",
    "files": [
      {
        "path": "string",
        "size": 0,
        "sha256": "string",
        "contentType": "string",
        "sourceUrl": "http://example.com",
        "previewable": true,
        "generatedPreview": {
          "kind": "image",
          "status": "ready",
          "key": "string",
          "cacheScope": "hash",
          "contentType": "image/webp",
          "width": 1,
          "height": 1
        }
      }
    ],
    "index": {
      "entries": [
        {
          "key": "string",
          "selector": {
            "kind": "hash",
            "sha256": "string"
          },
          "primaryPath": "string",
          "paths": [
            "string"
          ],
          "count": 0,
          "size": 0,
          "totalBytes": 0,
          "contentTypes": [
            "string"
          ],
          "previewable": true,
          "generatedPreview": {
            "kind": "image",
            "status": "ready",
            "key": "string",
            "cacheScope": "hash",
            "contentType": "image/webp",
            "width": 1,
            "height": 1
          },
          "searchText": "string"
        }
      ],
      "byHash": {
        "property1": {
          "key": "string",
          "selector": {
            "kind": "hash",
            "sha256": "string"
          },
          "primaryPath": "string",
          "paths": [
            "string"
          ],
          "count": 0,
          "size": 0,
          "totalBytes": 0,
          "contentTypes": [
            "string"
          ],
          "previewable": true,
          "generatedPreview": {
            "kind": "image",
            "status": "ready",
            "key": "string",
            "cacheScope": "hash",
            "contentType": "image/webp",
            "width": 1,
            "height": 1
          },
          "searchText": "string"
        },
        "property2": {
          "key": "string",
          "selector": {
            "kind": "hash",
            "sha256": "string"
          },
          "primaryPath": "string",
          "paths": [
            "string"
          ],
          "count": 0,
          "size": 0,
          "totalBytes": 0,
          "contentTypes": [
            "string"
          ],
          "previewable": true,
          "generatedPreview": {
            "kind": "image",
            "status": "ready",
            "key": "string",
            "cacheScope": "hash",
            "contentType": "image/webp",
            "width": 1,
            "height": 1
          },
          "searchText": "string"
        }
      },
      "byPath": {
        "property1": {
          "key": "string",
          "selector": {
            "kind": "hash",
            "sha256": "string"
          },
          "primaryPath": "string",
          "paths": [
            "string"
          ],
          "count": 0,
          "size": 0,
          "totalBytes": 0,
          "contentTypes": [
            "string"
          ],
          "previewable": true,
          "generatedPreview": {
            "kind": "image",
            "status": "ready",
            "key": "string",
            "cacheScope": "hash",
            "contentType": "image/webp",
            "width": 1,
            "height": 1
          },
          "searchText": "string"
        },
        "property2": {
          "key": "string",
          "selector": {
            "kind": "hash",
            "sha256": "string"
          },
          "primaryPath": "string",
          "paths": [
            "string"
          ],
          "count": 0,
          "size": 0,
          "totalBytes": 0,
          "contentTypes": [
            "string"
          ],
          "previewable": true,
          "generatedPreview": {
            "kind": "image",
            "status": "ready",
            "key": "string",
            "cacheScope": "hash",
            "contentType": "image/webp",
            "width": 1,
            "height": 1
          },
          "searchText": "string"
        }
      }
    },
    "search": {
      "query": "string",
      "total": 0,
      "matched": 0
    }
  }
}

Was this page helpful?