How to sync knowledge sources using File Connector APIs?
You can use the File Connector APIs to sync .txt, .md, .doc, .docx, .csv, .xls, .xlsx, .html, and .pdf files when using knowledge for Genesys AI-powered experiences.
A full synchronization process includes the following four phases:
- Creating a knowledge source (once per source)
- Starting a sync round (once per sync round)
- Requesting upload URLs (once per file)
- Marking the synchronization as completed (after all uploads)
Create a knowledge source
Create a source once, then reuse its sourceId for all future synchronizations.
Endpoint
POST /api/v2/knowledge/sources
When to call
Initial setup (or when provisioning a new source).
Response
Returns the created source details, including the sourceId.
Start a sync round
Before uploading any files for a sync round, you must create a new synchronization.
Endpoint
POST /api/v2/knowledge/sources/{sourceId}/synchronizations
Path parameters
sourceId — ID returned from the “Create a knowledge source” step.
When to call
At the start of every sync round.
Response
Returns synchronization details, including the synchronizationId.
Request upload URLs
For every file you intend to upload as part of the synchronization, request an upload URL from the uploads endpoint.
Endpoint
POST /api/v2/knowledge/sources/{sourceId}/synchronizations/{synchronizationId}/uploads
Path parameters
sourceId— knowledge source IDsynchronizationId— ID returned from the “Start a sync round” step
When to call
Once per file you plan to upload.
Response
The API returns a URL to upload the file content (typically a pre-signed URL or similar mechanism, depending on implementation).
Expected flow per file
- Call the uploads endpoint to obtain the upload URL.
- Upload the file to the returned URL.
- Repeat for all files in the sync round.
Mark the synchronization as completed
After all files have been uploaded successfully, mark the synchronization status as completed.
Endpoint
PATCH /api/v2/knowledge/sources/{sourceId}/synchronizations/{synchronizationId}
Path parameters
sourceId— knowledge source IDsynchronizationId— synchronization ID
When to call
Only after you have finished uploading all files for this synchronization round.
Behavior
Sets the synchronization status to completed (and signals the system that uploads are done).
For more information about all available Genesys Cloud knowledge APIs, see Genesys Cloud Developer Center: Knowledge APIs.
[NEXT] Was this article helpful?
Get user feedback about articles.