Notion

Learn how to use Notion with Composio

Overview

Enum

NOTION

Description

Notion centralizes notes, docs, wikis, and tasks in a unified workspace, letting teams build custom workflows for collaboration and knowledge management

Authentication Details

client_id
stringRequired
client_secret
stringRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
string
api_key
stringRequired

Actions

Sets a block object, including page blocks, to archived: true using the id specified. this can be used to delete a block, page, or database. note: in the notion ui application, this moves the block to the “trash” where it can still be accessed and restored. to restore the block with the api, use the update a block or update page respectively.

Action Parameters

block_id
stringRequired

Action Response

data
object
successful
boolean
error

Each row in the database is a new page in notion. so updating a row in the database is the same as updating a property of a page in notion. this action updates a specific value in a row in the notion database. for different column/property types —> value should be -title,rich text - text ex. “hello world” -number - number ex. 23.4 -select - select ex. “india” -multi select - multi select comma separated values ex. “india,usa” -date - format ex. “2021-05-11t11:00:00.000-04:00”, -people - comma separated ids of people ex. “123,456” -url - a url. -files - comma separated urls -checkbox - “true” or “false”

Action Parameters

row_id
stringRequired
icon
string
delete_row
boolean
cover
string
properties
array

Action Response

data
object
successful
boolean
error

Search a page in notion. keep the value of parameter query "" to get list of all pages and their ids. this api can be used to search for all available pages currently to get their page ids. it can also be used to find the relevant page id with a specific title or content. if you want to create a page and need all possible parent page ids, then use this api to fetch it. if the response is empty, do a search with empty query to get list of all pages that have been given access to.

Action Parameters

query
string
direction
string
timestamp
string
filter_value
stringDefaults to page
filter_property
stringDefaults to object
start_cursor
string
page_size
integerDefaults to 2

Action Response

data
object
successful
boolean
error

Archive or unarchive a page in notion.

Action Parameters

page_id
stringRequired
archive
booleanDefaults to True

Action Response

data
object
successful
boolean
error

Create a comment on a page in notion. there are two locations where a new comment can be added (via the public api). to add a new comment to a 1. page, a parent object with a page id must be provided in the body params. 2. existing discussion thread, a discussion id string must be provided in the body params. (inline comments to start a new discussion thread cannot be created via the public api.) either the parent.page id or discussion id parameter must be provided — not both.

Action Parameters

parent_page_id
string
discussion_id
string
comment
objectRequired

Action Response

data
object
successful
boolean
error

Creates a database as a subpage in the specified parent page, with the specified properties schema/columns. currently, the parent of a new database must be a notion page. you cannot update the schema of an existing database using this action. use update schema database action to update the schema or add/remove columns. only use this to create a new database. the title will be automatically converted to notion’s rich text format internally.

Action Parameters

parent_id
stringRequired
title
stringRequired
properties
arrayRequired

Action Response

data
object
successful
boolean
error

Retrieves a block object using the id specified. if the block returned contains the key has children: true, use the retrieve block children endpoint to get the list of children. to retrieve page content for a specific page, use retrieve block children and set the page id as the block id.

Action Parameters

block_id
stringRequired

Action Response

data
object
successful
boolean
error

Each row in database is a page in notion so page id & row id is a uuid of that page. id of the notion page to fetch. to fetch content of a page, “fetch block children” action can be used.

Action Parameters

page_id
stringRequired

Action Response

data
object
successful
boolean
error

Retrieves a list of un-resolved comment objects from a page or block.

Action Parameters

block_id
stringRequired
start_cursor
string
page_size
integerDefaults to 100

Action Response

data
object
successful
boolean
error

Gets 1. the user id associated with the notion integration. 2. the information about notion account like name of organisation. to get more details about user, you can use the user id to get user details

Action Parameters

Action Response

data
object
successful
boolean
error

Update a database schema in notion. using this you can change the columns/properties of a database.

Action Parameters

database_id
stringRequired
title
string
description
string
properties
array

Action Response

data
object
successful
boolean
error

Get information about the user account using the user id

Action Parameters

user_id
stringRequired

Action Response

data
object
successful
boolean
error

Returns a paginated array of child block objects contained in the block using the id specified. page content is represented by block childrens. use this function to get complete content of page. returns only the first level of children for the specified block. the response may contain fewer than page size of results. this endpoint requires an integration to have read content capabilities.

Action Parameters

block_id
stringRequired
start_cursor
string
page_size
integer

Action Response

data
object
successful
boolean
error

Retrieves a database object — information that describes the structure and columns of a database — for a provided database id. the response adheres to any limits to an integration’s capabilities. to fetch database rows rather than columns, use the query a database endpoint.

Action Parameters

database_id
stringRequired

Action Response

data
object
successful
boolean
error

List all users returns a paginated list of users for the workspace. the response may contain fewer than page size of results. guests are not included in the response.

Action Parameters

start_cursor
string
page_size
integerDefaults to 30

Action Response

data
object
successful
boolean
error

Get list of rows from a notion database filtered and sorted. each row in notion database is represented as a page. each column in the database is represented as a property. to use sorting, filtering find all the properties in the database by using the fetch database action. the response may contain fewer than page size of results and supports pagination.

Action Parameters

database_id
stringRequired
sorts
array
start_cursor
string
page_size
integerDefaults to 2

Action Response

data
object
successful
boolean
error

Each row in the database is a new page in notion. inserting a row in the database creates a page in notion, and includes extra properties as a structured list of key-value pairs for all columns in the database. this action locates the correct database id in the notion workspace and inserts a new page. for each property type, the expected format is: - title, rich text: “text” (e.g., “hello world”) (important: max 2000 characters, longer text will be truncated) - number: number (e.g., 23.4) - select: select (e.g., “india”) - multi select: array of strings (e.g., “india,usa”) - date: iso 8601 format (e.g., “2021-05-11t11:00:00.000-04:00”) - people: array of user ids (e.g., “123,456”) - url: a url - files: array of urls - checkbox: true or false

Action Parameters

database_id
stringRequired
icon
string
child_blocks
array
cover
string
properties
array

Action Response

data
object
successful
boolean
error

Create a page in notion under page with id parent id. * if a specific parent id is given, directly create the page under that parent. * if no parent id is given, search for all the pages in notion workspace and find the one which is appropriate and select it as parent page. the parent id required is a unique uuid representing the parent page id which can be found notion search notion page tool. this is a new agent format for adding content to a notion page. example of a new format is { parent id: 59833787-2cf9-4fdf-8782-e53db20768a5, title: my new report, icon: 😻, cover: https://google.com/image.png`,_}` don’t use the old format, it is not compatible with agents

Action Parameters

parent_id
stringRequired
title
stringRequired
icon
string
cover
string

Action Response

data
object
successful
boolean
error

Adds a single content block to a notion page. multiple calls needed for multiple blocks. note: only supports adding to notion pages. blocks that can contain children: - page (any block type) - toggle (any nested content) - to-do (nested to-dos/blocks) - bulleted list (nested lists/blocks) - numbered list (nested lists/blocks) - callout (child blocks) - quote (nested blocks)

Action Parameters

parent_block_id
stringRequired
after
string
content_block
objectRequired

Action Response

data
object
successful
boolean
error