---
title: "Diff a template project workspace"
method: POST
path: "/v1/templates/{id}/workspace/diff"
tags: ["Templates"]
---

# Diff a template project workspace

`POST /v1/templates/{id}/workspace/diff`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/templates/{id}/workspace/diff`
- Auth: API key in header `x-api-key`

Returns exact added, modified, and deleted project files against the current Git base commit.

## Path parameters

- `id` string, required

## Request body

- object
  - `expectedRevision` string, required

## Response `200`

Success

- object
  - `projectId` string, required
  - `baseCommit` string, required
  - `revision` string, required
  - `changes` object[], required
    - `path` string, required
    - `before` string, nullable, required
    - `after` string, nullable, required
    - `status` 'added' | 'modified' | 'deleted', required
  - `assetChanges` object[], required
    - `path` string, required
    - `status` 'added' | 'modified' | 'deleted', required
    - `digest` string, nullable, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `409`: ConflictError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

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