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.
curl --request PUT \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/sources/{source_id}/sync-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customIntervalSeconds": 21600,
"enabled": true,
"expectedRevision": 5,
"expectedSourceVersion": 8,
"mode": "custom"
}
'{
"created_at": "2026-09-01T08:05:00Z",
"custom_interval_seconds": 21600,
"enabled": true,
"expected_source_version": 8,
"id": "8e7d6c5b-4a39-4f28-9e17-0d1c2b3a4f5e",
"knowledge_space_id": "0a9d3c2e-5b6f-4e1a-8c7d-2f3e4a5b6c7d",
"mode": "custom",
"next_run_at": "2026-10-21T08:30:00Z",
"revision": 6,
"source_id": "6f1c2b0e-3d0b-4a5e-9f4c-1c0e6a7b8d90",
"updated_at": "2026-10-21T02:30:00Z"
}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).
Body
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 >= 1Response
The saved schedule. With mode: manual or enabled: false, next_run_at is null.
Schedule revision. Send it as expectedRevision on Update Sync Policy. It increases on every update and every time a scheduled sync starts.
Was this page helpful?
curl --request PUT \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/sources/{source_id}/sync-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customIntervalSeconds": 21600,
"enabled": true,
"expectedRevision": 5,
"expectedSourceVersion": 8,
"mode": "custom"
}
'{
"created_at": "2026-09-01T08:05:00Z",
"custom_interval_seconds": 21600,
"enabled": true,
"expected_source_version": 8,
"id": "8e7d6c5b-4a39-4f28-9e17-0d1c2b3a4f5e",
"knowledge_space_id": "0a9d3c2e-5b6f-4e1a-8c7d-2f3e4a5b6c7d",
"mode": "custom",
"next_run_at": "2026-10-21T08:30:00Z",
"revision": 6,
"source_id": "6f1c2b0e-3d0b-4a5e-9f4c-1c0e6a7b8d90",
"updated_at": "2026-10-21T02:30:00Z"
}