BlockWrite

  • What a brick holds, in the vocabulary of the block-level operations: the blocks it holds, named by the names GET /blocks lists, the outputs it declares and the connections between them. It is what a block that runs a brick (nests_a_diagram) brings, and it is refused on any other block with block_not_a_brick. Without it, such a block answers brick_missing.

    The brick starts at its block placed under the id brick_start, so name the first block that. A connection inside it ending at outputs.$N leaves the brick by the output $N it declares; the connections leaving the brick block name that same $N as their type, or default. Every refusal about something inside names it by its trail, B0->n0.

    It is written whole: on an update it replaces the blocks, connections and notes the brick held, and an output it no longer declares that a connection still leaves the block by is refused with connection_output_removed, unless the same change set removes that connection. A block inside it may not run a brick of its own (brick_nesting_unsupported), and the brick reads back from GET /bots/{bot_id}/draft in the builder's shape, as a Brick.

    Properties: 4
  • The id to give the block. Generated when omitted. A client that sends connections in the same request needs to set it.

  • How far across the builder's canvas to place the block. Omitted, it is placed at the origin.

  • Required unless brick is sent. A block that runs a brick has no params of its own: it brings brick, or params: {} to run the brick the document already keeps under its id.

    Properties: 1
  • How far down the builder's canvas to place the block. Omitted, it is placed at the origin.

Examples
{
  "id": "n1",
  "type": "send_text",
  "params": {
    "messages": [
      {
        "entity": "text",
        "text": "Thanks!",
        "id": "$0"
      }
    ]
  }
}