---
title: "Read exact source workspace changes"
method: GET
path: "/v1/spaces/{spaceId}/source/workspaces/{workspaceId}/diff"
tags: ["Git"]
---

# Read exact source workspace changes

`GET /v1/spaces/{spaceId}/source/workspaces/{workspaceId}/diff`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/source/workspaces/{workspaceId}/diff`
- 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`)

Compare working files with the saved base, staged snapshot with the base, or working files with staging. Hunk IDs require this revision.

## Path parameters

- `spaceId` string, required
- `workspaceId` string, required

## Query parameters

- `view` 'working' | 'staged' | 'unstaged'
- `path` string

## 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
    - `workspace` object, required
      - `id` string, required
      - `spaceId` string, required
      - `repositoryId` string, required
      - `targetBranch` string, required
      - `name` string, required
      - `revision` integer, required
      - `state` 'initializing' | 'active' | 'conflicted' | 'closed', required
      - `baseCommitSha` string, nullable, required
      - `indexCommitSha` string, nullable, required
      - `workingCommitSha` string, nullable, required
      - `headCommitSha` string, nullable, required
      - `originalUploadVersionId` string, nullable, required
      - `hasStagedChanges` boolean, required
      - `hasUnstagedChanges` boolean, required
      - `hasPendingChanges` boolean, required
      - `needsSync` boolean, required
      - `pendingOperationId` string, nullable, required
      - `autoDeploy` boolean, required
      - `createdAt` string, required
      - `updatedAt` string, required
    - `view` 'working' | 'staged' | 'unstaged', required
    - `baseCommitSha` string, required
    - `targetCommitSha` string, required
    - `stats` object, required
      - `files` integer, required
      - `additions` integer, required
      - `deletions` integer, required
      - `changes` integer, required
    - `files` object[], required
      - `path` string, required
      - `oldPath` string, nullable, required
      - `state` string, required
      - `additions` integer, required
      - `deletions` integer, required
      - `changes` integer, required
      - `patch` string, required
      - `patchTruncated` boolean, required
      - `wholeFileOnly` boolean, required
      - `hunks` object[], required
        - `id` string, required
        - `oldStart` integer, required
        - `oldLines` integer, required
        - `newStart` integer, required
        - `newLines` integer, required
        - `patch` string, required
    - `filteredFiles` object[], required
      - `path` string, required
      - `oldPath` string, nullable, required
      - `state` string, 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)
