Get a source commit - Spacefast Docs
Get a source commit
Read commit metadata, including parentShas in Git order. An empty parentShas array identifies a root commit.
Endpoint
GET /v1/spaces/{spaceId}/source/commit
Authorization
Authorization Bearer token · header required
Authorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).
or
Authorization OAuth2 access token · header required
OAuth 2.0 with Spacefast scopes. People use the authorization code flow; machines use client credentials.
Scopes:
spaces:read
Path parameters
spaceId string required
Query parameters
branchstring (min length 1)connectionTypestring required (default: "connected")- Allowed:
connectedhosted
- Allowed:
savedOnlybooleanshastring required (min length 1)
Responses
200 Response for status 200
$schemastring- Canonical JSON Schema URL for this response body.
dataobject requiredcommitobject requiredauthorEmailstring requiredauthorNamestring requiredcommitterEmailstring requiredcommitterNamestring requireddatestring requiredmessagestring requiredparentShasstring[] required- Parent commit SHAs in Git order. The array is empty for a root commit.
shastring requiredsignaturestring | any required- Armored commit signature. Null when the commit is unsigned.
repositoryConnectionobject requiredidstring required- Source connection ID (
rpc_prefix).
- Source connection ID (
spaceIdstring required- Space this connection feeds.
providerstring required- Git host the repository lives on.
- Allowed:
githubgitlabbitbucketgeneric
connectionTypestring requiredconnectedfor a repository linked from a Git host,hostedfor the mirror Spacefast hosts and the caller pushes to.- Allowed:
connectedhosted
repositoryIdstring | any required- Identifier of the mirror that content reads and builds run against. Null when no mirror is bound yet.
installationIdstring | any required- GitHub App installation the connection reads through. Null for a hosted mirror. (default: null)
cloneUrlConfiguredboolean required- Whether a clone URL is stored. The URL itself is not returned. (default: false)
upstreamUrlConfiguredboolean required- Whether an upstream URL to pull from is stored. The URL itself is not returned. (default: false)
repositoryNamestring required- Repository name without its owner.
repositoryFullNamestring required- Repository name as
owner/name.
- Repository name as
defaultBranchstring required- Branch the Git host treats as the repository default.
productionBranchstring required- Branch whose pushes produce production builds, and the ref content reads fall back to when none is given.
credentialConfiguredboolean required- Whether a Git credential is stored. The credential itself is never returned.
autoDeployProductionboolean required- Whether a push to the production branch queues a build.
autoDeployPreviewsboolean required- Whether a push to any other branch or a pull request queues a preview build.
buildSettingsobject required- Install, build, and output settings each build runs with.
rootDirectorystring | any required- Directory the build runs in, relative to the source root. Null builds at the root. (default: null)
installDirectorystring | any required- Directory dependencies install into, relative to the source root. Null installs in the build directory. (default: null)
installCommandstring | any required- Command that installs dependencies. Null lets the build runner pick one. (default: null)
buildCommandstring | any required- Command that produces the output. Null lets the build runner pick one. (default: null)
outputDirectorystring | any required- Directory the built output is collected from, relative to the build directory. Null lets the build runner detect it. (default: null)
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. (default: null)
- Command run before the build to decide whether the build is needed. Exiting 0 ends the build as
frameworkPresetstring | any required- Framework the source builds with, for example
nextorvite. Null lets the build runner detect it. (default: null)
- Framework the source builds with, for example
platformPresetstring | any required- Platform build convention the source follows, for example
vercelornetlify. Null lets the build runner detect it. (default: null)
- Platform build convention the source follows, for example
allowUnsupportedPlatformFeaturesboolean required- Runs the build even when the source declares platform features Spacefast does not support. Defaults to
false, which refuses those sources. (default: false)
- Runs the build even when the source declares platform features Spacefast does not support. Defaults to
timeoutSecondsinteger required- Wall-clock budget for the run, in seconds. Between 60 and 7200; defaults to 900. (min 60 · max 7200 · default: 900)
- Install, build, and output settings each build runs with.
syncStatusstring requiredidlebefore the first sync,syncingwhile one runs,readyonce content reads work,failedwhen the last one did not finish.- Allowed:
idlesyncingreadyfailed
providerAccessStatusstring required- Whether the Git host still grants access. Anything other than
activeblocks builds until the caller reinstalls or reauthorizes. (default: "active") - Allowed:
activesuspendedrevokedreauthorization_required
- Whether the Git host still grants access. Anything other than
providerAccessErrorstring | any required- What the Git host reported when access stopped working. Null while access holds. (default: null)
lastSyncedAtstring| any required - ISO 8601 timestamp of the last sync that finished. Null before the first one.
lastSyncErrorstring | any required- Why the last sync failed. Null after a sync that succeeded.
syncRunIdstring | any required- Identifier of the sync in flight. Null when no sync is running.
connectedUserIdstring | any required- User who last authorized or changed the connection. Null when no user did.
createdAtstringrequired - ISO 8601 timestamp when the connection was created.
updatedAtstringrequired - ISO 8601 timestamp of the last change.
repositoryIdstring required
Error Responses
4xx and 5xx errors
Every 4xx and 5xx response is one RFC 9457 problem document served as application/problem+json.