# SharePoint
URL: https://docs.clearly-ai.com/docs/integrations/documents/sharepoint
Description: Connect Clearly AI to SharePoint to read documents into Projects and write generated documents back via Workflows.
## Overview [#overview]

The SharePoint integration lets Clearly AI:

* **Read** SharePoint sites, document libraries, and files into a Project as context for Reviews and Chat.
* **Search** the contents of those files when answering questions.
* **Write** generated documents back to SharePoint from a Workflow (for example, a finalized review summary or assessment report).

Authentication uses Microsoft OAuth 2.0 against Microsoft Entra ID. Credentials can be scoped to a single user or shared across the organization.

***

## Prerequisites [#prerequisites]

* Access to **Integrations** in **Organization settings**.
* A **Microsoft 365 work account** with access to the SharePoint sites you want to connect. Personal Microsoft accounts (outlook.com, hotmail.com, live.com) are **not supported** by the SharePoint APIs Clearly AI uses.
* Pop-ups allowed for the Clearly AI domain in your browser. The Microsoft consent screen opens in a new window.

### Permissions Microsoft will request [#permissions-microsoft-will-request]

When you authorize Clearly AI, Microsoft will display a consent screen requesting these scopes:

| Scope                      | Why Clearly AI needs it                                                            |
| -------------------------- | ---------------------------------------------------------------------------------- |
| `User.Read`                | Identify the connecting user.                                                      |
| `Sites.ReadWrite.All`      | List sites and document libraries; create files when a Workflow writes a document. |
| `Files.ReadWrite.All`      | Read file content for Project context; write files generated by Workflows.         |
| `openid`, `offline_access` | Sign in and keep the connection refreshed without re-prompting.                    |

Write permissions are required because of the **Write SharePoint Doc** workflow node (see [Writing documents back to SharePoint](#writing-documents-back-to-sharepoint)). If your organization does not use that capability, the integration will only ever read.

***

## Connect SharePoint [#connect-sharepoint]

<Steps>
  <Step>
    ### Open the SharePoint integration [#open-the-sharepoint-integration]

    In Clearly AI, open **Organization settings**, select **Integrations**, then click **Set up** on the SharePoint card.
  </Step>

  <Step>
    ### Authorize Clearly AI [#authorize-clearly-ai]

    Check **I understand** under the shared-credential notice, then click **Connect**. A new window opens to Microsoft's sign-in and consent screen. Sign in with your Microsoft 365 work account and approve the requested permissions.
  </Step>

  <Step>
    ### Add the credential [#add-the-credential]

    Click **Add workspace credential**. Clearly AI makes a test call to Microsoft Graph to check that the token is valid and the SharePoint permissions were granted. It enables the integration only when the test passes. If the test fails, fix the cause and try again. See [FAQs](#faqs) for specific error messages.
  </Step>
</Steps>

To connect your own SharePoint account instead, open **Customize**, go to the **Yours** tab, and click **Connect** on SharePoint. SharePoint appears there only after an admin installs its connector. When a Source or Workflow runs as you, it uses your personal connection. If you have both a personal and a shared connection, your personal one takes precedence.

***

## Use SharePoint in a Project [#use-sharepoint-in-a-project]

Once SharePoint is connected, you can attach SharePoint content to any Project as an **integration source**.

1. Open a Project and add a new integration source. Select **SharePoint**.
2. Paste either:
   * A **SharePoint site URL**, e.g. `https://contoso.sharepoint.com/sites/security`, or
   * A **shared link** to a folder, e.g. a "Copy link" URL from SharePoint or OneDrive.
3. Clearly AI will discover the files inside the site or shared folder, including files in nested folders, and present them as a checklist.
4. Use **Select All**, **Clear**, or check individual files to choose which ones to include in the Project.
5. Save the integration source. The selected files become part of the Project's context for Reviews, Chat, and Workflows.

Files are fetched on demand and converted to a text/markdown representation so the LLM can reason over them. Folder structure is walked recursively.

### Supported file types [#supported-file-types]

| Native text formats                                     | Office and document formats (converted to PDF by Microsoft Graph) |
| ------------------------------------------------------- | ----------------------------------------------------------------- |
| Plain text (`text/*`), JSON, XML, JavaScript, YAML, SQL | Word: `.doc`, `.docx`, `.dot`, `.dotx`, `.dotm`                   |
|                                                         | PowerPoint: `.ppt`, `.pptx`, `.pps`, `.ppsx`                      |
|                                                         | Excel: `.xls`, `.xlsx`, `.xlsm`                                   |
|                                                         | OpenDocument: `.odt`, `.ods`, `.odp`                              |
|                                                         | Other: `.rtf`, `.eml`, `.msg`, `.epub`, `.tif`, `.tiff`           |

SharePoint pages (`.aspx`) are also supported: their canvas content is extracted as markdown.

PDFs are read directly. Files in formats not listed above are skipped with an error reported on the file.

***

## Writing documents back to SharePoint [#writing-documents-back-to-sharepoint]

The **Write SharePoint Doc** Workflow node creates a new markdown file in SharePoint using LLM-generated content. Configure it with:

* **Parent web URL** – a SharePoint site URL under `/sites/<site-name>/...`.
* **Folder path** (optional) – relative folder path inside the site.
* **Create folder if missing** – auto-create any missing folders in the path.
* **Document title** – file name. If you omit an extension, `.md` is appended.
* **Document content instructions** – a prompt describing what the document should contain. The Workflow's accumulated context is passed to the LLM along with these instructions.

The node writes the file and emits its SharePoint URL as an artifact that downstream nodes can reference.

***

## FAQs [#faqs]

<Accordions>
  <Accordion title="Why does Connect do nothing?">
    Pop-ups are blocked. Allow pop-ups for the Clearly AI domain and try again.
  </Accordion>

  <Accordion title="What should I do if Microsoft authentication failed with HTTP 401?">
    The token is missing or has been revoked. Connect SharePoint again to reauthorize.
  </Accordion>

  <Accordion title="Why is my Microsoft account type not supported?">
    You signed in with a personal Microsoft account. Reconnect using a work account.
  </Accordion>

  <Accordion title="Why did the Microsoft Graph connection time out?">
    This is usually a transient network issue between Clearly AI and Microsoft Graph. Retry. If it persists, check Microsoft 365 service health.
  </Accordion>

  <Accordion title="Why are no files found when adding a SharePoint source to a project?">
    The signed-in account does not have access to the site or folder, or the URL is not a recognized SharePoint site or shared-folder link. Verify the URL and the account's access in SharePoint.
  </Accordion>
</Accordions>

***

## Related [#related]

* [Concepts](https://docs.clearly-ai.com/docs/concepts) – How Integrations fit into Projects, Reviews, and Workflows.