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

# SharePoint integration

> Connect SharePoint through a Microsoft 365 user you create for End Close, so End Close indexes only the sites that user can open and agents can read and save files there.

Connect SharePoint when your statements, contracts and invoices live in SharePoint document libraries. End Close indexes the libraries or folders you choose, shows them in **Files**, and keeps them up to date as they change. Agents can read those files and save new ones into a folder you pick.

End Close connects by signing in as a Microsoft 365 user you create for it. Microsoft limits End Close to what that user can open, so you decide what End Close can reach by choosing which SharePoint sites to add the user to. End Close can't see any other site in your tenant, even by mistake.

One Microsoft 365 connection covers both SharePoint and [OneDrive](https://endclose.com/docs/integrations/onedrive.md).

## At a glance

| | |
| - | - |
| **Connects as** | A Microsoft 365 user you create for End Close, signed in once |
| **What End Close can reach** | Only the SharePoint sites that user is a member of |
| **What End Close reads** | Only the libraries or folders you add, shown in **Files** |
| **Permissions** | `Sites.Read.All` and `Files.Read.All` to read, and optionally `Files.ReadWrite.All` so agents can save new files. These are delegated permissions, so Microsoft limits each one to what the End Close user can open. |
| **Updates** | Microsoft change notifications, a check every 10 minutes, and a full re-index every week |
| **Who can set it up** | An End Close admin, with a Microsoft 365 admin to create the user |
| **Per environment** | Yes, one Microsoft 365 connection per environment |

## Prerequisites

* An End Close admin. Only admins can connect Microsoft 365 or add libraries.
* A Microsoft 365 admin who can create a user, assign it a licence and add it to SharePoint sites.

## Create the End Close user

Create the user before you connect.

**1. Create a user**

In the Microsoft 365 admin center, go to **Users → Active users → Add a user**. Give it a name that makes clear what it is, such as "End Close", signing in as `endclose@yourcompany.com`. Don't give it any admin roles.

**2. Assign a licence**

Assign a licence that includes SharePoint, such as Microsoft 365 Business Basic. Without one, the user can't open SharePoint and End Close sees nothing.

**3. Add it to each site End Close should see**

In each SharePoint site, add the user to the site's visitors to let End Close read only, or to its members if agents should also save files there. Add it to as many or as few sites as you like.

**4. Let it sign in without a prompt each week**

The user signs in once, when you connect. After that, End Close keeps the connection alive without anyone signing in. If a Conditional Access policy makes users sign in again on a schedule, exclude this user from it, or the connection shows **Disconnected** each time that sign-in comes due.

> [!NOTE]
>
> Members can edit a site's files, but End Close never does. Agents only create new files and never change, move or delete files already there. Adding the user as a member only lets agents save new files.

## Connect Microsoft 365

Have the End Close user's sign-in details to hand.

**1. Start from Integrations**

In End Close, go to **Settings → Integrations** and choose **SharePoint** under **Files and spreadsheets**, then **Connect**. End Close sends you to Microsoft.

**2. Sign in as the End Close user**

Microsoft asks which account to use. Choose **Use another account** and sign in as the End Close user, not as yourself. End Close acts as whichever account signs in here.

**3. Accept the permissions**

Review the permissions End Close asks for and accept them. If your tenant doesn't let users approve apps, Microsoft asks a Microsoft 365 admin to approve End Close first. That approval still only reaches what the End Close user can open.

**4. Return to End Close**

Microsoft sends you back to **Settings → Integrations**, and End Close saves the connection.

The first connection only asks to read. To let agents save new files, choose **Reconnect to allow saving** in the Microsoft 365 dialog and sign in as the End Close user again.

The Microsoft 365 dialog then shows one of these:

| Status | Meaning |
| - | - |
| **Connected** | End Close can read the libraries you add, and agents can save new files into one of them. |
| **Read-only** | Saving wasn't approved. Agents can read but can't save. Choose **Reconnect to allow saving** to approve it. |
| **Disconnected** | Microsoft no longer lets End Close sign in as the End Close user. Libraries stop updating until an admin reconnects. |

## Add a library

End Close only reads what you add. Nothing else in your tenant is indexed.

**1. Open the picker**

In the Microsoft 365 dialog, choose **Add a library or folder**, then **SharePoint**.

**2. Find the site**

Search for the site under **Search sites** and open it. Only sites the End Close user is a member of appear. If a site is missing, add the user to it in SharePoint.

**3. Choose a library or folder**

Open a document library. Choose **Add the whole library**, or open a folder inside it and add just that folder.

End Close indexes the files straight away, and the library appears in **Files**. Folders you've already added show **Already catalogued** in the picker.

## How End Close stays up to date

* **Changes in Microsoft 365.** End Close subscribes to Microsoft change notifications for each library you add, and reads the changes when Microsoft reports them.
* **Every 10 minutes.** End Close also checks each library for changes every 10 minutes, so a missed notification delays a change by at most that long.
* **Weekly re-index.** End Close re-indexes every library once a week. To re-index sooner, open the library's menu in **Files** and choose **Re-index now**.

Agents can read files up to 200 MB.

## Agents saving files

Agents only create files. They never change, move or delete files already there. To let agents save, the connection needs the `Files.ReadWrite.All` permission, and the End Close user must be a member of the site, not just a visitor. If a file with the same name already exists, the save fails rather than overwriting it.

## When the connection shows Disconnected

End Close acts as the End Close user, so anything that stops that user signing in also stops End Close. That includes:

* changing the user's password
* requiring the user to sign in again
* disabling or deleting the user

To fix it, choose **Reconnect** and sign in as the same End Close user. End Close picks up where it left off. Signing in as a different account is refused, because it would change what End Close can see. To switch to a different user, disconnect and connect again.

## Stop indexing or disconnect

* **Stop indexing a folder.** In **Files**, open the library, open its menu and choose **Stop cataloguing**. If it's the only folder in that library, the menu offers **Remove** instead.
* **Take a site away from End Close.** Remove the End Close user from the site in SharePoint. End Close can no longer read it.
* **Disconnect Microsoft 365.** In **Settings → Integrations**, open **SharePoint** and choose **Disconnect…**. End Close stops Microsoft's notifications and forgets every library added through the connection. Nothing in Microsoft 365 changes.

You can't remove a library that agents save into, or disconnect while one exists, until those agents save somewhere else.

To end End Close's access in Microsoft as well, disable or delete the End Close user.

## FAQ

> [accordion] How do I limit what End Close can see?
>
> Add the End Close user only to the sites End Close needs. Microsoft refuses End Close access to every other site, and to any library inside a site that the user can't open.

> [accordion] Does the End Close user need admin rights?
>
> No. Don't give it any admin roles. It needs a licence that includes SharePoint and membership of the sites End Close should see.

> [accordion] Can I add a single folder instead of a whole library?
>
> Yes. Open the library in the picker, browse to the folder and add it. You can add more folders from the same library later.

> [accordion] Can End Close change or delete my files?
>
> No. End Close reads the libraries you add, and agents can only create new files. A save never replaces an existing file.

> [accordion] Why does the connection show Read-only?
>
> Saving wasn't approved when you connected. Reading still works. Choose **Reconnect to allow saving**, sign in as the End Close user and accept `Files.ReadWrite.All`.

## Related

> [card] [OneDrive integration](https://endclose.com/docs/integrations/onedrive.md)
>
> Index the End Close user's OneDrive through the same connection.

> [card] [Box integration](https://endclose.com/docs/integrations/box.md)
>
> Index Box folders the same way.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.