---
title: "task.toggle: Check or uncheck a task — Note kit command — Kition"
description: "Checks or unchecks the task at `line` (from 1) or carrying `blockId`; `done` sets it, otherwise it flips. Answers whether it is checked now. Get lines from `tasks.list`."
canonical: "https://developer.kition.ai/docs/kits/note/commands/task.toggle"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/note/commands/task.toggle](https://developer.kition.ai/docs/kits/note/commands/task.toggle)

# task.toggle

**Check or uncheck a task.** Checks or unchecks the task at `line` (from 1) or carrying `blockId`; `done` sets it, otherwise it flips. Answers whether it is checked now. Get lines from `tasks.list`.

- Kit: Note 0.3.0 (Markdown (.md)); reference: [Note kit commands](https://developer.kition.ai/docs/kits/note.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `blockId` | `string` | no | The task's block id, instead of line. |
| `done` | `boolean` | no | Checked or not; flips it by default. |
| `line` | `integer` | no | The task's line, from 1. |
| `task` | `string` | no | The task's id from tasks.list ("task:2"), instead of line or blockId. |

## Call through note_run

```text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "task.toggle" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `blockId`, `done`, `line`, `task`. note_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `changed` | `boolean` | yes | Whether the note's text changed. |
| `done` | `boolean` | yes | Whether the task is checked now. |

```json
{
  "additionalProperties": false,
  "properties": {
    "changed": {
      "description": "Whether the note's text changed.",
      "type": "boolean"
    },
    "done": {
      "description": "Whether the task is checked now.",
      "type": "boolean"
    }
  },
  "required": [
    "changed",
    "done"
  ],
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "blockId": {
      "description": "The task's block id, instead of line.",
      "type": "string"
    },
    "done": {
      "description": "Checked or not; flips it by default.",
      "type": "boolean"
    },
    "line": {
      "description": "The task's line, from 1.",
      "type": "integer"
    },
    "task": {
      "description": "The task's id from tasks.list (\"task:2\"), instead of line or blockId.",
      "type": "string"
    }
  },
  "type": "object"
}
```

Generated from kition-sdk packages/script/kits/note.ts and the kit itself (kition-note@69e14d9).
