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

# Update an existing task

`PATCH /tasks/{id}`

## Path parameters

- `id` string, required

## Request body

- Task — A task
  - `link` Link — URI of resource.
    - `rel` string, required
    - `href` string, url, required
  - `id` string — Task ID
  - `type` string — Task type, one of 'stream' or 'batch'
  - `dbrps` DBRP[] — List of database retention policy pairs
    - `db` string, required — Database name
    - `rp` string, required — Retention policy
  - `script` string — TICKscript content
  - `status` string — Enabled/Disabled status of the task
  - `dot` string — Graphviz DOT syntax representation of the task DAG
  - `executing` boolean — Whether the task is currently executing
  - `error` unknown
  - `created` string, dateTime — Date task was first created
  - `modified` string, dateTime — Date task was last modified
  - `last-enabled` string, dateTime — Date task was last enabled
  - `template-id` string — Template ID
  - `vars` object — Set of vars to overwrite any TICKscript vars.
  - `stats` object — Statisitcs about the task execution
    - `task-stats` object — Map of stat name to value
    - `node-stats` object — Map of node name to node stat map

## Response `200`

Update succeeded

- Task — A task
  - `link` Link — URI of resource.
    - `rel` string, required
    - `href` string, url, required
  - `id` string — Task ID
  - `type` string — Task type, one of 'stream' or 'batch'
  - `dbrps` DBRP[] — List of database retention policy pairs
    - `db` string, required — Database name
    - `rp` string, required — Retention policy
  - `script` string — TICKscript content
  - `status` string — Enabled/Disabled status of the task
  - `dot` string — Graphviz DOT syntax representation of the task DAG
  - `executing` boolean — Whether the task is currently executing
  - `error` unknown
  - `created` string, dateTime — Date task was first created
  - `modified` string, dateTime — Date task was last modified
  - `last-enabled` string, dateTime — Date task was last enabled
  - `template-id` string — Template ID
  - `vars` object — Set of vars to overwrite any TICKscript vars.
  - `stats` object — Statisitcs about the task execution
    - `task-stats` object — Map of stat name to value
    - `node-stats` object — Map of node name to node stat map

## 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)
