VocalDocscontracts 1.65.0

Sync a Source now

POST /v1/knowledge-bases/{knowledge_base_id}/sources/{source_id}/sync

PropertyValue
Operationsync_knowledge_source
GroupKnowledge bases
Scopeknowledge:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited knowledge.source.sync (mutation)
Released in1.53.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Starts an Ingestion run with cause manual and answers 202 with it and its Location (1.53.0). While a run of the Source is queued or running, it answers that run and marks the Source for one more sync after it, so bursts collapse. A sync of an upload Source is source_sync_not_applicable. The end of the run emits knowledge_source.sync.completed.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the knowledge:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/knowledge-bases/kb_.../sources/ksrc_.../sync" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Parameters

NameInTypeRequiredDescription
knowledge_base_idpathKnowledgeBaseIdyesThe id of a Knowledge base: kb_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
source_idpathKnowledgeSourceIdyesThe id of a Source of a Knowledge base: ksrc_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Responses

StatusContent typeShapeError codes
202application/jsonIngestionRun
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeknowledge_base_archived, idempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 202 answer

The shape is IngestionRun.

FieldTypeRequiredDescription
causeIngestionCauseyes
countsIngestionCountsyes
created_atTimestampyes
error_codesarray of IngestionErrorCodeyesThe distinct codes of the run and of its failed Documents, in first-seen order.
finished_atTimestamp or nullyes
idIngestionRunIdyes
knowledge_base_idKnowledgeBaseIdyes
object"knowledge_ingestion_run"yes
source_idKnowledgeSourceIdyes
source_namestring or nullnoThe display name of the run's Source (1.54.0), null when it has none; a deleted Source keeps its name here. Absent from an api before 1.54.0.
started_atTimestamp or nullyes
statusIngestionRunStatusyes