Get a build - Spacefast Docs
Get a build
Returns one build with its status, the source it runs against, the settings snapshot it was frozen with, its target, its diagnostics, and the version it produced or reused.
GET /v1/builds/{buildId}
Authorization
Authorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).
Path parameters
buildId string required
Responses
200 Response for status 200
$schema string
Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.
data object required
idstring required
Build ID (bld_ prefix). Opaque, and never derived from a version ID.
spaceIdstring required
Space (spc_ prefix) the build publishes into.
statusstring required
Where the build is in its lifecycle. skipped means the ignored build command decided no build was needed.
Allowed: waiting_for_source, uploading_source, queued, running, succeeded, failed, canceled, skipped
inputobject required
The source a build ran against, with clone URLs and repository connection identifiers removed.
One of:
kindstring required
The build ran against an uploaded source archive.
kindstring required
The build ran against repository source.
refstring required
Branch, tag, or ref the build checked out.
commitstring
Commit the ref resolved to. Absent until resolved.
branchstring
Branch the ref belongs to, when it is known.
pullRequestNumberinteger
Pull request the build was raised for. Absent for builds off a plain branch.
sourceobject | any required
Publish provenance as declared when the build started: client, git ref data, and publish message. It is present on running and failed builds, which have no version yet; once a version exists its own source is authoritative. Null when nothing was declared.
kindstring required
How this version was produced. variable_update and config_update mark republishes Spacefast makes on its own when a variable or a setting changed; the rest name what published.
Allowed: direct_upload, cli, dashboard, api, git, import, agent, build, variable_update, config_update
clientstring
Client and version that published, for example spacefast-cli/1.2.3.
branchstring
Git branch the publish was made from.
commitstring
Git commit the publish was made from.
messagestring
One-line description of the publish, shown as the version's headline in the dashboard. There is no separate changelog field. The CLI fills it from the git commit message when it can.
dirtyboolean
Whether the working tree had uncommitted changes when the publish was made.
settingsSnapshotobject required
Build settings after saved values and per-run overrides are merged. A build freezes these at creation and runs against them for its whole life.
rootDirectorystring | any required
Directory the build runs in, relative to the source root. Null builds at the root.
installDirectorystring | any required
Directory dependencies install into, relative to the source root. Null installs in the build directory.
installCommandstring | any required
Command that installs dependencies. Null lets the build runner pick one.
buildCommandstring | any required
Command that produces the output. Null lets the build runner pick one.
outputDirectorystring | any required
Directory the built output is collected from, relative to the build directory. Null lets the build runner detect it.
ignoredBuildCommandstring | any required
Command run before the build to decide whether the build is needed. Exiting 0 ends the build as skipped; any other exit code continues. Null always builds.
frameworkPresetstring | any required
Framework the source builds with, for example next or vite. Null lets the build runner detect it.
platformPresetstring | any required
Platform build convention the source follows, for example vercel or netlify. Null lets the build runner detect it.
allowUnsupportedPlatformFeaturesboolean required
Runs the build even when the source declares platform features Spacefast does not support. Defaults to false, which refuses those sources.
timeoutSecondsinteger required
Wall-clock budget for the run, in seconds. Between 60 and 7200; defaults to 900.
targetobject required
Where a successful build's version goes.
channelstring | any required
Channel the produced version is promoted to when the build succeeds. Null publishes the version without promoting it.
previewboolean required
Marks the run as a preview build. The build environment is exported as a preview, and a preview build only supersedes other preview builds on the same branch.
retryOfBuildIdstring | any required
Build this run retries. Null when it is not a retry.
producedVersionIdstring | any required
Version (ver_ prefix) this build minted. Null until a build succeeds and mints one.
reusedVersionIdstring | any required
Version the build reused because the output was unchanged. Null otherwise.
diagnosticsobject[] required
Array of object
codestring required
Stable snake_case code for this diagnostic.
severitystring required
How serious the diagnostic is.
Allowed: info, warning, error
messagestring required
What happened, in a sentence a person can act on.
pathstring | any
File or artifact path the diagnostic refers to, with a line number when known, for example _headers:12. Absent when it applies to the whole resource.
providerstring | any
Upstream system that raised the diagnostic. Absent when Spacefast raised it.
detailsobject | any
Machine-readable context keyed by the diagnostic code.
createdAtstringrequired
ISO 8601 timestamp when the build was created.
startedAtstring| any required
ISO 8601 timestamp when the build runner started the run. Null until it does.
finishedAtstring| any required
ISO 8601 timestamp when the build reached a terminal state. Null while it is still in flight.
Try it
Server
Base URL: https://api.spacefast.com
Authorization
Bearer token