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.
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: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 theexternalIdentifier 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.resource or a text object with non-empty text.content. If both a file and text are provided, the text is used.
"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.
Delete a document
DELETE /api/knowledgebase-source/{source}/delete
string
required
Identifier that was used for the upload.
cURL
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-47112
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.