---
title: "Template Update"
method: PATCH
path: "/public/v1/templates/{id}"
tags: ["Templates"]
---

# Template Update

`PATCH /public/v1/templates/{id}`

Update a template. Currently supports updating template variables (`tokens`) and managing template roles.

> 🚧 Template status
> 
> You can only update a template in the PROCESSED status (`template.PROCESSED`). 
> 
> After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status.

## Managing template roles

Pass a `roles` array to replace the full set of template roles in a single request:

  - Items with an existing `id` update that role (`name`, `signing_order`).
  - Items without an `id` create a new role.
  - Existing roles whose `id` is not in the array are deleted.

Role names must be unique within a template. Preassigned contacts and contact groups attached to roles in the template editor are preserved on updates and removed together with their role on deletion — they are not managed by this endpoint.

## Path parameters

- `id` string, required

## Request body

- TemplateUpdateRequest
  - `tokens` object[] — Create or initialize multiple CUSTOM variables with their values using tokens/values list. Template's predefined variables are read-only. Any attempts to do so will be ignored.
    - `name` string, required
    - `value` string, required
  - `roles` object[] — Replace the full set of template roles. Items with an existing `id` are updated, items without an `id` are created as new roles, and existing roles whose `id` is not present in the list are deleted.
    - `id` string — Existing role identifier. Omit to create a new role.
    - `name` string, required — Role name. Must be unique within the template.
    - `signing_order` integer, nullable — Signing order for the role. Set on every role as a contiguous sequence starting from `1` (duplicates allowed for parallel groups, e.g. `[1, 1, 2]`), or use `null` on every role for fully parallel signing.

## Response `204`

No content

## Other responses

- `400` — Bad Request
- `401` — Authentication error
- `403` — Permission error
- `404` — Not found
- `429` — Too Many Requests

---

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