# Connect SharePoint

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

## 1. Get administrator approval

In Settings → Integrations, select Connect on SharePoint. Give your Microsoft administrator the connector application ID shown in the dialog and the URL of the site you want to connect.

They must approve the connector and grant it read access to that site. This is a one-time setup for each site.

**Microsoft administrator instructions**

In [Microsoft Entra](https://entra.microsoft.com), open Enterprise apps, find the connector by its application ID, and grant admin consent to Microsoft Graph `Sites.Selected` (Application).

If the app is not listed, use the [administrator consent link](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent), replacing both placeholders:

```text
https://login.microsoftonline.com/<tenant-id>/adminconsent?client_id=<connector-app-id>
```

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

Next, grant the connector `read` access to the site. Consent alone does not provide site access. Choose the tool your IT team uses:

* [Microsoft 365 CLI](https://pnp.github.io/cli-microsoft365/cmd/spo/site/site-apppermission-add/): use the command below in an authenticated administrator session.
* [PnP PowerShell](https://pnp.github.io/powershell/cmdlets/Grant-PnPEntraIDAppSitePermission.html): use `Grant-PnPEntraIDAppSitePermission` with `-Permissions Read`.
* [Microsoft Graph](https://learn.microsoft.com/en-us/graph/api/site-post-permissions): create a site permission for the connector application with `roles: ["read"]`.

```bash
m365 spo site apppermission add \
  --siteUrl "https://company.sharepoint.com/sites/team" \
  --appId "<connector-app-id>" \
  --appDisplayName "Havilo Knowledge Connector" \
  --permission read
```

Replace the site URL and application ID with your values. Use this command's flags if the Havilo dialog shows different ones.

## 2. Choose your libraries

1. Enter your Microsoft tenant ID (from Entra → Overview) and site URL, such as `https://company.sharepoint.com/sites/team`.
2. Select Verify access.
3. Select the libraries, accept the workspace audience statement, and select Connect and index.

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)

## 3. Ask about your documents

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

> What still needs approval before our next launch?

If access verification fails, ask your administrator to check both tenant consent and the site's read grant.
