# Connect SharePoint

Source: https://docs.havilo.ai/guides/sharepoint

## 1. Start in Havilo

In Settings → Integrations, select Connect on SharePoint.

1. Select Sign in with Microsoft and sign in with your work account from the organization that owns the site. Havilo only connects sites belonging to an organization you have signed in to.
2. Paste the site's address. Any page from the site works, such as a document library you have open.

![The Connect SharePoint dialog: Sign in with Microsoft, the site address, and the approval link for your Microsoft admin.](https://docs.havilo.ai/docs/sharepoint/connect-dialog.png)

## 2. Your Microsoft admin approves Havilo

This happens once for each site. If you are the admin, select Open approval page. If not, select Copy link and send it to them. They don't need a Havilo account.

![The approval page: the site address, then Approve in Microsoft and Give access.](https://docs.havilo.ai/docs/sharepoint/approve-page.png)

On the approval page, the admin:

1. Selects Approve in Microsoft, and signs in as a Global administrator. Microsoft asks them to approve the Havilo Knowledge Connector. They select Accept, and Microsoft brings them back to the approval page. The connector can't read any site until step 2.
2. Selects Give access, and signs in as a Global administrator who is a member of the site. Microsoft asks them to accept "Have full control of all your site collections", because adding access to a site requires it. Anyone else gets Microsoft's "Need admin approval" page. Havilo uses it once, to give the connector read access to this one site, and doesn't keep it.

When both are done, the page says so:

![The approval page confirming Havilo can read the site.](https://docs.havilo.ai/docs/sharepoint/approve-done.png)

Havilo's access is read-only. It can't change, move or delete anything in SharePoint.

**For IT teams that prefer the command line**

Approve the connector with Microsoft's admin consent link, then grant it read access to the site yourself. The connector's application ID is `f5a86299-7f54-4ace-88b2-d682baf29c53`.

```text
https://login.microsoftonline.com/<tenant-id>/adminconsent?client_id=f5a86299-7f54-4ace-88b2-d682baf29c53
```

![The connector's Microsoft Graph permissions in Entra.](https://docs.havilo.ai/docs/sharepoint/microsoft-permissions.png)

```bash
m365 spo site apppermission add \
  --siteUrl "https://company.sharepoint.com/sites/team" \
  --appId "f5a86299-7f54-4ace-88b2-d682baf29c53" \
  --appDisplayName "Havilo Knowledge Connector" \
  --permission read
```

[PnP PowerShell](https://pnp.github.io/powershell/cmdlets/Grant-PnPEntraIDAppSitePermission.html) (`Grant-PnPEntraIDAppSitePermission -Permissions Read`) and [Microsoft Graph](https://learn.microsoft.com/en-us/graph/api/site-post-permissions) (`roles: ["read"]`) work too.

## 3. Choose your libraries

Back in Havilo, select Verify access. If something is still missing, Havilo says which step and who has to do it.

Select the libraries, accept the workspace audience statement, and select Connect and index.

Havilo connects whole document libraries. To connect only some folders, move them into a library of their own.

Everyone in your Havilo workspace with knowledge access can read these libraries. SharePoint's individual file permissions do not carry over.

![Select Documents, acknowledge workspace access, then connect and index.](https://docs.havilo.ai/docs/sharepoint/choose-libraries.png)

The integration card shows how many files have been indexed. Changes sync automatically; select Sync now to request an update.

![Connected document library with its indexed-file count and Sync now button.](https://docs.havilo.ai/docs/sharepoint/indexed-library.png)

## 4. Ask about your documents

Ask the Agent a question about the work, for example:

> What still needs approval before our next launch?

## Pause, remove or disconnect

To stop syncing without deleting anything, turn off the switch on the SharePoint card. Havilo keeps what it has already indexed.

Select Remove on a library, or open the card's settings and select Disconnect to remove every library. Havilo stops reading it at once and deletes its copy of the text and search index within minutes. Your SharePoint files are not changed.

Conversations where someone asked about a document keep their answers. To have those deleted too, contact us.
