> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magicmealkits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk insert records

> Creates up to 100 pages in a Notion database/data source from simple property maps. Identify the target with `data_source_id` (multi-data-source DBs), `notion_id` (auto-detect), or `database_id`. Requires a **Basic** license.



## OpenAPI

````yaml /api-reference/notion/openapi.json post /api/v1/notion/bulk-insert
openapi: 3.1.0
info:
  title: Magic Meal Kits — Notion API
  version: 1.0.0
  description: >-
    Bulk Notion operations, database queries, markdown, publishing,
    workspace/team management, file uploads, and transcription through your
    Magic Meal Kits server. Backs the **Notion Plus (Magic Meal Kits)** Make.com
    app.


    Auth needs two things: the MMK `X-API-KEY` (your deployment) **and** your
    Notion credentials in `X-Notion-*` headers (the caller supplies these — they
    are not stored server-side). Most endpoints are **Basic**; a handful of
    advanced ones are **Pro** (a Basic key on a Pro route gets `400` `you are
    not a magic meal kits PRO user`).
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://{deployment}
    description: Your Magic Meal Kits deployment
    variables:
      deployment:
        default: magic-meal-kits-xxxxx.run.app
        description: Your Cloud Run host (without protocol)
security:
  - ApiKeyAuth: []
    NotionToken: []
tags:
  - name: Bulk operations
    description: Insert, update, upsert, delete, and check records in batches.
  - name: Database & schema
    description: Fetch database/data-source schemas and property options.
  - name: Pages & content
    description: Markdown append/replace and page creation.
  - name: Data sources (v2)
    description: >-
      Official Notion API 2025-09-03 — multi-data-source query, templates,
      pages.
  - name: Publishing
    description: Publish/unpublish pages and set block configuration.
  - name: Workspace & teams
    description: Teams, invites, and workspace membership.
  - name: Files
    description: Upload files to Notion and export pages.
  - name: Transcription
    description: Read audio-block transcriptions from a page.
  - name: AI, comments & users
    description: AI summaries, comments, and user listing (Pro).
paths:
  /api/v1/notion/bulk-insert:
    post:
      tags:
        - Bulk operations
      summary: Bulk insert records
      description: >-
        Creates up to 100 pages in a Notion database/data source from simple
        property maps. Identify the target with `data_source_id`
        (multi-data-source DBs), `notion_id` (auto-detect), or `database_id`.
        Requires a **Basic** license.
      operationId: notionBulkInsert
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkInsertRequest'
            example:
              notion_id: 26f...
              records:
                - Name: Page 1
                  Status: Active
      responses:
        '200':
          description: Per-record insert results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkWriteResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    BulkInsertRequest:
      type: object
      required:
        - records
      description: >-
        Provide one of `data_source_id` / `notion_id` / `database_id` to
        identify the target (priority: data_source_id > notion_id >
        database_id).
      properties:
        database_id:
          type: string
          description: Legacy database ID.
        data_source_id:
          type: string
          description: Data source ID (multi-data-source databases).
        notion_id:
          type: string
          description: Auto-detect — accepts either a database or data source ID.
        records:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Simple property maps, one per page (max 100).
        config:
          $ref: '#/components/schemas/BulkConfig'
        page_options:
          $ref: '#/components/schemas/PageOptions'
    BulkWriteResponse:
      type: object
      properties:
        success:
          type: boolean
        total:
          type: integer
        successful:
          type: integer
        failed:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/BulkWriteResult'
        failed_data:
          type: array
          items:
            type: object
            additionalProperties: true
        error_message:
          type: string
    BulkConfig:
      type: object
      description: Optional concurrency/retry config.
      properties:
        concurrency:
          type: integer
          description: Max in-flight requests.
        retry_enabled:
          type: boolean
        retry_delay_ms:
          type: integer
    PageOptions:
      type: object
      description: Global page-creation options applied to every created page.
      properties:
        template: {}
        icon: {}
        cover: {}
    BulkWriteResult:
      type: object
      properties:
        index:
          type: integer
        success:
          type: boolean
        page_id:
          type: string
        data:
          type: object
          additionalProperties: true
        error:
          type: string
        error_code:
          type: string
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
  responses:
    BadRequest:
      description: >-
        Invalid request, missing header (e.g. `X-Notion-Token`), or a Pro-only
        route called with a Basic key (`you are not a magic meal kits PRO
        user`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your deployment's API key (MMK_API_KEY).
    NotionToken:
      type: apiKey
      in: header
      name: X-Notion-Token
      description: >-
        Your Notion integration token / internal token. Supplied by the caller
        (not stored server-side).

````