Microsoft SharePoint
Create workspaces synced to your Microsoft SharePoint.
Sync a workspace to a SharePoint site so any document added there is automatically ingested and indexed in Context212. Files stay in sync: additions, updates, and deletions in SharePoint flow through to the workspace on the next import.
Synced workspaces are read-only: you cannot manually upload to or delete from them.
From the console
The fastest path is the console UI:
- Create a new workspace from Workspaces → New.
- Open the workspace, then choose Sync from SharePoint in its settings.
- Paste your Azure app credentials, pick the site and folder, and trigger the first import.
Use this if you'd rather not handle credentials yourself.
From the API
Convert any manual workspace into a SharePoint-synced workspace by issuing a PATCH /api/v1/company/workspaces/{id} with a datasource object. Conversion is one-way: you cannot revert a synced workspace back to manual.
await fetch(`https://api.context212.com/api/v1/company/workspaces/${workspaceId}`, {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.C212_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
datasource: {
type: "sharepoint",
name: "Legal SharePoint",
credentials: {
client_id: "00000000-0000-0000-0000-000000000000",
client_secret: "YOUR_CLIENT_SECRET",
tenant_id: "11111111-1111-1111-1111-111111111111",
site_name: "Legal",
},
filter_criteria: {
folder_path: "/Shared Documents/Contracts",
recursive: true,
},
},
}),
});Credentials
client_id,client_secret,tenant_id: from your Azure app registration. The app needsSites.Read.All(or scopedSites.Selected) Microsoft Graph permissions.site_idorsite_name(optional): pick the SharePoint site. If both are omitted, the root site is used.
Filter criteria
folder_path(required): path to the SharePoint folder to sync from, relative to the siterecursive(optional): include subfolders
The first import is scheduled immediately. Track progress on the workspace's sync field returned by GET /api/v1/company/workspaces/{id}.
For the full request shape, see PATCH /api/v1/company/workspaces/{id} in the API reference.