---
title: "List source commits"
method: GET
path: "/v1/spaces/{spaceId}/source/commits"
tags: ["Git"]
---

# List source commits

`GET /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:read`)

Read source commit history for a branch. Each commit includes parentShas in Git order. Use the newest commit SHA as expectedHeadSha when you edit that branch.

## Path parameters

- `spaceId` string, required

## Query parameters

- `connectionType` 'connected' | 'hosted': Which of the space's repository connections to act on: `connected` for the repository you linked from a provider, `hosted` for the one Spacefast hosts and you push to.
- `branch` string: Branch to read history from. Defaults to the repository's default branch.
- `path` string: Return only commits that touched this path.
- `cursor` string: Opaque cursor from the previous page's `pagination.nextCursor`.
- `limit` integer: Maximum commits to return.
- `ephemeral` string: Resolve `branch` as a short-lived branch from `POST /v1/spaces/{spaceId}/source/ephemeral-branch` rather than an ordinary one.

## Response `200`

Response for status 200

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `repositoryConnection` object, required
      - `id` string, required: Repository connection id (`rpc_`).
      - `spaceId` string, required
      - `provider` 'github' | 'gitlab' | 'bitbucket' | 'generic', required: Git host family for the repository connection.
      - `connectionType` 'connected' | 'hosted', required
      - `repositoryId` string, nullable, required
      - `installationId` string, nullable, required: Repository app installation id, when configured.
      - `cloneUrlConfigured` boolean, required: Whether a repository clone URL is configured.
      - `upstreamUrlConfigured` boolean, required: Whether an upstream repository URL is configured.
      - `forkState` object, nullable: Initial main-branch remix progress, backed by its durable operation.
        - `copied` boolean, required
        - `status` 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled', required
      - `repositoryName` string, required
      - `repositoryFullName` string, required
      - `defaultBranch` string, required
      - `productionBranch` string, required
      - `credentialConfigured` boolean, required
      - `autoDeployProduction` boolean, required
      - `autoDeployPreviews` boolean, required
      - `githubPreviewCommentsEnabled` boolean, nullable: Controls GitHub preview comments for this Space. Set null to use the team setting.
      - `buildSettings` object, required: Resolved build settings. Builds persist this as an immutable `settingsSnapshot`.
        - `rootDirectory` string, nullable, required
        - `installDirectory` string, nullable, required
        - `installCommand` string, nullable, required
        - `buildCommand` string, nullable, required
        - `outputDirectory` string, nullable, required
        - `ignoredBuildCommand` string, nullable, required
        - `frameworkPreset` string, nullable, required
        - `platformPreset` string, nullable, required
        - `allowUnsupportedPlatformFeatures` boolean, required
        - `timeoutSeconds` integer, required
      - `syncStatus` 'idle' | 'syncing' | 'ready' | 'failed', required
      - `providerAccessStatus` 'active' | 'suspended' | 'revoked' | 'reauthorization_required', required
      - `providerAccessError` string, nullable, required
      - `lastSyncedAt` string, date-time, nullable, required
      - `lastSyncError` string, nullable, required
      - `syncRunId` string, nullable, required
      - `connectedUserId` string, nullable, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
    - `repositoryId` string, required
    - `commits` object[], required
      - `sha` string, required
      - `parentShas` string[], required: Parent commit SHAs in Git order. The array is empty for a root commit.
      - `message` string, required
      - `authorName` string, required
      - `authorEmail` string, required
      - `committerName` string, required
      - `committerEmail` string, required
      - `date` string, required
      - `signature` string, nullable, required: Armored commit signature. Only populated when reading one commit.
    - `pagination` object, required
      - `nextCursor` string, nullable, required
      - `hasMore` boolean, required

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

[API](https://skmtc.dev/spacefast/apis/spacefast-api.md) · [All operations](https://skmtc.dev/spacefast/apis/spacefast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacefast/apis/spacefast-api/revisions/bd165bc7c983?raw)
