---
title: "Publish a template version"
method: POST
path: "/templates/{template_id}/publish_version"
tags: ["Templates"]
---

# Publish a template version

`POST /templates/{template_id}/publish_version`

Publishes the current draft version of a template and creates a new immutable version
with semantic versioning (major.minor.patch).

## Path parameters

- `template_id` string, required

## Request body

- object
  - `description` string
  - `version_type` string, required

## Response `200`

version published successfully

- TemplatePublishVersionResponse
  - `status` 'success' | 'error', required
  - `result` object, required
    - `version` string, required
    - `description` string, nullable
    - `published_by_type` 'user' | 'external_user', required
    - `published_by_user_id` string
    - `published_by_name` string
    - `published_by_email` string
    - `published_by_external_id` string
    - `published_at` string, date-time, required
  - `errors` string[]

## Other responses

- `401` — authentication failed
- `404` — template not found
- `422` — invalid version type

---

[API](https://skmtc.net/docspring/apis/docspring-api.md) · [All operations](https://skmtc.net/docspring/apis/docspring-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/docspring/docspring-api/versions/88e2ef4f5847/schema)
