Skip to main content
Open Admin Menu > Knowledge Bases.
With the API Upload data source, external systems (e.g. a DMS, CMS or a custom integration) populate a knowledge base via HTTP calls. The source provides three endpoints: upload a document, query its processing status, and delete a document. Authentication uses a Bearer Token that is generated per source in the user interface. For an overview of all source types, see Knowledge Bases.

Prerequisites

  • A saved knowledge base with a source of type API Upload (only one such source is allowed per knowledge base).
  • The external system must be able to reach the VARIOS AI domain via HTTPS.

Endpoint and Bearer Token

VARIOS AI generates the Bearer Token as soon as you save the source with Create source. You find the endpoint and the token in the edit view of the source, in the Connection section: Use Create new token and confirm to replace the token, for example if it has fallen into the wrong hands.
Treat the Bearer Token like a password and only share it with the external system. After Create new token, the previous token becomes invalid immediately. Systems that upload with it receive errors until you enter the new token there.

Endpoints

The API endpoint shown in the user interface is the upload URL of the source. The source UUID ({source}) is part of the path; the status and delete endpoints use the same path with a different suffix. All endpoints respond with JSON and require the header Authorization: Bearer <token>.

Authentication

Every request must include the Bearer Token of the source:
Authentication failures return HTTP status 401 with the header WWW-Authenticate: Bearer. The JSON body names the cause in errorMessage. The following example shows a token mismatch:

External identifier

Each document is identified within the source by the externalIdentifier parameter. Use a stable, unique identifier from your system (e.g. the document ID in the source system). You use the same identifier later for the status query and for deletion.

Upload a document

POST /api/knowledgebase-source/{source}/upload
string
required
Unique identifier of the document in the external system. Each identifier may only be used once per source. An empty identifier is rejected. Can be passed as a query parameter or as a form field.
file
The file to upload (multipart/form-data). Required if no text is provided.
object
Text upload as JSON (application/json). Required if no file is provided.
The request must contain either a file in resource or a text object with non-empty text.content. If both a file and text are provided, the text is used.
The endpoint answers errors with "success": false and a matching HTTP status: Before saving, the API validates the document against the source configuration:
  • External identifier: If a document with the same identifier already exists in this source, the upload is rejected. Delete the document first if you want to replace it.
  • Content: If a document with identical content already exists in this source, the upload is rejected.
  • File extensions: The extension must be included in the source’s File Extensions setting. For text uploads this is always txt.
  • Maximum file size: The document must not exceed the Maximum file size (MB) setting.
  • Empty documents: Documents without content are rejected.
After a successful upload, the document appears in the source under Documents and is then processed and embedded – just like with all other source types.

Query the status

GET /api/knowledgebase-source/{source}/status
string
required
Identifier that was used for the upload.
cURL
Success
string
required
Processing status of the document for the embedding model of the knowledge base.
Poll the status after the upload at intervals until done or error is returned. On error, you can delete the document and upload a corrected version.

Delete a document

DELETE /api/knowledgebase-source/{source}/delete
string
required
Identifier that was used for the upload.
cURL
The document is removed from the source and is no longer available in the knowledge base. The same external identifier can then be used again for a new upload. If no document exists for the identifier, the endpoint responds with HTTP status 404. If another request with the same identifier is still running, it responds with 409.

Example: Update a document

The API has no dedicated update endpoint. To ingest a changed document, combine delete and upload with the same identifier:
1

Delete the old document

DELETE .../delete?externalIdentifier=doc-4711
2

Upload the new version

POST .../upload?externalIdentifier=doc-4711 with the new file or text.
3

Check the status

GET .../status?externalIdentifier=doc-4711 until done is returned.

Common Errors and Solutions