Draft

Apply a set of changes to the draft

Adds, updates and deletes blocks and connections in one go. All of it applies or none of it does.

Use this whenever a change spans more than one block — the single-block endpoints carry no connections, so they cannot rewire.

Describe the result you want, not the steps. Every problem in the set is collected and answered together. removed_connections lists the wiring that went.

patch/bots/{bot_id}/draft

Request

  • Base URL: https://api.landbot.io/v0-alpha
  • URL: https://api.landbot.io/v0-alpha/bots/{bot_id}/draft
  • Auth: one of:
    • API key in header Authorization
    • API key in cookie sessionid
    • HTTP bearer

Request body

Example request

{
  "blocks": {
    "update": [
      {
        "id": "welcome",
        "params": {
          "version": 3,
          "text": "Hi there!",
          "destination": "name"
        }
      }
    ],
    "delete": [
      "n2"
    ]
  },
  "connections": {
    "delete": [
      {
        "source_path": "welcome",
        "type": "$success"
      }
    ]
  }
}

Response

The draft after the change set

Example response

{
  "data": {
    "diagram": {
      "nodes": {
        "hidden": {
          "id": "hidden",
          "path": "hidden",
          "template": "hidden",
          "params": {}
        },
        "welcome": {
          "id": "welcome",
          "path": "welcome",
          "template": "var_text",
          "params": {
            "version": 3,
            "text": "Hi! What is your name?",
            "destination": "name"
          }
        }
      },
      "connections": {
        "hidden.success--welcome": {
          "id": "hidden.success--welcome",
          "type": "success",
          "sourcePath": "hidden",
          "targetPath": "welcome"
        }
      }
    },
    "edited_at": "2026-09-16T09:18:19"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.