Notion Helper - v1.3.29
    Preparing search index...
    • Appends a children block array to a parent block (or page). Handles nested blocks to any level via recursion.

      Parameters

      • options: any

        The options for appending blocks.

      Returns Promise<
          | { apiResponses: any; apiCallCount: number; error?: undefined }
          | { apiResponses: null; apiCallCount: number; error: any },
      >

      An object containing the API responses and the total number of API calls made.

      // Using with Notion SDK client
      const notion = new Client({ auth: NOTION_TOKEN });
      const childBlocks = createNotion().paragraph("A paragraph").build()

      const { apiResponses, apiCallCount } = await request.blocks.children.append({
      block_id: 'your-block-id',
      children: childBlocks.content,
      client: notion
      });

      // Using with custom API call function (using ky)
      import ky from 'ky';

      const NOTION_TOKEN = 'your-notion-token';

      const apiCall = async ({ type, data }) => {
      const { block_id, children, after } = data;
      const response = await ky.patch(
      `https://api.notion.com/v1/blocks/${block_id}/children`,
      {
      json: { children, ...(after && { after }) },
      headers: {
      'Authorization': `Bearer ${NOTION_TOKEN}`,
      'Notion-Version': '2025-09-03',
      },
      }
      ).json();
      return response;
      };

      const childBlocks = createNotion().paragraph("Hello, World!").build();

      const { apiResponses, apiCallCount } = await request.blocks.children.append({
      block_id: 'your-block-id',
      children: childBlocks.content,
      apiCall
      });
    Index

    Methods