Check a template project workspace
Check a template project workspace. Request: POST /v1/templates/{id}/workspace/check. Scope: templates:read.
POST
Builds the template entry from the current effective workspace tree, including unsaved file patches, and returns what the template declares plus every compile and target-client finding. Nothing is written and no message is rendered.
apiKeyheader
x-api-key<token>id*stringMatch
^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
expectedRevision*stringSuccess
application/json- response
projectId*TemplateProjectIdMatch
^tproj_[0-9a-hjkmnp-tv-z]{16,24}$revision*stringentryPath*|declaration*|nullissue?diagnostics*array<>incompatibilities*array<>import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.templates.checkWorkspace({
"id": "example",
"expectedRevision": "example"
});Example Response
{
"projectId": "string",
"revision": "string",
"entryPath": "string",
"declaration": {
"codeDigest": "string",
"templateId": "string",
"input": {
"schema": {
"property1": "string",
"property2": "string"
},
"schemaDigest": "string",
"contractDigest": "string"
},
"fixtures": [
"string"
]
},
"issue": {
"path": "string",
"frontmatter": {
"title": "string",
"date": "string",
"slug": "string",
"topic": "string",
"preheader": "string",
"seo": {
"title": "string",
"description": "string",
"image": "string"
},
"gate": {
"leadIn": 0
}
}
},
"diagnostics": [
{
"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"
}
}
]
}