---
title: "Both previews and the files the draft changed"
method: GET
path: "/builder/drafts/{draftId}/compare"
tags: ["Builder"]
---

# Both previews and the files the draft changed

`GET /builder/drafts/{draftId}/compare`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/builder/drafts/{draftId}/compare`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `draftId` string, uuid, required

## Response `200`

The comparison

- object
  - `draft` object, required
    - `id` string, uuid, required
    - `parentSessionId` string, uuid, required
    - `draftSessionId` string, uuid, required
    - `title` string, required
    - `branch` string, required
    - `status` 'open' | 'kept' | 'discarded', required
    - `baseCommitSha` string, nullable, required
    - `createdAt` string, required: ISO-8601 timestamp
    - `closedAt` string, nullable, required: ISO-8601 timestamp
    - `parentChanged` boolean, required: The site changed since the draft started (keeping it merges both)
  - `sitePreviewUrl` string, nullable, required
  - `draftPreviewUrl` string, nullable, required
  - `files` object[], required
    - `path` string, required
    - `base` string, nullable, required: When the draft started
    - `site` string, nullable, required: The site now
    - `draft` string, nullable, required: The draft now
    - `conflict` boolean, required: Both changed the same lines
  - `fastForward` boolean, required: The site did not change: keeping only takes the draft's files
  - `conflicts` integer, required

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `402`: Code editing and GitHub sync need a paid plan (code upgrade_required, details.feature builder.github_export), or a limit was reached
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: A change is running, the editor is stale (details.reason stale), a secret is in the code (secret_detected), or the draft is closed
- `501`: Not available on this server (code not_configured)

---

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