---
title: "Compare deployment files"
method: GET
path: "/v1/spaces/{spaceId}/versions/compare"
tags: ["Versions"]
---

# Compare deployment files

`GET /v1/spaces/{spaceId}/versions/compare`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/versions/compare`
- Auth: HTTP bearer

Compare the served files of two completed deployment versions. This does not compare Git source. File contents require versions:download access. Binary, oversized, or unavailable contents include a reason instead of a partial diff.

## Path parameters

- `spaceId` string, required

## Query parameters

- `baseVersionId` string, required: ID of the earlier deployment version.
- `versionId` string, required: ID of the deployment version to compare.
- `path` string: Read before-and-after text for this file path. Requires versions:download access.
- `cursor` string: Copy the next cursor from this exact version comparison.
- `limit` integer: Maximum changed paths to return.

## 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
    - `spaceId` string, required
    - `view` 'served', required
    - `baseDeploymentVersionId` string, required
    - `deploymentVersionId` string, required
    - `baseVersionNumber` integer, nullable, required
    - `versionNumber` integer, nullable, required
    - `stats` object, required
      - `files` integer, required
      - `added` integer, required
      - `modified` integer, required
      - `deleted` integer, required
    - `files` object[], required
      - `path` string, required
      - `state` 'added' | 'modified' | 'deleted', required
      - `before` object, nullable, required
        - `sha256` string, required
        - `size` integer, required
        - `contentType` string, nullable, required
      - `after` object, nullable, required
        - `sha256` string, required
        - `size` integer, required
        - `contentType` string, nullable, required
    - `file` object, nullable, required
      - `path` string, required
      - `before` string, nullable, required
      - `after` string, nullable, required
      - `beforeReason` 'not_present' | 'binary' | 'too_large' | 'unavailable', nullable, required
      - `afterReason` 'not_present' | 'binary' | 'too_large' | 'unavailable', nullable, required
    - `sourceComparison` object, nullable, required
      - `repositoryId` string, required
      - `baseSourceCommitSha` string, required
      - `sourceCommitSha` string, required
    - `pagination` object, required
      - `nextCursor` string, nullable, required: Opaque cursor for the next page; null when there are no more results.
      - `hasMore` boolean, required: Whether another page exists after this one.

## 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)
