Git

Create a repository commit

Save file operations as one Git commit. Spacefast creates a missing hosted repository for an initial commit. Send expectedHeadSha to reject stale writes. With sourceVersionId, preserve all original upload files before applying operations. The version must be current, ready, and a direct static upload. This option requires versions:read and versions:download in addition to spaces:write. Use 40 zeroes for expectedHeadSha and omit base or ephemeral branches. The hosted repository must have no branches, ephemeral branches, or tags. Upload bytes and replacement contents must total at most 4 MiB, with at most 1,000 uploaded files. A commit does not confirm deployment.

post/v1/spaces/{spaceId}/source/commits

Request

  • Base URL: https://api.spacefast.com
  • URL: https://api.spacefast.com/v1/spaces/{spaceId}/source/commits
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.spacefast.com/v1/auth/oauth2/authorize, token URL https://api.spacefast.com/v1/auth/oauth2/token; client credentials, token URL https://api.spacefast.com/v1/auth/oauth2/token, scopes: spaces:write)

Path parameters

spaceIdstring required

Request body

connectionType'connected' | 'hosted' required
targetBranchstring required
commitMessagestring required
expectedHeadShastring

Commit SHA the caller read from the target branch. The write fails if the branch changed.

sourceVersionIdstring

Initialize hosted source from this original static upload before applying operations. Requires a zero expectedHeadSha and version read/download permissions.

baseBranchstring
ephemeralboolean
ephemeralBaseboolean

Response

Response 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.

Changes

No recorded changes to this operation across all 1 revision of this API.