> ## 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.

# Get upsert schema

> Schema variant describing the fields accepted by bulk-upsert (including lookup properties). Requires a **Basic** license.



## OpenAPI

````yaml /api-reference/notion/openapi.json get /api/v1/notion/database/{database_id}/upsert-schema
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/database/{database_id}/upsert-schema:
    get:
      tags:
        - Database & schema
      summary: Get upsert schema
      description: >-
        Schema variant describing the fields accepted by bulk-upsert (including
        lookup properties). Requires a **Basic** license.
      operationId: notionGetUpsertSchema
      parameters:
        - $ref: '#/components/parameters/DatabaseId'
      responses:
        '200':
          description: Schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  parameters:
    DatabaseId:
      name: database_id
      in: path
      required: true
      schema:
        type: string
      description: Notion database ID.
  schemas:
    SchemaResponse:
      type: object
      description: >-
        Notion schema payload (property names, types, and options). Shape
        mirrors Notion's schema — consume the property map directly.
      additionalProperties: true
    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).

````