Skip to Content

Get a template publication

Returns one immutable publication and its exact build receipt. Request: GET /v1/templates/{id}/publications/{publicationId}. Scope: templates:read.

GET
/v1/templates/{id}/publications/{publicationId}

Returns one immutable publication and its exact build receipt.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

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

Response Body

Success

application/json
  1. response
id*TemplatePublicationId
Match^tpub_[0-9a-hjkmnp-tv-z]{16,24}$
organizationId*OrganizationId
Match^org_[0-9a-hjkmnp-tv-z]{16,24}$
projectId*TemplateProjectId
Match^tproj_[0-9a-hjkmnp-tv-z]{16,24}$
templateId*TemplateId
Match^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$
inputContractId*TemplateInputContractId
Match^tcon_[0-9a-hjkmnp-tv-z]{16,24}$
commitSha*string
Match^[a-f0-9]{40}$
treeSha*string
Match^[a-f0-9]{40}$
entryPath*string

A relative .tsx file under templates or emails/, at most 1024 characters, with no backslash, . or .., or .git segments.

Lengthlength <= 1024
buildIdentity*string
Match^[a-f0-9]{64}$
manifest*
compiled*
assets*array<>
warnings*array<>
incompatibilities*array<>
status*string
publishedAt*string
publishedBy*string|null
createdAt*string
Example Request
import { createClient } from "samva";

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

const result = await samva.templates.getPublication({
  "id": "example",
  "publicationId": "example"
});
Example Response
{
  "id": "string",
  "organizationId": "string",
  "projectId": "string",
  "templateId": "string",
  "inputContractId": "string",
  "commitSha": "string",
  "treeSha": "string",
  "entryPath": "string",
  "buildIdentity": "string",
  "manifest": {
    "templateKey": "string",
    "compiled": {
      "version": 1,
      "digest": "string",
      "bytes": 0
    },
    "compiler": "string",
    "input": {
      "schemaDigest": "string",
      "contractDigest": "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"
    },
    "brand": {
      "id": "string",
      "binding": "default",
      "slug": "string",
      "css": "string",
      "assets": {
        "logoUrl": "string",
        "logoDarkUrl": "string",
        "iconUrl": "string"
      },
      "footer": {
        "companyName": "string",
        "websiteUrl": "string",
        "address": {
          "street1": "string",
          "street2": "string",
          "city": "string",
          "region": "string",
          "postalCode": "string",
          "country": "string"
        },
        "socialLinks": [
          {
            "label": "string",
            "url": "string"
          }
        ]
      },
      "renderedFooter": {
        "html": "string",
        "text": "string",
        "headCss": "string"
      },
      "digest": "string",
      "rendersFooter": "every"
    }
  },
  "compiled": {
    "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"
}

Related documentation