Skip to Content

Save a template project workspace

Validates the effective project tree and saves it as one Git commit on the template repository's default branch.

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

Validates the effective project tree and saves it as one Git commit on the template repository's default branch.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

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

Header Parameters

idempotency-key*string
Length1 <= length <= 255

Request Body

application/json
  1. body
expectedRevision*string
expectedHead*string
Match^[a-f0-9]{40}$
message*string
Length1 <= length <= 512

Response Body

Success

application/json
  1. response
commit*string
Match^[a-f0-9]{40}$
parentCommit*string
Match^[a-f0-9]{40}$
tree*string
Match^[a-f0-9]{40}$
revision*string
changedPaths*array<>
sourceDigest*string
Match^[a-f0-9]{64}$
buildDigest*string
Match^[a-f0-9]{64}$
warnings*array<>
incompatibilities*array<>
Example Request
import { createClient } from "samva";

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

const result = await samva.templates.saveWorkspace({
  "id": "example",
  "expectedRevision": "example",
  "expectedHead": "example",
  "message": "example"
});
Example Response
{
  "commit": "string",
  "parentCommit": "string",
  "tree": "string",
  "revision": "string",
  "changedPaths": [
    "string"
  ],
  "sourceDigest": "string",
  "buildDigest": "string",
  "warnings": [
    {
      "code": "string",
      "severity": "error",
      "message": "string",
      "origins": [
        {
          "fileName": "string",
          "lineNumber": 1,
          "columnNumber": 1
        }
      ],
      "clients": [
        "string"
      ],
      "notes": "string",
      "provenance": "string",
      "fixtures": [
        "string"
      ],
      "occurrences": [
        [
          {
            "fileName": "string",
            "lineNumber": 1,
            "columnNumber": 1
          }
        ]
      ],
      "compatibility": {
        "assessment": "risk",
        "title": "string"
      }
    }
  ],
  "incompatibilities": [
    {
      "code": "string",
      "severity": "error",
      "message": "string",
      "origins": [
        {
          "fileName": "string",
          "lineNumber": 1,
          "columnNumber": 1
        }
      ],
      "clients": [
        "string"
      ],
      "notes": "string",
      "provenance": "string",
      "fixtures": [
        "string"
      ],
      "occurrences": [
        [
          {
            "fileName": "string",
            "lineNumber": 1,
            "columnNumber": 1
          }
        ]
      ],
      "compatibility": {
        "assessment": "risk",
        "title": "string"
      }
    }
  ]
}

Related documentation