Update Sync Policy
Sets a source’s sync schedule, replacing the previous one, and returns it.
Saving does not start a sync. The first scheduled sync is due one interval after the update, and each later one an interval after the previous one was queued. To sync now, call Sync Source.
After each import into the source finishes, save the schedule again with the source’s new version. An import changes version, and a schedule still bound to the old one turns itself off at its next due time.
To pause scheduled syncs without changing the schedule, set the source’s status to disabled with Update Source. A sync that came due meanwhile runs when the source is set back to active.
For the read-then-save flow, see Sync and Schedule Sources.
Authorizations
Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).
Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).
Path Parameters
Knowledge base ID: the last segment of the Service API endpoint shown in the knowledge base's API Access dialog (…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.
Source ID. From List Sources.
Body
Whether scheduled syncs run. Must be false with mode: manual.
The schedule's current revision, from Get Sync Policy. Send 0 when the source has no schedule yet. The revision also increases every time a scheduled sync starts, so read it right before updating. A stale value answers 409 and nothing changes.
x >= 0The source's current version, from Get Source or List Sources. It changes after every Update Source call and every completed import, so read it right before updating. A stale value answers 409 and nothing changes.
x >= 1manual turns scheduled syncs off, interval syncs every 24 hours, and custom syncs every customIntervalSeconds.
manual, interval, custom Seconds between scheduled syncs, from 1 hour to 30 days. Required with mode: custom and rejected with the other modes.
3600 <= x <= 2592000Response
The saved schedule. With mode: manual or enabled: false, next_run_at is null.
Creation time, ISO 8601.
Interval in seconds for mode: custom. null for the other modes.
Whether scheduled syncs run. Always false with mode: manual.
Source version the schedule is bound to.
Sync policy ID. It stays the same across updates.
Internal ID of the knowledge base. Not the knowledge base ID in the path.
manual (no schedule), interval (every 24 hours), or custom (every custom_interval_seconds).
When the next scheduled sync is due, ISO 8601. null when nothing is scheduled.
Schedule revision. Send it as expectedRevision on Update Sync Policy. It increases on every update and every time a scheduled sync starts.
Source the schedule belongs to.
Last change, ISO 8601. Also moves when a scheduled sync starts.
Was this page helpful?