---
title: "Get a template"
method: GET
path: "/v1/templates/{id}"
tags: ["Templates"]
---

# Get a template

`GET /v1/templates/{id}`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/templates/{id}`
- Auth: API key in header `x-api-key`

Returns the template with its project entry path, delivery defaults, compiled channel content, current publication, and the input schema that publication validates against. Open live project files through the workspace API.

## Path parameters

- `id` string, required

## Response `200`

Template

- Template
  - `id` string, required
  - `slug` string, required
  - `name` string, required
  - `channel` 'email', required
  - `projectId` string, required
  - `namespaceId` string, required
  - `shared` boolean, required: Whether the template's project is shared with every namespace. Every entry in a project shares it. A namespace-scoped key reads and sends a shared template in its own namespace but cannot change it. Only an organization-level project is shared.
  - `entryPath` string, required
  - `status` 'draft' | 'pending' | 'approved' | 'published' | 'rejected' | 'archived', required
  - `isActive` boolean, required
  - `publishedAt` string, nullable, required
  - `brand` TemplatePublicationBrand, required
    - `slug` string, required: The brand the publication imports.
    - `digest` string, required: The brand's digest when the publication was built.
    - `stale` boolean, required: Whether the brand has changed since this publication was built. Publishing the same commit again picks up the change.
  - `fromDefault` TemplateFromDefault, required
    - `email` string, required
    - `name` string, nullable
  - `usageCount` integer, required
  - `lastUsedAt` string, nullable, required
  - `createdAt` string, required
  - `updatedAt` string, required
  - `familyId` string, required
  - `description` string, nullable, required
  - `category` 'transactional' | 'marketing' | 'support' | 'notification' | 'verification' | 'reminder' | 'alert', nullable, required
  - `replyToDefault` string[], nullable, required
  - `trackingDefault` object, nullable, required
    - `opens` boolean, nullable
    - `clicks` boolean, nullable
  - `email` object, nullable, required
    - `subject` string, required
    - `preheader` string, nullable, required
    - `headers` object, nullable, required
  - `publicationId` string, required
  - `inputContractId` string, required
  - `inputSchema` object, nullable, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

[API](https://skmtc.dev/samva/apis/samva-api.md) · [All operations](https://skmtc.dev/samva/apis/samva-api/llms.txt) · [OpenAPI document](https://skmtc.dev/samva/apis/samva-api/revisions/a99408542cc3?raw)
