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

# Notion

> Workspace and knowledge management API for searching, creating, and updating pages, databases, and blocks in Notion.

Workspace and knowledge management API for searching, creating, and updating pages, databases, and blocks in Notion. Best for workflows that need to read or write structured content — project boards, wikis, meeting notes, and knowledge bases. Unlike Google Workspace (document-centric), Notion's API exposes a database-like structure where pages have typed properties.

7 example endpoints available through Lava's AI Gateway. See the [Notion API docs](https://developers.notion.com/reference/intro) for full documentation.

<Warning>This provider requires your own credentials — connect your API key or OAuth account before use.</Warning>

<Info>This is a **catch-all provider** — any valid URL under `https://api.notion.com/v1` is supported. Notion REST API. Construct URLs as [https://api.notion.com/v1/\&#123;path\&#125](https://api.notion.com/v1/\&#123;path\&#125);. Lava serializes your structured body\_json and injects the required Notion-Version header for you — never hand-write or escape JSON, and nested rich\_text/annotations are fine. Create a page in ONE call: POST /v1/pages with parent (\{ "page\_id": id } for a subpage, or \{ "type": "data\_source\_id", "data\_source\_id": id } for a database row), properties (the title), and an optional inline children\[] array (up to 100 blocks) — a separate append step is NOT required. For more than 100 blocks or to add content later, append with PATCH /v1/blocks/\{block\_id}/children (a page\_id works as the block\_id; 100 blocks max per call). A rich\_text item is \{ "type": "text", "text": \{ "content": "..." } }; annotations is optional (omit it for default styling) — real 400s come from text content over 2000 chars, an invalid color enum, or a wrong block shape, not from "JSON complexity." This API version (2025-09-03+) uses data sources: query a database via POST /v1/data\_sources/\{data\_source\_id}/query (the old /v1/databases/\{id}/query returns 400), and find ids with POST /v1/search using filter \{"property":"object","value":"data\_source"} or \{"property":"object","value":"page"}. See [https://developers.notion.com/reference](https://developers.notion.com/reference). The endpoints below are curated examples.</Info>

## Endpoints

### Search the pages and databases shared with the integration by title. Pass \{"query":"term"} for text search, or narrow by object type with filter \{"property":"object","value":"page"} or \{"property":"object","value":"data\_source"} ("database" is rejected on this API version). Use the data\_source filter to find a data\_source\_id for querying a database.

**POST** `https://api.notion.com/v1/search` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.notion.com/v1/search', { body: {"query":"your search term"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.notion.com%2Fv1%2Fsearch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"query":"your search term"}'
    ```
  </Tab>
</Tabs>

### Query a database's rows. On this API version (2025-09-03+) a database is queried through its data\_source\_id, not the database id — POST /v1/databases/\{id}/query returns 400. Get a data\_source\_id from POST /v1/search with filter \{"property":"object","value":"data\_source"}, or from a database object's data\_sources\[] array. Optional body: filter, sorts, page\_size, start\_cursor.

**POST** `https://api.notion.com/v1/data_sources/{data_source_id}/query` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.notion.com/v1/data_sources/{data_source_id}/query', { body: {} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.notion.com%2Fv1%2Fdata_sources%2F%7Bdata_source_id%7D%2Fquery" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{}'
    ```
  </Tab>
</Tabs>

### Retrieve a page

**GET** `https://api.notion.com/v1/pages/{page_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.notion.com/v1/pages/{page_id}', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.notion.com%2Fv1%2Fpages%2F%7Bpage_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Create a page in ONE call — pass parent, properties (the title), and an optional inline children\[] array of content blocks (up to 100); no separate append step is needed. For a subpage use parent \{ "page\_id": id } with a title property; for a database row use parent \{ "type": "data\_source\_id", "data\_source\_id": id } with properties matching that data source's schema. Add annotations to a rich\_text run for styling (optional); content over 2000 chars per text run is the common cause of a 400.

**POST** `https://api.notion.com/v1/pages` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.notion.com/v1/pages', {
      body: {
    "parent": {
      "page_id": "{parent_page_id}"
    },
    "properties": {
      "title": {
        "title": [
          {
            "text": {
              "content": "New page"
            }
          }
        ]
      }
    },
    "children": [
      {
        "object": "block",
        "type": "heading_2",
        "heading_2": {
          "rich_text": [
            {
              "type": "text",
              "text": {
                "content": "Overview"
              }
            }
          ]
        }
      },
      {
        "object": "block",
        "type": "paragraph",
        "paragraph": {
          "rich_text": [
            {
              "type": "text",
              "text": {
                "content": "A line with "
              }
            },
            {
              "type": "text",
              "text": {
                "content": "bold"
              },
              "annotations": {
                "bold": true
              }
            },
            {
              "type": "text",
              "text": {
                "content": " text."
              }
            }
          ]
        }
      },
      {
        "object": "block",
        "type": "bulleted_list_item",
        "bulleted_list_item": {
          "rich_text": [
            {
              "type": "text",
              "text": {
                "content": "First item"
              }
            }
          ]
        }
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.notion.com%2Fv1%2Fpages" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"parent":{"page_id":"{parent_page_id}"},"properties":{"title":{"title":[{"text":{"content":"New page"}}]}},"children":[{"object":"block","type":"heading_2","heading_2":{"rich_text":[{"type":"text","text":{"content":"Overview"}}]}},{"object":"block","type":"paragraph","paragraph":{"rich_text":[{"type":"text","text":{"content":"A line with "}},{"type":"text","text":{"content":"bold"},"annotations":{"bold":true}},{"type":"text","text":{"content":" text."}}]}},{"object":"block","type":"bulleted_list_item","bulleted_list_item":{"rich_text":[{"type":"text","text":{"content":"First item"}}]}}]}'
    ```
  </Tab>
</Tabs>

### Append content blocks (paragraphs, headings, lists, dividers, etc.) to a page or block — up to 100 per call. The \{block\_id} can be a page\_id, since pages are blocks. You usually do NOT need this to create a page (POST /v1/pages accepts an inline children\[] array); use it for more than 100 blocks or to add content to an existing page.

**PATCH** `https://api.notion.com/v1/blocks/{block_id}/children` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.notion.com/v1/blocks/{block_id}/children', {
      method: 'PATCH',
      body: {
    "children": [
      {
        "object": "block",
        "type": "heading_2",
        "heading_2": {
          "rich_text": [
            {
              "type": "text",
              "text": {
                "content": "Section"
              }
            }
          ]
        }
      },
      {
        "object": "block",
        "type": "paragraph",
        "paragraph": {
          "rich_text": [
            {
              "type": "text",
              "text": {
                "content": "A paragraph of content."
              }
            }
          ]
        }
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PATCH "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.notion.com%2Fv1%2Fblocks%2F%7Bblock_id%7D%2Fchildren" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"children":[{"object":"block","type":"heading_2","heading_2":{"rich_text":[{"type":"text","text":{"content":"Section"}}]}},{"object":"block","type":"paragraph","paragraph":{"rich_text":[{"type":"text","text":{"content":"A paragraph of content."}}]}}]}'
    ```
  </Tab>
</Tabs>

### Update page properties

**PATCH** `https://api.notion.com/v1/pages/{page_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.notion.com/v1/pages/{page_id}', { method: 'PATCH', body: {"properties":{"Status":{"select":{"name":"Done"}}}} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PATCH "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.notion.com%2Fv1%2Fpages%2F%7Bpage_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"properties":{"Status":{"select":{"name":"Done"}}}}'
    ```
  </Tab>
</Tabs>

### Delete a block

**DELETE** `https://api.notion.com/v1/blocks/{block_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.notion.com/v1/blocks/{block_id}', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.notion.com%2Fv1%2Fblocks%2F%7Bblock_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
