Skip to Content

Diff a template project workspace

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

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

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

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
expectedRevision*string

Response Body

Success

application/json
  1. response
projectId*TemplateProjectId
Match^tproj_[0-9a-hjkmnp-tv-z]{16,24}$
baseCommit*string
Match^[a-f0-9]{40}$
revision*string
changes*array<>
assetChanges*array<>
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.templates.diffWorkspace({
  "id": "example",
  "expectedRevision": "example"
});
Example Response
{
  "projectId": "string",
  "baseCommit": "string",
  "revision": "string",
  "changes": [
    {
      "path": "string",
      "before": "string",
      "after": "string",
      "status": "added"
    }
  ],
  "assetChanges": [
    {
      "path": "string",
      "status": "added",
      "digest": "string"
    }
  ]
}

Related documentation