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.

Path Parameters

Body·

required
application/json

A set of changes applied together. Describe the diagram you want, not the steps: the whole result is checked once, and the refusals are judged against it.

A block id may appear in only one of add, update and delete. Naming the same block in two of them contradicts itself and answers 400, before your draft is read.

  • Properties: 3
  • Properties: 2

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for patch/bots/{bot_id}/draft
curl https://api.landbot.io/v0-alpha/bots/123e4567-e89b-12d3-a456-426614174000/draft \
  --request PATCH \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token YOUR_AGENT_TOKEN' \
  --data '{
  "blocks": {
    "update": [
      {
        "id": "welcome",
        "params": {
          "version": 3,
          "text": "Hi there!",
          "destination": "name"
        }
      }
    ],
    "delete": [
      "n2"
    ]
  },
  "connections": {
    "delete": [
      {
        "source_path": "welcome",
        "type": "$success"
      }
    ]
  }
}'
{
  "data": {
    "bot_id": "123e4567-e89b-12d3-a456-426614174000",
    "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"
        }
      }
    },
    "save_state": "IS_PRESAVED",
    "has_unpublished_changes": true,
    "violations": [
      {
        "code": "string",
        "message": "string",
        "block_id": null,
        "param": null,
        "connections": [
          {
            "source_path": "string",
            "type": "string"
          }
        ]
      }
    ],
    "required_tier": "sandbox",
    "edited_at": "2026-09-16T09:18:19",
    "removed_connections": [
      {
        "source_path": "string",
        "type": "string"
      }
    ]
  }
}