> For the complete documentation index, see [llms.txt](https://docs.erathos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.erathos.com/connectors/apis/notion.md).

# Notion

## Using the Erathos platform

When selecting Notion as a new connector on the Erathos platform, you will need to name your connection and fill in the following form:

* **Token** — your Notion internal integration token, used to authenticate all requests to the Notion API

With this connection created you can seamlessly move your Notion data to your BigQuery, Redshift or Postgres data warehouse.

### How to find my token?

To generate a Notion integration token, go to <https://www.notion.so/my-integrations> and click **New integration**. Give it a name, select the workspace you want to connect, and click **Submit**.

After creating the integration, copy the **Internal Integration Token** shown on the integration settings page. Then go to each Notion page or database you want to sync and add the integration under **Share → Invite**, granting it the appropriate access level.

Paste the token into the **Token** field on the Erathos platform and click **Save and close** to complete the setup.

## Endpoints and fields

### users

Sync type availability: Full-refresh

| Field       | Type |
| ----------- | ---- |
| id          | text |
| name        | text |
| type        | text |
| avatar\_url | text |

### pages

Sync type availability: Full and incremental refresh

[Cursor](https://docs.erathos.com/platform/connections/sync-types#understanding-cursors): `last_edited_time`

Parent of [blocks](#blocks), [comments](#comments)

| Field              | Type      | Cursor |
| ------------------ | --------- | ------ |
| id                 | text      |        |
| created\_time      | timestamp |        |
| last\_edited\_time | timestamp | ✓      |
| archived           | boolean   |        |
| url                | text      |        |
| parent.type        | text      |        |

### blocks

Sync type availability: Full-refresh

Child of [pages](#pages)

| Field              | Type      |
| ------------------ | --------- |
| id                 | text      |
| type               | text      |
| created\_time      | timestamp |
| last\_edited\_time | timestamp |
| has\_children      | boolean   |
| archived           | boolean   |

### comments

Sync type availability: Full-refresh

Child of [pages](#pages)

| Field              | Type      |
| ------------------ | --------- |
| id                 | text      |
| discussion\_id     | text      |
| created\_time      | timestamp |
| last\_edited\_time | timestamp |
| created\_by.id     | text      |
| parent.type        | text      |

## Entity Relationships

```mermaid
erDiagram
    pages ||--o{ blocks : "id = page_id"
    pages ||--o{ comments : "id = page_id"
    users ||--o{ comments : "id = created_by.id"

    users { text id PK }
    pages { text id PK }
    blocks { text id PK }
    comments { text id PK }
```
