Product
Microsoft SharePoint
Connect your Microsoft SharePoint sites to sync document libraries, lists, and pages into your Twig AI knowledge base for enterprise-wide knowledge management.
TL;DR
Connect your Microsoft SharePoint sites to sync document libraries, lists, and pages into your Twig AI knowledge base for enterprise-wide knowledge management.
Key Takeaways
- Overview
- When to Use SharePoint Connector
- Supported Content Types
- Prerequisites
- How to Set Up SharePoint Connector
- Finding SharePoint Library Names
Connect your Microsoft SharePoint sites to sync document libraries, lists, and pages into your Twig AI knowledge base for enterprise-wide knowledge management.
Overview
| Property | Details |
|---|---|
| Type | Dynamic |
| Refresh | Scheduled (Daily, Weekly, Monthly) |
| Tier | 2 (Professional & Enterprise) |
| Authentication | OAuth 2.0 (Microsoft) |
| Content Types | Document libraries, pages, lists |
When to Use SharePoint Connector
The SharePoint connector is ideal for:
- Enterprise Knowledge Management - Department or company-wide content
- Document Libraries - Structured document repositories
- Team Sites - Collaborative team workspaces
- Intranet Content - Internal communication and resources
- Compliance-Required Storage - Regulated document management
- Large-Scale Deployments - Enterprise Microsoft 365 environments
Supported Content Types
Document Libraries
- Office documents (Word, Excel, PowerPoint)
- PDF files
- Text documents
- Images with text
- Templates and forms
SharePoint Pages
- Modern pages and news
- Wiki pages
- Site pages
- Web parts content
Lists (Limited)
- List items with text fields
- Metadata and descriptions
- Announcements
Prerequisites
Before setting up:
- SharePoint Online (Microsoft 365)
- Site access (Member or Owner permissions)
- Organizational Microsoft account
- Admin approval for OAuth (if required)
How to Set Up SharePoint Connector
Step 1: Gather SharePoint Information
You'll need:
- Site URL - Your SharePoint site address
- Document Library Name - Name of library to sync (optional)
- Microsoft Account - With access to the site
Step 2: Find Your SharePoint Site URL
Your SharePoint URL follows this pattern:
https://[tenant].sharepoint.com/sites/[sitename]
^^^^^^^^ ^^^^^^^^
Your org Site name
Examples:
https://contoso.sharepoint.com/sites/engineeringhttps://acmecorp.sharepoint.com/sites/hrhttps://company.sharepoint.com/sites/projectalpha
To find your site URL:
- Navigate to your SharePoint site
- Copy the URL from your browser address bar
- Use only up to
/sites/[sitename](don't include library or page paths)
Step 3: Navigate to Data Sources
- Log in to your Twig AI account
- Click Data in the main navigation menu
- Click Add Data Source or the + button
- Choose MS-Sharepoint from the list
- Note: Available on Professional and Enterprise plans
Step 4: Configure Basic Information
- Name (required): Descriptive name
- Example: "Engineering Site", "HR Document Library", "Product Team Site"
- Description (optional): Additional context
- Example: "Engineering team SharePoint with technical documentation"
- Tags (optional): Organization tags
- Examples: "sharepoint", "engineering", "internal"
Step 5: Authenticate with Microsoft
- Click Connect SharePoint or Authorize
- You'll be redirected to Microsoft login
- Sign in with your organizational account (name@company.com)
- Review requested permissions:
- Read SharePoint items - Access to site content
- Read site collections - Browse sites
- Read user profiles - User information
- Admin approval may be required
- Click Accept
- You'll be redirected back to Twig
Step 6: Configure Site and Library
Site URL (Required)
https://company.sharepoint.com/sites/engineering
Parameters (JSON)
{
"siteUrl": "https://company.sharepoint.com/sites/engineering",
"libraryName": "Documents",
"includeFolders": ["/Shared Documents/Product Specs"],
"excludeFolders": ["/Shared Documents/Archive"],
"fileTypes": ["docx", "pdf", "xlsx"],
"includePages": true,
"recursive": true,
"maxFiles": 1000
}
Available Parameters:
| Parameter | Type | Description | Default |
|---|---|---|---|
siteUrl | String | SharePoint site URL (required) | - |
libraryName | String | Document library name | "Documents" |
includeFolders | Array | Specific folders to sync | All |
excludeFolders | Array | Folders to skip | None |
fileTypes | Array | File extensions to include | All |
includePages | Boolean | Sync SharePoint pages | true |
includeLists | Boolean | Sync list items | false |
recursive | Boolean | Include subfolders | true |
maxFiles | Number | Maximum files to sync | 2000 |
modifiedAfter | String | Only files after date (YYYY-MM-DD) | All |
Step 7: Test Connection
- Click Test Config or Test Connection
- Twig will verify:
- Site URL is valid and accessible
- Authentication has proper permissions
- Library/folders can be accessed
- Review test results
- Fix any errors before proceeding
Step 8: Set Refresh Schedule
Choose sync frequency:
- Never - Manual sync only
- Daily - Sync changes daily (recommended for active sites)
- Weekly - Sync weekly (standard for most sites)
- Monthly - Sync monthly (for stable content)
Step 9: Save and Sync
- Click Save or Create
- Initial sync begins automatically
- Monitor progress in data sources list
- Check process logs for any errors or warnings
Finding SharePoint Library Names
Default Libraries
Most SharePoint sites have these standard libraries:
Documents- Default document librarySite Pages- Modern pagesSite Assets- Images and filesShared Documents- Shared files
Finding Custom Library Names
Method 1: From SharePoint UI
- Navigate to your SharePoint site
- Click on the library in the left navigation
- The library name appears in the page title and URL
Method 2: From URL
https://company.sharepoint.com/sites/engineering/ProductDocs
^^^^^^^^^^^
Library name
Method 3: Site Contents
- Go to Site Contents (gear icon → Site Contents)
- All libraries are listed with their names
Configuration Examples
Example 1: Team Site Documents
Name: Engineering Team Documents
Description: Engineering team's document library
Authentication: OAuth (john@company.com)
Parameters:
{
"siteUrl": "https://company.sharepoint.com/sites/engineering",
"libraryName": "Documents",
"recursive": true,
"includePages": true,
"fileTypes": ["docx", "pdf", "xlsx"]
}
Refresh: Daily
Tags: engineering, sharepoint, documents
Example 2: Specific Folder Only
Name: Product Specifications
Description: Product spec documents from SharePoint
Authentication: OAuth (pm@company.com)
Parameters:
{
"siteUrl": "https://company.sharepoint.com/sites/product",
"libraryName": "Documents",
"includeFolders": ["/Shared Documents/Specifications"],
"recursive": false,
"fileTypes": ["docx", "pdf"],
"maxFiles": 200
}
Refresh: Weekly
Tags: product, specs, sharepoint
Example 3: Multiple Libraries (Create Separate Sources)
// Source 1: Documentation Library
{
"siteUrl": "https://company.sharepoint.com/sites/team",
"libraryName": "Documentation",
"recursive": true
}
// Source 2: Training Materials
{
"siteUrl": "https://company.sharepoint.com/sites/team",
"libraryName": "Training",
"recursive": true
}
Example 4: Pages and Documents
Name: Intranet Content
Description: Intranet pages and supporting documents
Authentication: OAuth (comms@company.com)
Parameters:
{
"siteUrl": "https://company.sharepoint.com/sites/intranet",
"includePages": true,
"libraryName": "Documents",
"recursive": true,
"maxFiles": 500
}
Refresh: Daily
Tags: intranet, communications, sharepoint
Best Practices
1. Start with Specific Libraries
Rather than syncing entire site:
{
"libraryName": "Technical Documentation",
"recursive": true
}
2. Use Folder Filtering
Focus on relevant content:
{
"includeFolders": [
"/Shared Documents/Public",
"/Shared Documents/Training"
],
"excludeFolders": [
"/Shared Documents/Archive",
"/Shared Documents/Personal"
]
}
3. Filter by File Type
Optimize for AI-readable content:
{
"fileTypes": ["docx", "pdf", "txt", "xlsx"]
}
Avoid:
- Media files (unless needed)
- Executables
- Archives
4. Set Appropriate Scope
Good (Focused):
{
"libraryName": "Product Docs",
"includeFolders": ["/Shared Documents/Current"],
"maxFiles": 500
}
Avoid (Too Broad):
{
"recursive": true,
"maxFiles": 10000
}
// May include irrelevant or personal files
5. Sync Multiple Sites Separately
Create individual data sources for different sites:
- Engineering Site
- HR Site
- Product Site
- Marketing Site
Better organization and easier management.
6. Consider Permissions
- Only sync libraries accessible to all team members
- Avoid syncing restricted/confidential content
- Create agents with appropriate access controls
- Review content before making available to AI
7. Handle Large Sites
For sites with many files:
- Set
maxFileslimit - Use
modifiedAfterfor recent content - Sync specific folders only
- Create multiple focused data sources
Understanding Sync Behavior
Initial Sync
- Scans entire library/folders
- Downloads all matching files
- Processes SharePoint pages
- May take significant time for large libraries
Incremental Syncs
- Detects files modified since last sync
- Syncs only new or changed content
- Much faster than initial sync
- Tracks file metadata for changes
What Gets Synced
✅ Synced:
- New files added to library
- Modified file content
- Updated pages
- New pages
- Files moved into synced folders
- Renamed files (as new files)
❌ Not Synced:
- Deleted files (remain in Twig until cleanup)
- Files in recycle bin
- Files without read permission
- Checkout files (locked for editing)
- System files and folders
Content Processing
Documents:
- Word, Excel, PowerPoint → Text extraction
- PDF → Text extraction
- HTML pages → Content extraction
SharePoint Pages:
- Modern pages → Full content
- Text web parts → Extracted text
- Links and references → Captured
Lists:
- List items → Title and text fields
- Metadata → Included if relevant
Permissions & Security
OAuth Permissions Required
Twig requests:
Sites.Read.All- Read SharePoint sites and contentFiles.Read.All- Read files in document librariesUser.Read- Read user profile information
Twig cannot:
- Modify files or pages
- Delete content
- Change permissions
- Share files
- Create new content
SharePoint Permissions
The authenticated user must have:
- Read access to site
- Read access to document libraries
- Member or Visitor role on site
Tenant-Level Considerations
- Admin may need to approve app
- Conditional Access policies may apply
- DLP policies may restrict content
- Information barriers may limit access
If blocked: Contact SharePoint/Microsoft 365 administrator.
Revoking Access
To disconnect:
- In Twig: Delete the data source
- In Microsoft: Microsoft Account Apps
- In SharePoint: Site Settings → Site App Permissions
- Remove "Twig AI" access
Troubleshooting
Site Not Found
Problem: Can't connect to SharePoint site
Solutions:
- Verify site URL is correct and complete
- Ensure site exists and is not deleted
- Check you have access to the site
- Try accessing site in browser first
- Verify tenant URL (might be .sharepoint.com vs .sharepoint.us)
Authentication Failed
Problem: OAuth authentication fails
Solutions:
- Use organizational account (not personal)
- Ensure account has site access
- Check if admin approval is required
- Try re-authenticating
- Clear browser cache/cookies
Library Not Found
Problem: Can't access specified library
Solutions:
- Verify library name is exact match (case-sensitive)
- Check library exists on the site
- Ensure you have read permission to library
- Try "Documents" (default library name)
- Look in Site Contents for library name
No Files Synced
Problem: Sync completes but no files imported
Solutions:
- Verify library contains supported file types
- Check
fileTypesfilter isn't too restrictive - Review
includeFolderspaths - Ensure files aren't checked out (locked)
- Look for permission issues in process logs
Permission Denied Errors
Problem: Some files fail to sync
Solutions:
- Check file-level permissions
- Verify not in restricted folder
- Ensure files aren't checked out
- Review DLP policies
- Look for encrypted/IRM-protected files
Slow Syncs
Problem: Syncs take very long time
Solutions:
- Reduce
maxFileslimit - Use more specific
includeFolders - Set
recursive: falseif appropriate - Filter by
fileTypes - Split into multiple smaller data sources
- Check SharePoint throttling/performance
Missing Recent Changes
Problem: Recent updates not appearing
Solutions:
- Check last sync date in Twig
- Verify file is checked in (not draft)
- Manually trigger refresh
- Review process logs for errors
- Ensure SharePoint sync completed
Advanced Configuration
Multi-Site Setup
Sync multiple SharePoint sites:
// Site 1: Engineering
{
"siteUrl": "https://company.sharepoint.com/sites/engineering"
}
// Site 2: Product
{
"siteUrl": "https://company.sharepoint.com/sites/product"
}
// Site 3: Marketing
{
"siteUrl": "https://company.sharepoint.com/sites/marketing"
}
Hub Site Architecture
For hub-associated sites:
- Sync each site separately
- Use consistent naming convention
- Tag with hub association
- Create hub-level AI agents
Metadata Filtering
While not directly supported, you can:
- Organize files by folder based on metadata
- Use folder filtering to sync specific types
- Leverage SharePoint views to identify content
Content Type Filtering
Focus on specific SharePoint content types:
- Sync only document libraries (not lists)
- Include pages for intranet content
- Skip media libraries
SharePoint vs OneDrive
Use SharePoint when:
- Enterprise-wide knowledge management
- Multiple team sites
- Complex permissions and workflows
- Department or company-level content
- Integration with other SharePoint features
Use OneDrive when:
- Personal or small team files
- Individual user documents
- Simpler file structures
- Personal Microsoft accounts
Monitoring & Maintenance
Regular Checks
Weekly:
- Verify last sync completed
- Check file count trends
- Review any error logs
- Ensure new content is syncing
Monthly:
- Audit synced libraries
- Update folder filters if structure changed
- Review permissions and access
- Check for outdated content
Quarterly:
- Assess AI usage of SharePoint content
- Optimize sync configuration
- Review and cleanup old data sources
Metrics to Track
- Files Synced: Total document count
- Pages Synced: SharePoint pages indexed
- Last Sync: When sync last ran successfully
- Sync Duration: Processing time
- Error Rate: Percentage of failed imports
- Storage Used: Indexed data size
Enterprise Best Practices
1. Governance
- Document which sites are synced
- Define naming conventions
- Establish refresh schedules
- Set retention policies
- Review access regularly
2. Security
- Use service accounts for production
- Implement least-privilege access
- Audit AI access to sensitive content
- Review compliance requirements
- Monitor for data leaks
3. Performance
- Limit sync scope appropriately
- Stagger refresh schedules across sources
- Monitor API throttling
- Use folder filters effectively
- Split large libraries
4. Change Management
- Communicate with site owners
- Document synced libraries
- Plan for SharePoint migrations
- Update configurations after restructures
Next Steps
After connecting SharePoint:
- Test knowledge coverage
- Create department-specific agents
- Monitor content usage analytics
- Optimize folder structure and filters
- Expand to additional sites
Related Connectors
- OneDrive - Individual file storage
- Confluence - Alternative wiki platform
- Google Drive - Google cloud storage
- Files - Direct file uploads
- Website - Public SharePoint pages
Support
For SharePoint/Microsoft issues:
- SharePoint Online: https://docs.microsoft.com/sharepoint
- Microsoft Graph API: https://docs.microsoft.com/graph
- Microsoft 365 Admin Center: https://admin.microsoft.com
For Twig integration:
- Check process logs for specific errors
- Contact Twig support with site URL and library details
- Provide permission details if access issues
- Share error messages for troubleshooting
Agent Instructions: Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.
Perform an HTTP GET request on the current page URL with the ask query parameter:
GET /dev/product/data-integrations/ms-sharepoint.md?ask=<question>
The question should be specific, self-contained, and written in natural language. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.
Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
Related Pages
Last updated January 25, 2026


