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

# SharePoint

> Sync documents from SharePoint sites into a Circuit index.

The SharePoint feed connects an index to one or more SharePoint Online sites through Microsoft Graph. After connecting, Circuit imports the pages and files in the sites you authorize and keeps them in sync as they change.

## What you can do

* **Sync entire sites**: Bring pages, documents, and attachments from the SharePoint sites you authorize into the index.
* **Cover team and communication sites**: Both modern site types are supported, including sites backed by a Microsoft 365 group.
* **Stay in sync automatically**: Circuit re-checks each authorized site periodically. Updates, new pages, and deletions are mirrored to the index.

## Before you start

* A Microsoft work or school account with access to the SharePoint sites you want to sync.
* The cooperation of a Microsoft Entra administrator. SharePoint is workspace-scoped, so an admin typically authorizes Circuit for the tenant before users can connect. See [For IT and security teams](#for-it-and-security-teams) below.
* The URLs of the SharePoint sites you want to include, for example `https://contoso.sharepoint.com/sites/engineering`.
* An index in Circuit where the SharePoint content should live. See [Indexes](/admin/indexes) if you need to create one.

## Connect SharePoint

<Steps>
  <Step title="Open the index's Integrations tab">
    In Circuit, open the index that should receive the SharePoint content, then choose **Integrations** > **New integration**.
  </Step>

  <Step title="Choose Import from SharePoint">
    Select **Import from SharePoint**. Circuit redirects you to Microsoft's sign-in page.
  </Step>

  <Step title="Sign in to Microsoft">
    Sign in with the Microsoft account that has access to the sites you want to sync.
  </Step>

  <Step title="Review and consent to the requested permissions">
    Microsoft shows a consent screen listing the Graph permissions Circuit requests. Review them (see [What Circuit accesses](#what-circuit-accesses) below) and click **Accept**. If your tenant requires admin approval, the consent screen is blocked until an Entra administrator grants tenant-wide consent.
  </Step>

  <Step title="Choose the sites to sync">
    After consent, Circuit asks which sites should feed into the index. Paste the URL of each site you want to include, or pick from the list of sites your account can see. Content outside the selected sites is never accessed.
  </Step>

  <Step title="Start the import">
    Click **Done**. Circuit imports the selected sites. The initial import takes a few minutes to a few hours depending on volume. Subsequent updates run in the background.
  </Step>
</Steps>

## What Circuit accesses

Circuit requests the following Microsoft Graph delegated permissions:

```
Sites.Read.All
Files.Read.All
offline_access
```

| Permission       | Why Circuit needs it                                                                                                                                                                                       |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Sites.Read.All` | Read pages, lists, and site metadata from the SharePoint sites you authorize. This permission requires admin consent in every tenant.                                                                      |
| `Files.Read.All` | Read documents and attachments stored in the document libraries on those sites.                                                                                                                            |
| `offline_access` | Issue a refresh token so Circuit can keep the feed in sync without asking you to reauthenticate. Microsoft access tokens last about an hour, so without this scope you would need to reconnect frequently. |

<Note>
  Although `Sites.Read.All` technically allows reading any site in the tenant, Circuit only imports the sites you authorize at connect time. To narrow access at the Microsoft layer instead, see the note on `Sites.Selected` in [For IT and security teams](#for-it-and-security-teams).
</Note>

## For IT and security teams

The SharePoint feed authenticates through the same Circuit-published enterprise application in your Microsoft Entra tenant that [OneDrive](/admin/integrations/feeds/onedrive), Outlook, and Dynamics 365 use. Granting consent once covers all of these integrations.

Two things differ from OneDrive:

* **Workspace scope**: SharePoint sites belong to the tenant, not to an individual user. The first user to connect typically cannot complete the flow without admin consent.
* **Site selection**: After Entra consent is granted, the connecting user still chooses which specific sites Circuit reads. Sites outside that selection are not imported.

To grant tenant-wide consent:

1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com) as a Cloud Application Administrator or higher.
2. Go to **Entra ID** > **Enterprise apps** > **All applications** and search for **Circuit**.
3. Open **Permissions** under **Security** and review the requested scopes.
4. Click **Grant admin consent for `your tenant`**.

If your security policy disallows tenant-wide `Sites.Read.All`, contact Circuit support to discuss using `Sites.Selected` instead, which lets admins authorize specific site collections at the Microsoft layer rather than relying on Circuit's in-app site picker.

For the full Entra walkthrough, the cross-integration app model, and how to restrict the app to specific users or groups, see [Integration security and admin consent](/it/integration-security).

## Disconnect or rotate access

* **From Circuit**: open the index's **Integrations** tab, select the SharePoint feed, and click **Remove**. Circuit deletes the stored refresh token and stops syncing. Already-imported documents stay in the index until you delete them.
* **From Microsoft**: at [myapps.microsoft.com](https://myapps.microsoft.com) > **Manage your applications**, find Circuit and remove its permissions. Circuit will lose access on the next sync attempt.
* **Tenant-wide revocation**: an Entra admin can remove the Circuit enterprise application, which invalidates all of the tenant's tokens immediately.

## Troubleshooting

<AccordionGroup>
  <Accordion title="&#x22;Need admin approval&#x22; or &#x22;this app needs permission to access resources in your organization&#x22;">
    Your Entra tenant requires admin consent for third-party apps. Ask your Entra administrator to grant tenant-wide consent (see [For IT and security teams](#for-it-and-security-teams)). The same consent covers OneDrive, Outlook, and Dynamics 365.
  </Accordion>

  <Accordion title="A specific site does not appear in the picker">
    Sites only show up if your Microsoft account has access to them. Ask the site owner to add you as a member or visitor, or paste the site URL directly into Circuit's site selector.
  </Accordion>

  <Accordion title="Documents inside a site are missing from the index">
    Circuit reads documents through the document libraries attached to the site. Files stored in personal OneDrives (even if linked from a SharePoint page) are not imported through this integration. Use the [OneDrive](/admin/integrations/feeds/onedrive) feed for those.
  </Accordion>

  <Accordion title="Sync stops working after a password change or MFA reset">
    The refresh token is invalidated. Open the feed in Circuit and click **Reconnect**.
  </Accordion>

  <Accordion title="A page or file was updated in SharePoint but the index still shows the old content">
    Updates are picked up on the next sync cycle, usually within a few hours. If the content remains stale for longer, force a re-sync from the feed's settings.
  </Accordion>
</AccordionGroup>

## Reference

* **OAuth flow**: Microsoft identity platform, authorization code
* **Scopes requested**: `Sites.Read.All`, `Files.Read.All`, `offline_access`
* **Redirect URI**: `https://app.circuit.ai/api/sharepoint-oauth`
* **Application name shown on consent screen**: Circuit
* **Microsoft's own docs**: [Microsoft Graph sites permissions](https://learn.microsoft.com/en-us/graph/permissions-reference#sites-permissions), [Sites.Selected overview](https://learn.microsoft.com/en-us/graph/permissions-selected-overview)
