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

# Get a template

`GET /templates/{id}`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/templates/{id}`
- Auth: HTTP bearer

Returns one template including its TSX source in `document.content`.
Approved templates are visible to everyone; others only to their author
(everyone else gets 404).

## Response `200`

The template

- Template: A community-published render template
  - `id` string, uuid
  - `documentId` string, uuid: The template's own (frozen) copy of the source document
  - `sourceDocumentId` string, nullable: The document the author published it from
  - `userId` string: Author user id
  - `description` string
  - `tags` string[], nullable
  - `status` string: Moderation status. Only `approved` templates are public.
  - `useCount` integer
  - `favoriteCount` integer
  - `isFavorited` boolean: Whether the calling user has favorited it
  - `thumbnailObjectPosition` string
  - `videoObjectPosition` string
  - `isServiceTemplate` boolean
  - `previewUrl` string, nullable: Short autoplay clip; null until the preview is ready
  - `createdAt` string, date-time
  - `document` TemplateDocument: The document that holds the template's TSX source
    - `id` string, uuid
    - `title` string
    - `content` string, nullable: varg TSX source of the template
    - `metadata` object, nullable
    - `kind` string
    - `visibility` string
    - `createdBy` string
    - `projectId` string, nullable
    - `createdAt` string, date-time
  - `thumbnailUrl` string, nullable
  - `outputMediaUrl` string, nullable
  - `outputMediaType` string, nullable
  - `durationMs` integer, nullable: Output video duration in milliseconds
  - `author` TemplateAuthor
    - `id` string: Author user id
    - `displayName` string, nullable
    - `avatarUrl` string, nullable

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key / JWT
- `404`: Template or document not found

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/templates/:id/get.md)

---

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