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

# Notion

<div className="page-title-row">
  <img src="https://mintcdn.com/klef/xJ0kXbcegZOD2G3h/images/connectors/notion.svg?fit=max&auto=format&n=xJ0kXbcegZOD2G3h&q=85&s=200879470e3cffa9ce023de6970f41a3" alt="" noZoom width="24" height="24" data-path="images/connectors/notion.svg" />

  <h1>Notion</h1>
</div>

## Connection

### Setup

[Turn on SCIM provisioning](https://www.notion.so/help/provision-users-and-groups-with-scim) in your
organization settings and copy the token Notion issues.

### Settings

| Setting    | Required | Description                                                                                                                                                                           |
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SCIM token | Yes      | SCIM token from Manage organization, General, SCIM provisioning. Notion issues one token per workspace, so connect each workspace separately. Enterprise plan only. Stored encrypted. |

### Permissions

Minimum permissions the connection requires.

| Capability        | Required | Granted by (any one) |
| ----------------- | -------- | -------------------- |
| Provision members | Yes      | `SCIM token`         |
| Read groups       | Yes      | `SCIM token`         |

## notion.user

### Fields

| Field      | Type   | Required | Description                                                                                                                                                                   |
| ---------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `userName` | string | Yes      | Email address the member signs in to Notion with.                                                                                                                             |
| `name`     | string |          | Full name shown in the workspace. Notion accepts a profile change only once you have verified ownership of the address's domain.                                              |
| `role`     | enum   |          | Role the member holds in the workspace. Values: `owner` (Workspace owner), `membership_admin` (Membership admin), `member` (Member), `restricted_member` (Restricted member). |
| `active`   | bool   |          | Whether the member is in the workspace. An inactive member is removed from it and logged out, not suspended, so switching them back on invites them again.                    |
| `groups`   | grant  |          | Groups the member belongs to, which is what shares teamspaces and pages with them. One row grants one group.                                                                  |
| `groups[]` | string |          | Group ID.                                                                                                                                                                     |

### Default Account Matching Rules

When Klef [adopts](/docs/adoption) an account that already exists in Notion, it works out whose it is by trying these in order. A connection can override them.

| Account field | Worker field            |
| ------------- | ----------------------- |
| `userName`    | `worker.business_email` |

## Examples

### Notion members

A Notion seat for every engineer, in the groups that share their teamspaces, removed from the workspace when they leave.

```hcl theme={null}
stage active {
  target notion.user {
    userName = worker.business_email
    name     = worker.display_name
    role     = "member"
    active   = true
    groups   = ["Engineering"]
  }
}
```
