ByteChef LogoByteChef

Notion

Notion is an all-in-one workspace for notes, tasks, wikis, and databases.

Categories: Productivity and Collaboration

Type: notion/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue

Connection Setup

Connect Notion to ByteChef using OAuth 2.0 (Authorization Code).

Create a Notion OAuth app

  1. Open the Notion developer dashboard: https://www.notion.so/my-integrations
  2. Click + New integration.
  3. Enter a clear name (for example, ByteChef Integration), select a workspace, and set the Integration type to Public.
  4. Fill out the remaining required fields (company name, website, email, etc.).
  5. Add the ByteChef OAuth redirect (callback) URL(s):
    • Cloud: https://app.bytechef.io/callback
    • Local development: http://127.0.0.1:5173/callback or http://localhost:5173/callback
  6. Click Save, then open Configure integration settings.
  7. Under Capabilities, enable at minimum:
    • Read content
    • Update content
    • Insert content
    • User information including email addresses
  8. Click Save changes and copy the generated Client ID and Client Secret.

Actions

Add Block to Page

Name: addBlockToPage

Adds a new content block to a page.

Properties

NameLabelTypeDescriptionRequired
idParent Page IDSTRINGtrue
childrenChildrenARRAY
Items [{STRING(type), [{STRING(type), {STRING(content)}(text), {STRING(expression)}(equation)}](caption), STRING(url), STRING(url), STRING(expression), BOOLEAN(checked), STRING(color), [{STRING(type), {STRING(content)}(text), {STRING(expression)}(equation)}](rich_text), STRING(language)}]
Child content to append to a container block as an array of block objects.true

Example JSON Structure

{
  "label" : "Add Block to Page",
  "name" : "addBlockToPage",
  "parameters" : {
    "id" : "",
    "children" : [ {
      "type" : "",
      "caption" : [ {
        "type" : "",
        "text" : {
          "content" : ""
        },
        "equation" : {
          "expression" : ""
        }
      } ],
      "url" : "",
      "expression" : "",
      "checked" : false,
      "color" : "",
      "rich_text" : [ {
        "type" : "",
        "text" : {
          "content" : ""
        },
        "equation" : {
          "expression" : ""
        }
      } ],
      "language" : ""
    } ]
  },
  "type" : "notion/v1/addBlockToPage"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Create Database Item

Name: createDatabaseItem

Creates a new item in Notion database.

Properties

NameLabelTypeDescriptionRequired
idDatabase IDSTRINGThe ID of the database.true
fieldsDYNAMIC_PROPERTIES
Depends On id
true
contentContentSTRINGThe content to append to item.false

Example JSON Structure

{
  "label" : "Create Database Item",
  "name" : "createDatabaseItem",
  "parameters" : {
    "id" : "",
    "fields" : { },
    "content" : ""
  },
  "type" : "notion/v1/createDatabaseItem"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Create Page

Name: createPage

Creates a new page that is a child of an existing page.

Properties

NameLabelTypeDescriptionRequired
idParent page IDSTRINGtrue
titleTitleSTRINGThe title of the page.false

Example JSON Structure

{
  "label" : "Create Page",
  "name" : "createPage",
  "parameters" : {
    "id" : "",
    "title" : ""
  },
  "type" : "notion/v1/createPage"
}

Output

Type: OBJECT

Properties

NameTypeDescription
objectSTRINGThe type of the object returned.
idSTRINGThe ID of the page.
created_timeSTRINGThe time the page was created.
last_edited_timeSTRINGThe time the page was last edited.
created_byOBJECT
Properties {STRING(object), STRING(id)}
The user who created the page.
last_edited_byOBJECT
Properties {STRING(object), STRING(id)}
The user who last edited the page.
parentOBJECT
Properties {STRING(type), STRING(page_id)}
The parent of the page.
archivedBOOLEAN
Options true, false
Whether the page is archived.
in_trashBOOLEAN
Options true, false
Whether the page is in the trash.
propertiesOBJECT
Properties {{STRING(id), STRING(type), [{STRING(type), {STRING(content)}(text), {BOOLEAN(bold), BOOLEAN(italic), BOOLEAN(strikethrough), BOOLEAN(underline), BOOLEAN(code), STRING(color)}(annotations), STRING(plain_text)}](title)}(title)}
The properties of the page.
urlSTRINGThe URL of the page.
request_idSTRINGThe ID of the request.

Output Example

{
  "object" : "",
  "id" : "",
  "created_time" : "",
  "last_edited_time" : "",
  "created_by" : {
    "object" : "",
    "id" : ""
  },
  "last_edited_by" : {
    "object" : "",
    "id" : ""
  },
  "parent" : {
    "type" : "",
    "page_id" : ""
  },
  "archived" : false,
  "in_trash" : false,
  "properties" : {
    "title" : {
      "id" : "",
      "type" : "",
      "title" : [ {
        "type" : "",
        "text" : {
          "content" : ""
        },
        "annotations" : {
          "bold" : false,
          "italic" : false,
          "strikethrough" : false,
          "underline" : false,
          "code" : false,
          "color" : ""
        },
        "plain_text" : ""
      } ]
    }
  },
  "url" : "",
  "request_id" : ""
}

Get Database

Name: getDatabase

Retrieve database information by database ID.

Properties

NameLabelTypeDescriptionRequired
idDatabase IDSTRINGThe ID of the database to retrieve.true

Example JSON Structure

{
  "label" : "Get Database",
  "name" : "getDatabase",
  "parameters" : {
    "id" : ""
  },
  "type" : "notion/v1/getDatabase"
}

Output

Type: OBJECT

Properties

NameTypeDescription
objectSTRINGThe type of the object returned.
idSTRINGThe ID of the database.
created_timeSTRINGThe time the page was created.
last_edited_timeSTRINGThe time the page was last edited.
urlSTRINGThe URL of the database.
titleARRAY
Items [{STRING(type), {STRING(content)}(text), {BOOLEAN(bold), BOOLEAN(italic), BOOLEAN(strikethrough), BOOLEAN(underline), BOOLEAN(code), STRING(color)}(annotations), STRING(plain_text)}]
parentOBJECT
Properties {STRING(type), STRING(page_id)}
The parent of the database.
archivedBOOLEAN
Options true, false
Whether the database is archived.
is_inlineBOOLEAN
Options true, false
public_urlSTRINGThe public URL of the database.

Output Example

{
  "object" : "",
  "id" : "",
  "created_time" : "",
  "last_edited_time" : "",
  "url" : "",
  "title" : [ {
    "type" : "",
    "text" : {
      "content" : ""
    },
    "annotations" : {
      "bold" : false,
      "italic" : false,
      "strikethrough" : false,
      "underline" : false,
      "code" : false,
      "color" : ""
    },
    "plain_text" : ""
  } ],
  "parent" : {
    "type" : "",
    "page_id" : ""
  },
  "archived" : false,
  "is_inline" : false,
  "public_url" : ""
}

Get Page

Name: getPage

Retrieve page properties using page ID. Response does not contain page content.

Properties

NameLabelTypeDescriptionRequired
idPage IDSTRINGThe ID of the page to retrieve.true

Example JSON Structure

{
  "label" : "Get Page",
  "name" : "getPage",
  "parameters" : {
    "id" : ""
  },
  "type" : "notion/v1/getPage"
}

Output

Type: OBJECT

Properties

NameTypeDescription
objectSTRINGThe type of the object returned.
idSTRINGThe ID of the page.
created_timeSTRINGThe time the page was created.
last_edited_timeSTRINGThe time the page was last edited.
created_byOBJECT
Properties {STRING(object), STRING(id)}
The user who created the page.
last_edited_byOBJECT
Properties {STRING(object), STRING(id)}
The user who last edited the page.
parentOBJECT
Properties {STRING(type), STRING(page_id)}
The parent of the page.
archivedBOOLEAN
Options true, false
Whether the page is archived.
in_trashBOOLEAN
Options true, false
Whether the page is in the trash.
propertiesOBJECT
Properties {{STRING(id), STRING(type), [{STRING(type), {STRING(content)}(text), {BOOLEAN(bold), BOOLEAN(italic), BOOLEAN(strikethrough), BOOLEAN(underline), BOOLEAN(code), STRING(color)}(annotations), STRING(plain_text)}](title)}(title)}
The properties of the page.
urlSTRINGThe URL of the page.
request_idSTRINGThe ID of the request.

Output Example

{
  "object" : "",
  "id" : "",
  "created_time" : "",
  "last_edited_time" : "",
  "created_by" : {
    "object" : "",
    "id" : ""
  },
  "last_edited_by" : {
    "object" : "",
    "id" : ""
  },
  "parent" : {
    "type" : "",
    "page_id" : ""
  },
  "archived" : false,
  "in_trash" : false,
  "properties" : {
    "title" : {
      "id" : "",
      "type" : "",
      "title" : [ {
        "type" : "",
        "text" : {
          "content" : ""
        },
        "annotations" : {
          "bold" : false,
          "italic" : false,
          "strikethrough" : false,
          "underline" : false,
          "code" : false,
          "color" : ""
        },
        "plain_text" : ""
      } ]
    }
  },
  "url" : "",
  "request_id" : ""
}

Get Page or Block Children

Name: getPageOrBlockChildren

Retrieve the actual content of a page (represented by blocks)

Properties

NameLabelTypeDescriptionRequired
idPage or Parent Block IDSTRINGtrue

Example JSON Structure

{
  "label" : "Get Page or Block Children",
  "name" : "getPageOrBlockChildren",
  "parameters" : {
    "id" : ""
  },
  "type" : "notion/v1/getPageOrBlockChildren"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

List Database Items

Name: listDatabaseItems

List all items in a Notion database.

Properties

NameLabelTypeDescriptionRequired
idDatabase IDSTRINGThe ID of the database.true
propertySort BySTRINGProperty to sort the items by.true
directionSort DirectionSTRING
Options ascending, descending
The direction to sort the items.true

Example JSON Structure

{
  "label" : "List Database Items",
  "name" : "listDatabaseItems",
  "parameters" : {
    "id" : "",
    "property" : "",
    "direction" : ""
  },
  "type" : "notion/v1/listDatabaseItems"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Update Database Item

Name: updateDatabaseItem

Update specific fields in a Notion database item.

Properties

NameLabelTypeDescriptionRequired
idDatabase IDSTRINGThe ID of the database.true
databaseItemIdDatabase Item IDSTRINGThe ID of the database item to update.true
fieldsDYNAMIC_PROPERTIES
Depends On id
true

Example JSON Structure

{
  "label" : "Update Database Item",
  "name" : "updateDatabaseItem",
  "parameters" : {
    "id" : "",
    "databaseItemId" : "",
    "fields" : { }
  },
  "type" : "notion/v1/updateDatabaseItem"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Triggers

New Database Item

Name: newDatabaseItem

Triggers when a new item is added to the database.

Type: POLLING

Properties

NameLabelTypeDescriptionRequired
idDatabase IDSTRINGThe ID of the database.true

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

JSON Example

{
  "label" : "New Database Item",
  "name" : "newDatabaseItem",
  "parameters" : {
    "id" : ""
  },
  "type" : "notion/v1/newDatabaseItem"
}

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.

How is this guide?

Last updated on

On this page