Keep a SharePoint document library in sync with your knowledge base. Files your team adds there are embedded automatically and become answerable; files they remove stop being used.
You need four things, and the third is the one that stalls setups:
1. Create it. In the Azure portal → Microsoft Entra ID → App registrations → New registration. Name it something recognisable, e.g. "Aimy SharePoint Sync". Single tenant is fine. No redirect URI is needed.
2. Copy two values from the Overview page: Directory (tenant) ID and Application (client) ID.
3. Create a client secret. Certificates & secrets → New client secret → choose an expiry → Add. Copy the Value column straight away — Azure hides it permanently once you leave the page.
4. Add it. API permissions → Add a permission → Microsoft Graph → Application permissions → search Sites.Selected → tick it → Add permissions.
5. Grant admin consent. Click Grant admin consent for <tenant> and confirm. The status should turn green.
This step is a Graph API call. There is no portal screen for it.
6. Find the site ID. Easiest route: in Aimy, do Step 4 below first and click Test connection. Even without site access, that resolves and shows the site. Alternatively call:
GET https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/Sales
7. Grant the app read access. Using Graph Explorer, signed in as someone with SharePoint admin rights:
POST https://graph.microsoft.com/v1.0/sites/{site-id}/permissions
{
"roles": ["read"],
"grantedToIdentities": [{
"application": {
"id": "<your Application (client) ID>",
"displayName": "Aimy SharePoint Sync"
}
}]
}
Verify: a 201 response with a permission object. Read access is enough — Aimy never writes to SharePoint.
8. Open the integration. Integrations → the SharePoint card, under Knowledge base.
9. Fill in four fields: Directory (tenant) ID, Application (client) ID, Client secret, and the Site address (e.g. https://contoso.sharepoint.com/sites/Sales).
You can paste the address straight from your browser while looking at the site — Aimy strips the extra path and sharing-link parts.
10. Click Test connection. This signs in, resolves the site, and lists the libraries it can see.
Verify: a dropdown of document libraries appears. If you get "The app isn't allowed to read that site", Step 3 was not done or targeted the wrong site.
11. Pick the library and save.
12. Wait or trigger it. The sync runs every ten minutes. Use Sync now to avoid waiting.
Verify, in order:
13. Test a deletion. Remove a file in SharePoint and sync again. It should disappear from the Knowledge Base. This matters more than it sounds: if a withdrawn price list keeps answering questions, the chatbot quotes prices you no longer offer.
Aimy uses app-only authentication rather than signing a person in. That is deliberate: the connection keeps working after whoever set it up leaves, and needs no re-consent. It also means access is scoped by an admin to exactly one library rather than to whatever one user can see.
Every ten minutes the sync walks the library's change feed. New and changed files are downloaded, malware-scanned and embedded; unchanged files are skipped by comparing an etag, so a steady library costs one cheap API call. Deleted files have their vectors removed.
Documents land under one owning account so retrieval sees a single coherent library. Entitlement is re-checked every pass — if the plan changes, the sync stops.