Publish an exact template commit

Publish an exact template commit. View request and response details for this Samva email API endpoint.

POST
/v1/templates/{id}/publications

Builds an exact Git commit and entry path, stores the immutable executable and its assets, records the input contract it validates against, and makes that publication current.

x-api-key<token>

In: header

Path Parameters

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

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

projectId*TemplateProjectId
Match^tproj_[0-9a-hjkmnp-tv-z]{16,24}$
commitSha*string
Match^[a-f0-9]{40}$
entryPath*string
Match^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?!.*(?:^|\/)\.git(?:\/|$))emails\/.+\.tsx$
Lengthlength <= 1024
expectedWorkspaceRevision*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/templates/string/publications" \  -H "Content-Type: application/json" \  -d '{    "projectId": "string",    "commitSha": "string",    "entryPath": "string",    "expectedWorkspaceRevision": "string"  }'
{  "id": "string",  "organizationId": "string",  "projectId": "string",  "templateId": "string",  "inputContractId": "string",  "commitSha": "string",  "treeSha": "string",  "entryPath": "string",  "buildIdentity": "string",  "manifest": {    "templateKey": "string",    "executable": {      "codeDigest": "string",      "bytes": 0    },    "input": {      "schemaDigest": "string",      "contractDigest": "string"    },    "environment": {      "locale": "string",      "timeZone": "UTC",      "now": 0,      "randomSeed": 0,      "compiler": "string",      "runtime": "string",      "checker": "string",      "lockKind": "bun",      "lockDigest": "string",      "digest": "string"    },    "assets": {      "base": "string",      "entries": [        {          "path": "string",          "fileName": "string",          "digest": "string",          "bytes": 0,          "contentType": "string",          "url": "string"        }      ]    },    "source": {      "commitSha": "string",      "treeSha": "string",      "entryPath": "string",      "treeDigest": "string"    }  },  "executable": {    "key": "string",    "digest": "string"  },  "assets": [    {      "path": "string",      "fileName": "string",      "digest": "string",      "bytes": 0,      "contentType": "string",      "url": "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"      }    }  ],  "status": "string",  "publishedAt": "string",  "publishedBy": "string",  "createdAt": "string"}