Start a new version upload
Creates a version and returns upload instructions. The declared file manifest drives change-only uploads: unchanged files are retained from the previous version and only the remainder is requested.
/v1/spaces/{spaceId}/versionsAuthorizationBearer token · headerrequiredSpace key (sfc_…) for an unclaimed anonymous Space. Also the fragment of its claim URL and the token of its /__/<key> door. A publish without a credential returns it in claim with the claim link. With the key, getSpace extends the Space's expiry window, getSpaceVersion follows its publish, createSpaceOpenLink returns its reusable open link, and restoreSpace undoes a deleteSpace while the claim window remains open.
AuthorizationBearer token · headerrequiredBetter Auth session, OAuth access token, OAuth client-credentials token, or sfm_ Space machine credential.
spaceIdstringrequiredapplication/jsonsourceobjectPublish provenance recorded on the version; defaults to {kind: "direct_upload"}.
Show propertiesHide properties
kindstringrequiredHow this version was produced.
direct_uploadclidashboardapigitimportagentbuildvariable_updateconfig_updateclientstringPublishing client attribution, for example spacefast-cli/1.2.3.
branchstringGit branch the publish came from.
commitstringGit commit SHA the publish came from.
messagestringPlain-language description of the publish (the version changelog entry, commit message, or release note). This is THE spelling for the publish description; the version files-diff API is the fallback when none is given.
dirtybooleanWhether the working tree had uncommitted changes at publish time.
metadataobjectAdditional provenance (repository, CI run URL, workflow, actor, ...).
gitobjectShow propertiesHide properties
repositorystring | nullrepositoryFullNamestring | nullrepositoryUrlstring | nullrefstring | nullbranchstring | nullbranchAliasUrlstring | nullcommitstring | nullcommitShastring | nullpullRequestNumbernumber | nullpublishModestringHow to interpret omitted paths in files: additive retains existing paths unless explicitly replaced; snapshot treats files as the complete desired manifest.
additivesnapshotsourceMetadataobjectAdditional control-plane-only provenance for build and deploy read models.
buildLogstringBuild transcript truncated to a bounded size for deploys that ran a local build before publishing.
finalizeobjectFinalize intent for a declared upload. The version finalizes itself once Spacefast confirms every declared file landed: at create when nothing needs uploading, otherwise on the uploads/refresh call that finds nothing pending. Call refresh after the last upload. The explicit finalize call remains available for recovery and replay.
Show propertiesHide properties
channelstring | nullShow propertiesHide properties
stringnullfilesobject[]requiredThe complete desired file manifest. sha256 is optional: omit it to upload by path and let the runtime hash the bytes, or include it to upload by content address, with the digest verified as the bytes land. A sourceUrl entry is fetched and hashed by the runtime.
Show propertiesHide properties
objectpathstringrequiredVersion-relative POSIX file path, percent-decoded once, stripped of leading slashes, and normalized to UTF-8 NFC. No traversal, backslashes, or control characters; at most 1,024 canonical UTF-8 bytes.
sizeintegerrequiredFile size in bytes.
sha256stringOptional 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.
contentTypestringOptional 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.
configOnlybooleanRecompile the configuration on top of the current ready artifact without replacing content: the file catalog carries forward, Functions/Zero declarations and runtime detection are preserved, and the version records a config_update source. files may name only sf.jsonc (the shipped configuration); every other path keeps the current version's bytes. Requires an existing ready version to carry forward. Runtime changes still need a normal content publish.
deletePathsstring[]Explicit paths to remove when publishMode is additive. Omitted paths are retained. Only listed paths are deleted.
immutableAssetPrefixesstring[]Publisher-owned directory prefixes whose declared files are immutable generation assets. Snapshot publishes retain the matching files from the current generation for exactly one subsequent generation.
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.
dataobjectrequiredShow propertiesHide properties
ignoredPathsstring[]Deprecated; current servers return an empty array.
versionIdstring | nullrequiredCreated version id, or null when the manifest matched and nothing changed.
uploadobject | nullrequiredRuntime upload session; present only while bytes still need uploading. Upload first, then finalize.
Show propertiesHide properties
idstringrequiredUpload session id (upl_…) minted by the runtime.
expiresAtstring<date-time>requiredInstant when the session token expires. This rotates only the token, never the version lifecycle boundary. Resume always mints a fresh token.
summaryobjectrequiredCounts for the whole manifest, independent of target paging.
Show propertiesHide properties
uploadintegerrequiredFiles that still need uploading.
reusedintegerrequiredFiles satisfied by hash reuse.
ignoredintegerDeprecated; current servers return zero.
targetsobject[]requiredOpaque upload targets, bounded by the instruction payload budget. Upload these, then call links.refresh for the remainder.
Show propertiesHide properties
objectpathstringrequiredCaller-local path/key identifying the bytes this target accepts.
methodstringrequiredHTTP method to use for this target.
PUTPOSTurlstring<uri> | stringrequiredAbsolute or API-relative upload URL issued by the control plane.
Show propertiesHide properties
string<uri>stringheadersobjectrequiredExact headers to send with the upload request.
bodyobjectOptional body recipe. Omitted means the client uploads the local bytes for path; url means POST the URL for server-side fetch.
Show propertiesHide properties
kindstringrequiredurlstring<uri>requiredsizeintegerExpected byte size when known.
maxBytesintegerMaximum accepted byte size when the server can advertise it.
sha256stringcontentTypestringbulkobjectOptional direct runtime transport for this page's content-addressed targets. Clients that do not support it continue with targets.
Show propertiesHide properties
kindstringrequiredmethodstringrequiredurlstring<uri> | stringrequiredUpload-auth runtime URL that accepts a ZIP of SHA-named CAS blobs.
Show propertiesHide properties
string<uri>stringheadersobjectrequiredExact headers to send with the bulk upload request.
maxCompressedBytesintegerrequiredmaxExpandedBytesintegerrequiredmaxBlobsintegerrequiredlinksobjectrequiredShow propertiesHide properties
refreshstringrequiredresumestringfinalizestringrequireddetailsobjectShow propertiesHide properties
reusedobject[]Show propertiesHide properties
objectpathstringrequiredreasonstringrequireddiagnosticsobject[]Show propertiesHide properties
objectcodestringrequiredStable snake_case diagnostic code naming the public contract that produced it.
severitystringrequiredHow actionable the diagnostic is.
infowarningerrormessagestringrequiredHuman-readable explanation with enough detail to act on.
pathstring | nullArtifact path the diagnostic points at, for example "_headers:12", when one exists.
providerstring | nullUpstream system the diagnostic originated from, when not Spacefast itself.
Show propertiesHide properties
stringnulldetailsobject | nullMachine-readable context for the diagnostic code.
Show propertiesHide properties
objectnullfixstring | nullConcrete, agent-actionable remediation hint, when one can be derived.
retryableboolean | nullWhether retrying the same operation can resolve this diagnostic without the caller changing anything.
nullResponse for status 201
$schemastring<uri>Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.
dataobjectrequiredShow propertiesHide properties
ignoredPathsstring[]Deprecated; current servers return an empty array.
versionIdstring | nullrequiredCreated version id, or null when the manifest matched and nothing changed.
uploadobject | nullrequiredRuntime upload session; present only while bytes still need uploading. Upload first, then finalize.
Show propertiesHide properties
idstringrequiredUpload session id (upl_…) minted by the runtime.
expiresAtstring<date-time>requiredInstant when the session token expires. This rotates only the token, never the version lifecycle boundary. Resume always mints a fresh token.
summaryobjectrequiredCounts for the whole manifest, independent of target paging.
Show propertiesHide properties
uploadintegerrequiredFiles that still need uploading.
reusedintegerrequiredFiles satisfied by hash reuse.
ignoredintegerDeprecated; current servers return zero.
targetsobject[]requiredOpaque upload targets, bounded by the instruction payload budget. Upload these, then call links.refresh for the remainder.
Show propertiesHide properties
objectpathstringrequiredCaller-local path/key identifying the bytes this target accepts.
methodstringrequiredHTTP method to use for this target.
PUTPOSTurlstring<uri> | stringrequiredAbsolute or API-relative upload URL issued by the control plane.
Show propertiesHide properties
string<uri>stringheadersobjectrequiredExact headers to send with the upload request.
bodyobjectOptional body recipe. Omitted means the client uploads the local bytes for path; url means POST the URL for server-side fetch.
Show propertiesHide properties
kindstringrequiredurlstring<uri>requiredsizeintegerExpected byte size when known.
maxBytesintegerMaximum accepted byte size when the server can advertise it.
sha256stringcontentTypestringbulkobjectOptional direct runtime transport for this page's content-addressed targets. Clients that do not support it continue with targets.
Show propertiesHide properties
kindstringrequiredmethodstringrequiredurlstring<uri> | stringrequiredUpload-auth runtime URL that accepts a ZIP of SHA-named CAS blobs.
Show propertiesHide properties
string<uri>stringheadersobjectrequiredExact headers to send with the bulk upload request.
maxCompressedBytesintegerrequiredmaxExpandedBytesintegerrequiredmaxBlobsintegerrequiredlinksobjectrequiredShow propertiesHide properties
refreshstringrequiredresumestringfinalizestringrequireddetailsobjectShow propertiesHide properties
reusedobject[]Show propertiesHide properties
objectpathstringrequiredreasonstringrequireddiagnosticsobject[]Show propertiesHide properties
objectcodestringrequiredStable snake_case diagnostic code naming the public contract that produced it.
severitystringrequiredHow actionable the diagnostic is.
infowarningerrormessagestringrequiredHuman-readable explanation with enough detail to act on.
pathstring | nullArtifact path the diagnostic points at, for example "_headers:12", when one exists.
providerstring | nullUpstream system the diagnostic originated from, when not Spacefast itself.
Show propertiesHide properties
stringnulldetailsobject | nullMachine-readable context for the diagnostic code.
Show propertiesHide properties
objectnullfixstring | nullConcrete, agent-actionable remediation hint, when one can be derived.
retryableboolean | nullWhether retrying the same operation can resolve this diagnostic without the caller changing anything.
nullProblem 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.
typestringrequiredProblem type URI resolving to the error docs page. The server derives it mechanically from code against the docs origin.
titlestringrequiredShort human-readable summary of the problem type. The server derives it mechanically from code.
statusintegerrequiredHTTP status code of this response, repeated in the body.
detailstringrequiredHuman-readable failure explanation for this occurrence.
codestringrequiredStable snake_case error code naming the failed public contract.
pointerstringRFC 6901 JSON Pointer into the failing request field, for example "/files/37/path", on validation failures.
detailsobjectMachine-readable context for the error code.
fixstringOne 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.
requestIdstringrequiredThe request id to quote when contacting support.