A synced source connects a knowledge base to a folder or page in Google Drive, OneDrive or Notion. Tried imports the documents, re-imports the ones that change, removes the ones that disappear, and checks again every day. Agents that use the knowledge base answer from the latest content without anyone uploading files.
Providers#
| Provider | Point it at | What is imported |
|---|---|---|
| Google Drive | A folder id (required) | Google Docs (exported as plain text) and text or JSON files in that folder, up to 100 files. Subfolders are not followed |
| OneDrive | A folder id (optional, default the drive root) and an optional drive id | .txt, .md, .csv and .json files and other text files in that folder, up to 200 items. Subfolders are not followed |
| Notion | A page id (required) | The page's text blocks, plus child pages up to two levels down |
Other file types (PDFs, spreadsheets, images) in a synced folder are skipped. Upload those as normal knowledge base sources.
Connect a folder in the dashboard#
Open the knowledge base#
Go to Knowledge Base and select a knowledge base.
Connect a folder#
Press Connect a folder and pick Google Drive, OneDrive or Notion.
Point it at content#
Enter the Folder ID (Drive, OneDrive) or page id (Notion).
Give access#
Under Account access, press Connect Google Drive (or OneDrive, Notion) to sign in with OAuth Needs keys, or paste a token into Or paste an access token. Without either, the sync uses sample documents so you can try it.
Add and sync#
Press Add and sync. The first sync runs right away.
Imported documents appear as sources named <document title> (<provider>), for example Price list (google_drive).
How syncing works#
Each sync:
- Lists the documents at the source.
- Adds new documents as knowledge base sources.
- Re-ingests documents whose modified time changed.
- Deletes sources whose documents are gone.
- Re-embeds only what changed.
Syncs run:
- When the source is added or reconnected.
- When you call
POST /sync-knowledge-base-source/:sync_id. - Automatically, once a day for each source. An hourly job picks up sources not synced in the last 24 hours, up to 50 at a time.
If a sync fails (expired token, folder not shared), the source's status becomes error with the message, and the existing documents stay in the knowledge base.
Tokens#
- OAuth connections store the tokens encrypted and refresh them automatically before each sync. Notion tokens do not expire.
- Pasted tokens are encrypted and used as they are, without refresh. A pasted token stops working when it expires, so use OAuth for anything long lived.
OAuth scopes: Google Drive https://www.googleapis.com/auth/drive.readonly, OneDrive Files.Read.All offline_access, Notion page access granted on Notion's consent screen.
API#
| Method and path | Purpose |
|---|---|
POST /add-knowledge-base-synced-source/:knowledge_base_id |
Add a source with a pasted token (or none, for mock) and run the first sync. Returns 201 |
GET /list-knowledge-base-syncs/:knowledge_base_id |
Sources for one knowledge base |
POST /sync-knowledge-base-source/:sync_id |
Sync now |
DELETE /delete-knowledge-base-sync/:sync_id |
Remove the connection. Returns 204 |
POST /oauth/start with target: "kb_sync" |
Add or reconnect a source with OAuth. See OAuth connections |
curl -X POST https://api.tried.com.au/add-knowledge-base-synced-source/knowledge_base_a91977340392d4004e4c6e18 \
-H "Authorization: Bearer $TRIED_API_KEY" \
-H "Content-Type: application/json" \
-d '{"provider": "google_drive", "config": {"folder_id": "0B7xAbCdEfGh"}, "access_token": "ya29.a0..."}'| Field | Type | Required | Description |
|---|---|---|---|
provider |
string | Yes | google_drive, onedrive or notion |
config.folder_id |
string | Google Drive | Folder to sync. Optional for OneDrive (default root) |
config.drive_id |
string | No | OneDrive: a specific drive. Default the user's own drive |
config.page_id |
string | Notion | Root page to sync |
access_token |
string | No | Pasted token. Omit for mock mode |
{
"oauth": false,
"oauth_expires_timestamp": null,
"sync_id": "kbsync_3e7a1c5f9b2d6e0a4c8f1b35",
"knowledge_base_id": "knowledge_base_a91977340392d4004e4c6e18",
"provider": "google_drive",
"config": { "folder_id": "0B7xAbCdEfGh" },
"status": "synced",
"error": null,
"last_synced_timestamp": 1760692000000,
"document_count": 14,
"mock": false
}| Field | Description |
|---|---|
oauth |
true when connected with OAuth |
oauth_expires_timestamp |
When the OAuth access token expires, Unix ms |
status |
pending, synced or error |
error |
The last failure message, up to 500 characters |
document_count |
Documents currently imported |
mock |
true when the source has no real token and uses sample documents |
Mock mode#
Without a token, a sync imports two sample documents: "FAQ" ("Opening hours: 9am to 5pm weekdays") and "Price list" ("A standard consultation costs $80."). This lets you test the knowledge base flow end to end before connecting real accounts.
The same endpoints are documented in the API reference, starting at add-knowledge-base-synced-source.