Skip to main content
put/knowledge-fs/spaces/{knowledge_base_id}/sources/{source_id}/sync-policy
Request example
Response
put/knowledge-fs/spaces/{knowledge_base_id}/sources/{source_id}/sync-policy

Authorization

Authorizationstringheaderrequired#

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_idstringrequired#
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_idstringrequired#
Source ID. From List Sources.

Body

application/json
customIntervalSecondsinteger#
Seconds between scheduled syncs, from 1 hour to 30 days. Required with mode: custom and rejected with the other modes.

Range: 3600–2592000

enabledbooleanrequired#
Whether scheduled syncs run. Must be false with mode: manual.
expectedRevisionintegerrequired#
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.

Range: >= 0

expectedSourceVersionintegerrequired#
The 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.

Range: >= 1

modeenum<string>required#
manual turns scheduled syncs off, interval syncs every 24 hours, and custom syncs every customIntervalSeconds.
Options:manualintervalcustom

Responses

application/json
The saved schedule. With mode: manual or enabled: false, next_run_at is null.
created_atstring#
Creation time, ISO 8601.
custom_interval_secondsinteger#
Interval in seconds for mode: custom. null for the other modes.
enabledboolean#
Whether scheduled syncs run. Always false with mode: manual.
expected_source_versioninteger#
Source version the schedule is bound to.
idstring#
Sync policy ID. It stays the same across updates.
knowledge_space_idstring#
Internal ID of the knowledge base. Not the knowledge base ID in the path.
modestring#
manual (no schedule), interval (every 24 hours), or custom (every custom_interval_seconds).
next_run_atstring#
When the next scheduled sync is due, ISO 8601. null when nothing is scheduled.
revisioninteger#
Schedule revision. Send it as expectedRevision on Update Sync Policy. It increases on every update and every time a scheduled sync starts.
source_idstring#
Source the schedule belongs to.
updated_atstring#
Last change, ISO 8601. Also moves when a scheduled sync starts.