Add blocks to the draft

​

Adds blocks, with their connections, to the diagram you already have. All of them apply or none do. top and left say where on the canvas each one goes.

Broken rules are stored and reported, as on autosave. A few problems are refused outright instead — When a call fails lists which.

This only adds. To change or remove something, use PATCH /bots/{bot_id}/draft.

Path Parameters

Body·

required
application/json
  • Properties: 6
  • Connections to add along with the blocks. They may reference blocks in this request or blocks already in the diagram.

    Properties: 5

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/bots/{bot_id}/draft/blocks
curl https://api.landbot.io/v0-alpha/bots/123e4567-e89b-12d3-a456-426614174000/draft/blocks \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token YOUR_AGENT_TOKEN' \
  --data '{
  "blocks": [
    {
      "id": "n1",
      "type": "send_text",
      "params": {
        "messages": [
          {
            "entity": "text",
            "text": "Thanks!",
            "id": "$0"
          }
        ]
      }
    }
  ],
  "connections": [
    {
      "id": "welcome.$success--n1",
      "type": "$success",
      "sourcePath": "welcome",
      "targetPath": "n1"
    }
  ]
}'
{
  "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"
  }
}