---
title: "Publish template (v1)"
method: POST
path: "/v1/templates/{id}/publish"
tags: ["Legacy v1"]
deprecated: true
---

# Publish template (v1)

`POST /v1/templates/{id}/publish`

## Request

- Base URL: `https://api.pdfs.build`
- URL: `https://api.pdfs.build/v1/templates/{id}/publish`
- Auth: HTTP bearer

> **Deprecated.**

## Request body

- PublishTemplateRequest
  - `name` string: Rename on publish.
  - `description` string: Update the description on publish.

## Response `200`

The published template, with the version `latest` now serves.

- PublishedTemplateV1
  - `id` string, required: Internal id.
  - `name` string, required
  - `description` string, nullable
  - `status` 'draft' | 'published', required
  - `createdAt` string, required: UTC, ISO 8601 without a timezone suffix.
  - `updatedAt` string, required: UTC, ISO 8601 without a timezone suffix.
  - `schema` object, nullable
  - `sampleData` object, nullable
  - `baseTemplateId` string, nullable
  - `userId` string, required
  - `organizationId` string, nullable
  - `publishedVersion` integer, required: The version `latest` now points at: the one this publish froze, or the newest existing one when nothing changed since it. Pin renders to it with `version`.

## Other responses

- `401`: Missing, invalid or expired API key.
- `402`: `template_limit_reached`.
- `403`: `forbidden`.
- `404`: No template with that id is accessible to this key. Another user's draft is indistinguishable from a missing template.
- `422`: Compilation failed.

---

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