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

# Integrate with Notion

> Connect your workflow and Notion to create new pages or add paragraphs.

Have a workflow trigger creating a new page in Notion.

<Info>
  You need to be a workspace admin to complete this task.
</Info>

## Configure Notion

1. Create a new integration in Notion [here](https://www.notion.so/my-integrations).

2. On the Notion integration page, create a new internal app called "Next Matter”. 

3. Click the app and copy the Integration secret. You'll need to provide it in the Next Matter workflow.

4. In Notion, click the parent page under which you'll be creating new pages. To do this, in the top right-hand corner click **... > + Add connections**.

5. Select the Next Matter app.

6. Allow Notion access to Next Matter.

7. On your parent page, in the top-right corner click **Share**.

8. Click **Copy link**.

9. Paste the link somewhere and extract the Notion page ID from the link. You can find the page ID at the end of a Notion page's URL (before any query strings starting with ?). For example, the page ID here [https://www.notion.so/nextmatter/Content-fa12225389b641339a46df8073992b62?pvs=4](https://www.notion.so/nextmatter/Content-fa12225389b641339a46df8073992b62?pvs=4) would be **fa12225389b641339a46df8073992b62**.

## Configure Next Matter to add a new page

1. In your Next Matter portal, click **Workflows**, and then click the workflow you want to create pages in Notion.

2. Click **Edit workflow**.

3. Click **+Add step** and select **Integration > Custom integration**.

4. Click **Settings** to configure the step.

5. Enter the following details:

   * **Method**: POST

   * **URL**: [`https://api.notion.com/v1/pages`](https://api.notion.com/v1/pages)

   * **Headers**: Content-Type: application/json

   * **Headers**: Authorization: Notion's integration secret

   * In the **Body** enter the values. For example, the body might look like the following:

     <CodeGroup>
       ```json theme={null}
       {
       	"parent": {"page_id": "YOUR_PARENT_PAGE_ID"}, //Replace Parent page ID
           "properties": {
       		"title": {
       			"title": [
       				{
       					"text": {
       						"content": "TITLE_OF_NEW_PAGE" //Replace with title
       					}
       				}
       			]
       		}
           }}
       ```
     </CodeGroup>

6. Save your changes.

## Configure Next Matter to add a new paragraph

1. In your Next Matter portal, click **Workflows**, and then click the workflow you want to create pages in Notion.

2. Click **Edit workflow**.

3. Click **+Add step** and select **Integration > Custom integration**.

4. Click **Settings** to configure the step.

5. Enter the following details:

   * **Method**: PATCH

   * **URL**: [`https://api.notion.com/v1/blocks/PAGE_ID/children`](https://api.notion.com/v1/blocks/PAGE_ID/children)

   * **Headers**: Content-Type: application/json

   * **Headers**: Authorization: Notion's integration secret

   * In the **Body** enter the values. For example, the body might look like the following:

     <CodeGroup>
       ```json theme={null}
       {
         "children": [
           {
             "object": "block",
             "type": "paragraph",
             "paragraph": {
               "rich_text": [
                 {
                   "type": "text",
                   "text": {
                     "content": "PARAGRAPH_TEXT_HERE" //replace the placeholder
                   }
                 }
               ]
             }
           }
         ]
       }
       ```
     </CodeGroup>

6. Save your changes.
