OneDrive / SharePoint¶
Integration with SharePoint/OneDrive via an n8n proxy. Allows browsing folder contents and importing files directly into notebooks for ingestion.
Base path: /api/onedrive
GET /api/onedrive/status¶
Check if the SharePoint/OneDrive integration is available. Returns connected: true when the n8n webhook API key is configured.
Auth: User
Headers:
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Status: 200 OK
| Code | Cause |
|---|---|
401 | Invalid or missing token |
GET /api/onedrive/folders¶
Browse the contents of a SharePoint/OneDrive folder via the n8n proxy. Returns files and subfolders. Only shows supported file types.
Auth: User
Headers:
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
folder_id | string | No | "root" | SharePoint folder ID or "root" |
Status: 200 OK
| Code | Cause |
|---|---|
400 | Invalid folder ID or API error |
401 | Invalid or missing token |
POST /api/onedrive/import¶
Import selected files from SharePoint into a notebook. Downloads each file via the n8n proxy, uploads to storage, and triggers the standard ingestion pipeline in the background.
Auth: Admin
Headers:
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Body:
{
"notebook_id": "a1b2c3d4-...",
"file_ids": ["file-xyz", "file-abc"],
"notebook_name": "Customer Support KB",
"settings": {
"parser": "Docling Parser",
"chunking_strategy": "Recursive Chunking"
}
}
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
notebook_id | string | Yes | -- | Target notebook |
file_ids | array | Yes | -- | SharePoint file IDs to import |
notebook_name | string | No | -- | Notebook name for metadata |
settings | object | No | null | Ingestion settings |
Status: 200 OK
| Code | Cause |
|---|---|
400 | Invalid request or SharePoint API error |
401 | Invalid or missing token |
403 | Non-admin user |
import httpx
response = httpx.post(
"http://localhost:8000/api/onedrive/import",
headers={"Authorization": f"Bearer {token}"},
json={
"notebook_id": "a1b2c3d4",
"file_ids": ["file-xyz"],
"notebook_name": "Customer Support KB",
"settings": {"parser": "Docling Parser"},
},
timeout=60.0,
)
result = response.json()["data"]
print(f"Imported {len(result['imported'])} files")
POST /api/onedrive/import-folder¶
Import all supported files from a SharePoint folder. The n8n proxy lists all files, downloads each one, uploads to storage, and triggers ingestion.
Auth: Admin
Headers:
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Body:
{
"notebook_id": "a1b2c3d4-...",
"folder_id": "folder-abc",
"notebook_name": "Customer Support KB",
"settings": {
"parser": "Docling Parser"
}
}
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
notebook_id | string | Yes | -- | Target notebook |
folder_id | string | Yes | -- | SharePoint folder ID |
notebook_name | string | No | -- | Notebook name for metadata |
settings | object | No | null | Ingestion settings |
Status: 200 OK
| Code | Cause |
|---|---|
400 | Invalid folder ID or SharePoint API error |
401 | Invalid or missing token |
403 | Non-admin user |
import httpx
response = httpx.post(
"http://localhost:8000/api/onedrive/import-folder",
headers={"Authorization": f"Bearer {token}"},
json={
"notebook_id": "a1b2c3d4",
"folder_id": "folder-abc",
"notebook_name": "Customer Support KB",
},
timeout=120.0,
)
result = response.json()["data"]
print(f"Imported {len(result['imported'])} files from folder")
DELETE /api/onedrive/disconnect¶
Disconnect the OneDrive/SharePoint integration. With the n8n proxy approach this is a no-op since auth is managed by the n8n server.
Auth: User
Headers:
| Header | Value |
|---|---|
Authorization | Bearer <token> |
| Code | Cause |
|---|---|
401 | Invalid or missing token |