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

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.

Query parameters

documentsenum<string>#

cascade also deletes the documents the source produced. keep keeps them: they are hidden while the deletion job runs and come back when it completes, with source_id set to null and no longer refreshed.

Before deleting with keep, save the IDs of files with this source_id from List Document Files: their source_id becomes null once the deletion completes.

Default: "cascade"

Options:cascadekeep

Headers

Idempotency-Keystringrequired#
Repeating the same key and request with the same API key returns the original job with 202. Reusing the key for a different request, or from another API key, answers 409. Use printable ASCII characters without leading or trailing whitespace.

Length: 8–255

Body

application/json
expectedRevisionintegerrequired#
The source's current version from List Sources or Get Source. A stale value answers 409 and nothing changes.

Range: >= 1

Responses

application/json

Deletion accepted. job describes the background deletion.

Get Source answers 404 from the moment the deletion is accepted. To confirm that it finished, poll Get Deletion Job (the status_url) until run_state is completed or failed.

document_titlestring#
Always null for source deletions.
jobobject#
The deletion job. target_type is source, and mode echoes documents.
status_urlstring#
URL of the deletion job in this API: absolute when the deployment sets SERVICE_API_URL, otherwise a path that starts with /v1/. The same value is sent in the Location response header.