Create a build from a source archive, repository, or managed source
Creates a build that produces a version on success through the normal publish path. Repository inputs use the saved connection; source archive inputs receive an upload instruction the new build owns. Naming a managed source instead builds it from its connected production repository with the saved settings and live target. The caller cannot select source code, commands, settings, refs, or publish targets, and must send an Idempotency-Key header: a managed-source trigger without one fails with 422 idempotency_key_required.
/v1/spaces/{spaceId}/buildsAuthorizationBearer token · headerrequiredBetter Auth session, OAuth access token, OAuth client-credentials token, or sfm_ Space machine credential.
spaceIdstringrequiredIdempotency-KeystringOptional client-generated key, at most 255 characters, that makes this write safe to retry. The first request with a given key stores its outcome, scoped to your tenant, credential, and route. A retry with the same key and an identical body does not execute again: the server replays the stored response and marks it Idempotency-Replayed: true. A request that reuses a key with a different body fails with 409 idempotency_key_reused. A duplicate request that arrives while the first is still in flight fails with 409 idempotency_conflict_in_progress. The server keeps each key for 24 hours.
application/jsonA caller-described build, or a build triggered from a managed source.
sourcestringrequiredBuild the Space's configured WordPress source.
sourceUrlstring<uri>requiredConfigured WordPress URL that changed, as stored in the Space's data sources.
inputobjectrequiredWhat a new build should run against.
Show propertiesHide properties
kindstringrequiredBuild from an uploaded source archive.
sourceMetadataobjectSource provenance for the produced version.
kindstringrequiredBuild from a repository connection.
repositoryConnectionIdstringrequiredRepository connection (rpc_) to build from.
refstringPublic branch, tag, or full saved commit SHA to build.
commitstringFull commit SHA from the chosen public branch or tag history.
branchstringBranch name when the ref is a commit SHA.
settingsobjectPer-run settings overrides, persisted as settingsSnapshot after resolution.
Show propertiesHide properties
rootDirectorystring | nullShow propertiesHide properties
stringnullinstallDirectorystring | nullShow propertiesHide properties
stringnullinstallCommandstring | nullShow propertiesHide properties
stringnullbuildCommandstring | nullShow propertiesHide properties
stringnulloutputDirectorystring | nullShow propertiesHide properties
stringnullignoredBuildCommandstring | nullShow propertiesHide properties
stringnullframeworkPresetstring | nullShow propertiesHide properties
stringnullplatformPresetstring | nullShow propertiesHide properties
stringnullallowUnsupportedPlatformFeaturesbooleantimeoutSecondsintegertargetobjectOmit to use the Space's channel mapping for the repository ref. Send channel: null or preview: true to prevent automatic promotion. An empty target object also prevents promotion.
Show propertiesHide properties
channelstring | nullChannel to promote when the build succeeds. production is an alias for live; null means no automatic promotion.
Show propertiesHide properties
stringnullpreviewbooleanWhether the build targets preview behavior.
diagnosticsobject[]Diagnostics already known before the build is queued.
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.
waitbooleanWait for the build to finish before this request returns. Agents must keep this false and poll the build status. Synchronous clients can set it to true.
sourceanyOmit source to describe the build yourself.
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
buildobjectrequiredShow propertiesHide properties
captureobjectURL capture progress and advisory evidence; absent for other inputs.
Show propertiesHide properties
statestringrequiredpreviewSummaryobjectprogressobjectarchiveHashstringidstringrequiredBuild id (bld_); opaque and never derived from a version id.
spaceIdstringrequiredSpace (spc_) the build produces a version for.
statusstringrequiredBuild lifecycle status.
waiting_for_sourceuploading_sourcequeuedrunningsucceededfailedcanceledskippedinputobjectrequiredPublic build input. Internal clone URLs and provider source references are hidden.
Show propertiesHide properties
kindstringrequiredsourceUrlstring<uri>requiredkindstringrequiredBuild from an uploaded source archive.
kindstringrequiredBuild from repository source where clone credentials are not exposed.
refstringrequiredBranch, tag, or ref to build.
commitstringExact commit built, once resolved.
branchstringBranch name when available.
pullRequestNumberintegersourceobject | nullrequiredPublish provenance as declared at build start (client, git ref data, publish message). Present on failed and running builds too; the produced version's source is the authoritative copy once one exists. Null when nothing was declared.
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 | nullnullsettingsSnapshotobjectrequiredResolved build settings. Builds persist this as an immutable settingsSnapshot.
Show propertiesHide properties
rootDirectorystring | nullrequiredShow propertiesHide properties
stringnullinstallDirectorystring | nullrequiredShow propertiesHide properties
stringnullinstallCommandstring | nullrequiredShow propertiesHide properties
stringnullbuildCommandstring | nullrequiredShow propertiesHide properties
stringnulloutputDirectorystring | nullrequiredShow propertiesHide properties
stringnullignoredBuildCommandstring | nullrequiredShow propertiesHide properties
stringnullframeworkPresetstring | nullrequiredShow propertiesHide properties
stringnullplatformPresetstring | nullrequiredShow propertiesHide properties
stringnullallowUnsupportedPlatformFeaturesbooleanrequiredtimeoutSecondsintegerrequiredtargetobjectrequiredWhere a successful build should publish or run in preview mode.
Show propertiesHide properties
channelstring | nullrequiredChannel to promote when the build succeeds. production is an alias for live; null means no automatic promotion.
Show propertiesHide properties
stringnullpreviewbooleanrequiredWhether the build targets preview behavior.
retryOfBuildIdstring | nullrequiredOriginal build retried by this build.
producedVersionIdstring | nullrequiredVersion (ver_) minted by a successful build; null otherwise.
reusedVersionIdstring | nullrequiredExisting version reused by a successful no-change build; null otherwise.
diagnosticsobject[]requiredShow 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.
createdAtstring<date-time>requiredstartedAtstring<date-time> | nullrequiredWhen the runner picked the build up.
Show propertiesHide properties
string<date-time>nullfinishedAtstring<date-time> | nullrequiredWhen the build reached a terminal state.
Show propertiesHide properties
string<date-time>nulluploadobject | nullrequiredShow propertiesHide properties
idstringrequiredUpload session id (upl_…) minted by the runtime.
modestringrequireddist bytes are publishable output. source bytes must be transformed, unpacked, or built before publish.
distsourceexpiresAtstring<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
buildobjectrequiredShow propertiesHide properties
captureobjectURL capture progress and advisory evidence; absent for other inputs.
Show propertiesHide properties
statestringrequiredpreviewSummaryobjectprogressobjectarchiveHashstringidstringrequiredBuild id (bld_); opaque and never derived from a version id.
spaceIdstringrequiredSpace (spc_) the build produces a version for.
statusstringrequiredBuild lifecycle status.
waiting_for_sourceuploading_sourcequeuedrunningsucceededfailedcanceledskippedinputobjectrequiredPublic build input. Internal clone URLs and provider source references are hidden.
Show propertiesHide properties
kindstringrequiredsourceUrlstring<uri>requiredkindstringrequiredBuild from an uploaded source archive.
kindstringrequiredBuild from repository source where clone credentials are not exposed.
refstringrequiredBranch, tag, or ref to build.
commitstringExact commit built, once resolved.
branchstringBranch name when available.
pullRequestNumberintegersourceobject | nullrequiredPublish provenance as declared at build start (client, git ref data, publish message). Present on failed and running builds too; the produced version's source is the authoritative copy once one exists. Null when nothing was declared.
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 | nullnullsettingsSnapshotobjectrequiredResolved build settings. Builds persist this as an immutable settingsSnapshot.
Show propertiesHide properties
rootDirectorystring | nullrequiredShow propertiesHide properties
stringnullinstallDirectorystring | nullrequiredShow propertiesHide properties
stringnullinstallCommandstring | nullrequiredShow propertiesHide properties
stringnullbuildCommandstring | nullrequiredShow propertiesHide properties
stringnulloutputDirectorystring | nullrequiredShow propertiesHide properties
stringnullignoredBuildCommandstring | nullrequiredShow propertiesHide properties
stringnullframeworkPresetstring | nullrequiredShow propertiesHide properties
stringnullplatformPresetstring | nullrequiredShow propertiesHide properties
stringnullallowUnsupportedPlatformFeaturesbooleanrequiredtimeoutSecondsintegerrequiredtargetobjectrequiredWhere a successful build should publish or run in preview mode.
Show propertiesHide properties
channelstring | nullrequiredChannel to promote when the build succeeds. production is an alias for live; null means no automatic promotion.
Show propertiesHide properties
stringnullpreviewbooleanrequiredWhether the build targets preview behavior.
retryOfBuildIdstring | nullrequiredOriginal build retried by this build.
producedVersionIdstring | nullrequiredVersion (ver_) minted by a successful build; null otherwise.
reusedVersionIdstring | nullrequiredExisting version reused by a successful no-change build; null otherwise.
diagnosticsobject[]requiredShow 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.
createdAtstring<date-time>requiredstartedAtstring<date-time> | nullrequiredWhen the runner picked the build up.
Show propertiesHide properties
string<date-time>nullfinishedAtstring<date-time> | nullrequiredWhen the build reached a terminal state.
Show propertiesHide properties
string<date-time>nulluploadobject | nullrequiredShow propertiesHide properties
idstringrequiredUpload session id (upl_…) minted by the runtime.
modestringrequireddist bytes are publishable output. source bytes must be transformed, unpacked, or built before publish.
distsourceexpiresAtstring<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.