Craft icon

Craft

Interact with your Craft documents via the API

Block → Delete Blocks

AI-generated

Summary

Delete one or more blocks in Craft by specifying their block IDs either as a JSON array or via a structured form input.

Inputs

  • Input Mode (required) — Select whether to input block IDs in JSON format or using a form interface.
  • Block IDs (JSON) (required) — Provide an array of block IDs to delete when using JSON input mode (e.g., ["id1", "id2"]).
  • Block IDs (Form) (required) — Enter one or more block IDs to delete, each as a separate entry when using form input mode.

Output shape

a list of JSON objects representing deletion results for each input item

The output includes one entry per input, containing the result of each deletion operation or error details if the deletion failed. If multiple block IDs are provided in an item, they are processed in that context.

Examples

Example 1: Delete multiple blocks by ID using JSON input mode

Set Input Mode to JSON and provide an array of block IDs to delete.

Example 2: Delete multiple blocks by entering IDs in form input mode

Set Input Mode to Form and enter each block ID as a separate value under Block IDs.

Discussion