SharePoint Integration
Connect a SharePoint folder to an xMagic Drive folder so your agents can search and use its files. xMagic imports and indexes the files once, then keeps the two folders in sync. You decide whether changes only flow from SharePoint into xMagic, or whether agents can also write back to SharePoint.
This guide uses a running example: the Operations site has a Release Notes folder that a release assistant agent should read and, later, update.
| Where | What you do there |
|---|---|
| xMagic Drive | Create the folder, connect SharePoint and choose how it syncs |
| xMagic Composer | Give an agent access to the synced folder |
| Microsoft Entra admin center and Graph Explorer | Only for Client Credentials: register an Azure app and grant it access to the site |
Choose how changes sync
Every SharePoint integration pulls changes from SharePoint. Two-way sync is optional and also pushes the agents' changes back.
| Mode | SharePoint → xMagic | xMagic → SharePoint |
|---|---|---|
| Pull only (default) | New, updated and deleted files are reflected in xMagic | Nothing. Agent changes stay in xMagic. |
| Two-way | Same as pull only | Agents can create folders and create, edit or delete files in SharePoint, within the folders and permissions you give them |
For example, with two-way sync, when the agent edits Release Notes/2026-11.docx in xMagic, the new version is saved to the same file in SharePoint. With pull only, the edit stays in xMagic and the SharePoint file is untouched.
When changes move:
- SharePoint → xMagic: on the schedule you set, or whenever you select Sync Now in Integration Details.
- xMagic → SharePoint: right after the agent makes the change. Changes that could not be saved are retried on the next sync.
Before you start
You need:
- Access to xMagic Drive and to the agent you want to connect.
- A Microsoft 365 account that can open the SharePoint site and folder. For two-way sync, it must also be able to edit them.
- For Client Credentials only: an Entra administrator who can register an app and grant it access to the site. See Set up an Azure app.
Step 1: Choose an xMagic folder
- In xMagic, open Drive.
- Create a folder (for example
Operations) or open an existing one. - Select Add data → SharePoint.
A folder can't get a sync integration if the folder itself, one of its parent folders or one of its subfolders already has one. Choose a separate folder instead.
Step 2: Choose how xMagic signs in to SharePoint
| Method | Best for | What you need |
|---|---|---|
| OAuth (recommended) | Most teams. xMagic acts on behalf of the person who signs in. | A Microsoft 365 account with access to the folder |
| Client Credentials (Azure App) | Organizations that don't want the sync to depend on a person's account | The Tenant ID, Client ID and Client Secret of an Azure app |
- OAuth: select Import from SharePoint and sign in with Microsoft in the popup. xMagic asks for read-only access at this point. Edit access is only requested later, if you turn on two-way sync. Then select Continue.
- Client Credentials: enter the Tenant ID, Client ID and Client Secret of your Azure app and select Continue.
If nothing happens when you select Import from SharePoint, allow popups for xMagic in your browser and try again.
Step 3: Enter the site and the folders to sync
| Field | What to enter | Example |
|---|---|---|
| Site URL | The address of the SharePoint site | https://example.sharepoint.com/sites/Operations |
| Base file path | The folder (or file) to sync, inside that site | https://example.sharepoint.com/sites/Operations/Shared%20Documents/Release%20Notes |
For Base file path you can paste:
- the folder's address, as in the example above,
- the address shown in your browser while the folder is open in SharePoint (it ends in
AllItems.aspx?id=...), or - a sharing link created with Copy link in SharePoint.
To sync several folders into the same xMagic folder, separate them with commas:
https://example.sharepoint.com/sites/Operations/Shared%20Documents/Release%20Notes,
https://example.sharepoint.com/sites/Operations/Shared%20Documents/Runbooks
Agents can always create files inside the synced subfolders, such as Release Notes/2026. To let them create files at the top level of the xMagic folder too, enter a single base file path. With several paths, xMagic can't know which SharePoint folder a new top-level file belongs to.
Select Continue.
Step 4: Configure syncing
- Enter a Description of the content, for example
Release notes. It is required. - Turn on Use OCR if the folder has scanned documents or images with text you want the agent to read.
- To pull changes on a schedule, turn on Sync files automatically and enter the Sync interval (minutes). The minimum is 60 minutes and the default is 1440 minutes (once a day). The interval counts from the end of the previous sync.
- For two-way sync, turn on Push xMagic changes to SharePoint and give xMagic edit access:
- OAuth: select Grant access and approve edit access in the Microsoft popup. The row then shows Edit access granted. Finish stays disabled until you do this.
- Client Credentials: the Azure app must already be allowed to write to the site. See Grant access to the site.
- With two-way sync on, choose what happens under If a file changed in both places since the last sync:
| Option | What happens | Example: the agent and a colleague both edited 2026-11.docx |
|---|---|---|
| Always keep xMagic changes (default) | The xMagic version overwrites the SharePoint file | The agent's version is saved to SharePoint |
| Always keep SharePoint changes | The SharePoint version replaces the agent's change | The colleague's version is copied into xMagic and the agent's edit is dropped |
- Select Finish. xMagic imports and indexes the files. This can take a while for large folders.
You can change the description, schedule, OCR, two-way sync and the conflict option later in Integration Details (see Manage the integration).
Step 5: Give an agent access to the folder
- In Composer, open the agent's Configuration.
- Under Folders, select the synced folder. You can also pick just a subfolder. For example, attaching
Operations/Release Notesshows it to the agent asdrive://Release Notes/. - Choose what the agent may do in that folder:
| Permission | The agent can | Needed for |
|---|---|---|
| None | Read and search files | Answering questions about the files |
| Create | Create files and folders | Drafting a new release note |
| Update | Edit files and folders | Correcting an existing release note |
| Delete | Delete files | Removing an outdated release note |
| Confirm delete | Ask you to approve each deletion first (available once Delete is on) | Keeping a person in control of deletions |
- Select Save.
With Delete on and Confirm delete off, the agent can delete files without asking. With two-way sync, those files are also deleted in SharePoint.
These permissions apply in xMagic. With two-way sync, the SharePoint account or Azure app must also be allowed to make the same change in SharePoint.
Step 6: Test it
Wait until the import finishes, then:
- Pull only: ask the agent about a file in the folder, for example "What changed in the November release?". Then edit the file in SharePoint, select Sync Now and ask again.
- Two-way: turn on Create and ask the agent to create a sample file, for example "Create a draft called release-checklist.md in Release Notes". Check that the file appears in the SharePoint folder.
Manage the integration
In Drive, open the synced folder's integration to see Integration Details:
| Action | Effect |
|---|---|
| Sync Now | Pull the latest SharePoint changes and push pending agent changes now |
| Save | Apply changes to the description, sync schedule, OCR, two-way sync or conflict option |
| Go to Folder | Open the synced folder in Drive |
| Delete | Remove the integration |
If you turn on two-way sync later on an OAuth integration, select Grant access to approve edit access before saving.