Lodol Docs

Notion

API actions for the Notion integration.

Notion

Connect to Notion to search content, look up items in databases, and create or update pages.


Add content to a page

Add content blocks to an existing Notion page or block.

Parameters

ParameterTypeRequiredDescription
block_idstringYesThe ID of the page or block to add content to. To add to a page, use the page ID from 'Create page in database' or 'Retrieve page details'.
childrenarrayYesContent blocks to add, in Notion's block format. Each block needs a 'type' field and a matching object of that type containing a 'rich_text' list.

Response

{
  "appended": 3,
  "has_more": false,
  "next_cursor": null,
  "status": "success"
}

Create page in database

Create a new page in a Notion database, with optional content blocks.

Parameters

ParameterTypeRequiredDescription
parent_database_idstringYesThe ID of the database to create the page in. Use the 'List databases' action first to find available database IDs.
titlestringYesPage title.
propertiesobjectNoAdditional page properties.
childrenarrayNoContent blocks to add to the page, in Notion's block format. Each block needs a 'type' field and a matching object of that type containing a 'rich_text' list.
title_propertystringNoThe name of the database's title property, if it is not 'Name'.

Response

{
  "id": "n7m8l9k0j1i2",
  "status": "success",
  "title": "New Page",
  "url": "https://www.notion.so/New-Page-n7m8l9k0j1i2"
}

List databases

List the Notion databases you can access, with an optional search to narrow the results.

Parameters

ParameterTypeRequiredDescription
querystringNoWhat to search for.
page_sizenumberNoNumber of results to return.
start_cursorstringNoLeave blank for the first set of results. To get more, use the next cursor value from the previous run.

Response

{
  "count": 1,
  "databases": [
    {
      "id": "x9y8z7w6v5u4",
      "name": "Tasks Database",
      "url": "https://www.notion.so/Tasks-Database-x9y8z7w6v5u4"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "status": "success"
}

Find pages in a database

Find pages in a Notion database, with optional filters and sorting.

Parameters

ParameterTypeRequiredDescription
database_idstringYesDatabase ID.
filterobjectNoConditions the pages must match, in Notion's filter format.
sortsarrayNoHow to order the results, in Notion's sort format.
page_sizenumberNoNumber of results to return.
start_cursorstringNoLeave blank for the first set of results. To get more, use the next cursor value from the previous run.

Response

{
  "count": 1,
  "has_more": false,
  "next_cursor": null,
  "results": [
    {
      "id": "p1q2r3s4t5u6",
      "last_edited_time": "2024-01-15T14:20:00.000Z",
      "properties": {
        "Name": "Task 1",
        "Status": "In Progress"
      },
      "title": "Task 1",
      "url": "https://www.notion.so/Task-1-p1q2r3s4t5u6"
    }
  ],
  "status": "success"
}

Retrieve page details

Look up a Notion page and get its title, link, and key details.

Parameters

ParameterTypeRequiredDescription
page_idstringYesNotion page ID.

Response

{
  "archived": false,
  "id": "a1b2c3d4e5f6",
  "last_edited_time": "2024-01-15T10:30:00.000Z",
  "properties": {
    "Name": "Meeting Notes",
    "Status": "Complete"
  },
  "status": "success",
  "title": "Meeting Notes",
  "url": "https://www.notion.so/Meeting-Notes-a1b2c3d4e5f6"
}

Search pages

Search for Notion pages that match the text you enter.

Parameters

ParameterTypeRequiredDescription
querystringYesWhat to search for.
page_sizenumberNoNumber of results to return.
start_cursorstringNoLeave blank for the first set of results. To get more, use the next cursor value from the previous run.

Response

{
  "count": 1,
  "has_more": false,
  "next_cursor": null,
  "pages": [
    {
      "id": "a1b2c3d4e5f6",
      "last_edited_time": "2024-01-15T10:30:00.000Z",
      "title": "Project Planning",
      "url": "https://www.notion.so/Project-Planning-a1b2c3d4e5f6"
    }
  ],
  "status": "success"
}

Update page properties

Update properties on an existing Notion page.

Parameters

ParameterTypeRequiredDescription
page_idstringYesNotion page ID.
propertiesobjectYesThe properties to change and their new values, in Notion's property format.

Response

{
  "id": "a1b2c3d4e5f6",
  "last_edited_time": "2024-01-15T10:30:00.000Z",
  "status": "success",
  "title": "Updated Page",
  "url": "https://www.notion.so/Updated-Page-a1b2c3d4e5f6"
}

On this page