AI agent
Change a knowledge source
Authorization
AuthorizationstringrequiredAn API token, sent as Bearer <token>.
Needs the settings:write ability
Path parameters
sourcestringrequiredId of the knowledge source, starting with ks_, such as ks_01jx2m8k4t. Find it with GET /knowledge/sources.
Body
application/jsonexcludestring[] | nullPatterns of documents to leave out, up to 50.
Maximum items: 50
help_center_idstringHelp center (hc_...) an import or a help_center target writes to. Find it with GET /help-centers.
includestring[] | nullPatterns of documents to read, up to 50; empty reads everything.
Maximum items: 50
modestringsync keeps reading it for the agents; import turns it once into help center articles. Read on create only.
Available options:syncimport
namestringA name for the team, up to 80 characters.
Maximum length: 80
schedulestringmanual, hourly, daily or weekly, as the type allows.
Available options:manualhourlydailyweekly
settingsobjectThe object the type's settings schema describes, secrets included.
sync_nowbooleantrue starts a sync as soon as it is saved.
targetsstring[] | nullWhat it feeds: agent, operator and help_center. Defaults to agent and operator for sync, help_center for import.
Maximum items: 3
typestringSource type, from GET /knowledge/source-types. Read on create only.
Maximum length: 40
Response 200
OKdataobjectrequiredShow child attributesHide child attributes
countsobjectrequiredHow many of the source's documents are in each status, keyed by status, such as {"active": 120, "excluded": 4}.
created_atstringrequiredWhen it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
Format: date-time
document_countintegerrequiredHow many documents the source holds.
Format: int32
excludestring[] | nullrequiredPath patterns of documents to leave out; empty when none.
help_center_idstring | nullrequiredId of the help center the source's documents go to, starting with hc_. Set when the mode is import or help_center is a target; null otherwise.
idstringrequiredThe id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
includestring[] | nullrequiredPath patterns of documents to keep; empty keeps everything.
last_errorstring | nullrequiredWhat went wrong in the last sync, in words. Null when there is no error.
last_error_codestring | nullrequiredShort code of the last sync's error. Null when there is no error.
last_runobjectrequiredShow child attributesHide child attributes
created_atstringrequiredWhen it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
Format: date-time
errorstring | nullrequiredWhy the run failed, in words. Null when it did not.
error_codestring | nullrequiredShort code of the run's error. Null when it did not fail.
finished_atstring | nullrequiredWhen the run ended. Null while it is queued or running.
Format: date-time
full_runbooleanrequiredTrue when the run reads the whole source and removes documents it no longer finds; false for a partial run.
idstringrequiredThe id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
objectstringrequiredThe kind of record this is, the same for every record of its kind, such as article.
source_idstringrequiredId of the knowledge source the run belongs to, starting with ks_.
started_atstring | nullrequiredWhen the run began. Null while it is still queued.
Format: date-time
statsanyrequiredThe run's counters as an object of numbers, such as created, updated, unchanged and removed documents.
statusstringrequiredWhere the run stands: queued, running, succeeded, partial, failed or canceled.
triggerstringrequiredWhat started the run: create, manual, schedule, webhook, retry or document.
last_success_atstring | nullrequiredWhen a sync last succeeded. Null when none has yet.
Format: date-time
last_synced_atstring | nullrequiredWhen the source was last synced, whether or not it succeeded. Null when it never was.
Format: date-time
modestringrequiredHow the source is used: sync keeps a read-only copy refreshed on a schedule; import copies it once into editable help center articles.
namestringrequiredThe name the team gave this source.
next_sync_atstring | nullrequiredWhen the next scheduled sync is due. Null when none is planned, as with a manual schedule.
Format: date-time
objectstringrequiredThe kind of record this is, the same for every record of its kind, such as article.
schedulestringrequiredHow often the source is synced: manual, hourly, daily or weekly.
secrets_setstring[] | nullrequiredNames of the secret settings that have a value saved; the values themselves are never shown. Empty when none.
settingsanyrequiredThe source's own settings without its secrets, an object shaped by the settings schema of its type, such as a website's start address.
statusstringrequiredWhere the source stands: idle, queued, syncing, error (see last_error) or paused.
targetsstring[] | nullrequiredWho reads the source's documents: any of agent (the AI agent), operator and help_center.
typestringrequiredWhat kind of source it is, such as website, notion, github, markdown_upload, zendesk_help_center or intercom_help_center.
updated_atstringrequiredWhen it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
Format: date-time
Response error
ErrorcodestringrequiredStable code for programs to tell errors apart, such as validation_failed or internal_error.
errorsobjectEach rejected field mapped to its messages. Only present when the input was invalid.
messagestringrequiredWhat went wrong, in words safe to show a person.