---
title: "block.replace: Replace a block — Note kit command — Kition"
description: "Replaces the block carrying the block id `blockId` with `markdown`, keeping its `^id` unless `markdown` sets one."
canonical: "https://developer.kition.ai/docs/kits/note/commands/block.replace"
---

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

# block.replace

**Replace a block.** Replaces the block carrying the block id `blockId` with `markdown`, keeping its `^id` unless `markdown` sets one.

- 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` | yes | The block id, without the caret (^). |
| `markdown` | `string` | yes | The block's new Markdown; its ^id is kept unless this sets one. |

## Call through note_run

```text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "block.replace", "params": { "blockId": <string>, "markdown": <string> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. 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 (false when it already read so). |

```json
{
  "additionalProperties": false,
  "properties": {
    "changed": {
      "description": "Whether the note's text changed (false when it already read so).",
      "type": "boolean"
    }
  },
  "required": [
    "changed"
  ],
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "blockId": {
      "description": "The block id, without the caret (^).",
      "type": "string"
    },
    "markdown": {
      "description": "The block's new Markdown; its ^id is kept unless this sets one.",
      "type": "string"
    }
  },
  "required": [
    "blockId",
    "markdown"
  ],
  "type": "object"
}
```

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