---
title: "Update an existing template"
method: PATCH
path: "/templates/{id}"
tags: ["templates"]
---

# Update an existing template

`PATCH /templates/{id}`

## Path parameters

- `id` string, required

## Request body

- Template — A template
  - `link` Link — URI of resource.
    - `rel` string, required
    - `href` string, url, required
  - `id` string — Template ID
  - `type` string — Template type, one of 'stream' or 'batch'
  - `script` string — TICKscript content
  - `vars` object — Set of variables from the TICKscript with their type and default value.
  - `dot` string — Graphviz DOT syntax representation of the template DAG
  - `error` unknown
  - `created` string, dateTime — Date template was first created
  - `modified` string, dateTime — Date template was last modified

## Response `200`

Update succeeded

- Template — A template
  - `link` Link — URI of resource.
    - `rel` string, required
    - `href` string, url, required
  - `id` string — Template ID
  - `type` string — Template type, one of 'stream' or 'batch'
  - `script` string — TICKscript content
  - `vars` object — Set of variables from the TICKscript with their type and default value.
  - `dot` string — Graphviz DOT syntax representation of the template DAG
  - `error` unknown
  - `created` string, dateTime — Date template was first created
  - `modified` string, dateTime — Date template was last modified

## Other responses

- `default` — A processing or an unexpected error.

---

[API](https://skmtc.net/influxdata/apis/kapacitor.md) · [All operations](https://skmtc.net/influxdata/apis/kapacitor/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/influxdata/kapacitor/versions/796853de0228/schema)
