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

# Setup

> Connect to your Notion app for OAuth.

To setup your Notion app in Refold for OAuth, you will need the following credentials from your [Notion Integrations Page](https://www.notion.so/my-integrations):

* Client ID
* Client Secret
* Scopes

### Pre-requisites

1. Notion account. You can create one [here](https://www.notion.so/signup).

### Required Settings

* **Mandatory Scopes**

1. Read user information including email address
2. Insert comments

<Info>If you haven't already created an app in Notion, you'd need to create one.</Info>

### Creating an app in Notion

To create a Notion app and acquire the above mentioned credentials, please follow the steps mentioned below:

1. Log in to your [Notion Integrations Page](https://www.notion.so/my-integrations).
2. Click on `+ New integration` button in the left.

<img height="200" src="https://mintcdn.com/cobalt-55/wOGvLSncBaYd4o6C/images/Notion/notion_navigation.png?fit=max&auto=format&n=wOGvLSncBaYd4o6C&q=85&s=0254791c51f11f57500765329f3e76e9" alt="Navigating for App setup" data-path="images/Notion/notion_navigation.png" />

3. Select a **workspace**, give the app a **Name** and click on the `Submit` button.
4. Navigate to `Capabilities` in the left menu, select the **mandatory scopes** and click on `Save changes`.

<Info>
  **Scopes** or **Permissions** for Notion app can be configured only through the `Capabilities` section of the app in Notion Integrations Page.
</Info>

<img height="200" src="https://mintcdn.com/cobalt-55/wOGvLSncBaYd4o6C/images/Notion/notion_config.png?fit=max&auto=format&n=wOGvLSncBaYd4o6C&q=85&s=b6ba6aa8619a1ffc9a35229795c823f0" alt="Setting up Notion Integration app" data-path="images/Notion/notion_config.png" />

5. Go to your [`Apps catalog`](https://app.gocobalt.io/apps) in **Refold** > Search for `Notion` > `Settings` > `Use your credentials` > `Callback Url` > Copy it.

<Note>
  To get the Client ID and Client Secret in Notion, the app needs to made public.
</Note>

6. Navigate to `Distribution` and **Enable** to make the integration public. Fill the required information about organization and paste the Callback Url under `Redirect URIs` in **OAuth Domains and URIs** section. Click on `Submit`.
7. Navigate to `Secrets` and copy the **OAuth client ID** and **OAuth client secret**.

<img height="200" src="https://mintcdn.com/cobalt-55/wOGvLSncBaYd4o6C/images/Notion/notion_credentials.png?fit=max&auto=format&n=wOGvLSncBaYd4o6C&q=85&s=cc4a076f53ada217f33ea6d9437a079b" alt="Getting Credentials" data-path="images/Notion/notion_credentials.png" />

#### Configuring credentials in Refold

App settings page lets you configure the authentication settings for an `OAuth 2.0` based application. For your customers to provide you authorization to access their data,
they would first need to install your application. This page lets you set up your application credentials.

<img height="200" src="https://mintcdn.com/cobalt-55/wOGvLSncBaYd4o6C/images/Notion/notion_cobalt.png?fit=max&auto=format&n=wOGvLSncBaYd4o6C&q=85&s=bfbe181884a69cf39b3446e8ef6f4b9e" alt="Setting up application client credentials" data-path="images/Notion/notion_cobalt.png" />

Provide the acquired Client ID and Client Secret under Settings of the app and save it.

#### Actions and triggers

Once the above setup is completed, you can create orchestrations of your use-cases using Notion actions and triggers. Following are the set of Notion actions and triggers
supported by Refold.

<Tabs>
  <Tab title="Actions">
    <AccordionGroup>
      <Accordion title="Database">
        1. **Create Database** - Create a database in Notion.
        2. **Update Database** - Update a database in Notion.
        3. **Retrieve Database** - Retrieve a database in Notion.
      </Accordion>

      <Accordion title="Page">
        4. **Create Page** - Create a page in Notion.
        5. **Search** - Find Page (by title) in Notion.
      </Accordion>

      <Accordion title="Others">
        6. **HTTP Request** - Make HTTP API calls to any Notion documented REST APIs.
        7. **Create Comment** - Create a comment in Notion.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Triggers">
    There are no triggers in this application.
  </Tab>
</Tabs>
