curl --request POST \
--url https://api.avidoai.com/v0/documents/upload-markdown-batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-application-id: <api-key>' \
--data '
{
"importName": "Knowledge Base v2",
"batchId": "456e7890-e89b-12d3-a456-426614174001",
"batchIndex": 0,
"totalBatches": 25,
"totalFiles": 5000,
"documents": [
{
"fileName": "getting-started/login.md",
"title": "Inloggen Internet Bankieren - ABN AMRO",
"content": "<string>",
"language": "english",
"tags": [
"auth",
"self-service"
],
"metadata": {
"url": "https://example.com/page",
"sourceFileName": "login.md"
}
}
],
"documentType": "KNOWLEDGE",
"quickstartId": "456e7890-e89b-12d3-a456-426614174001",
"topicId": "789e0123-e89b-12d3-a456-426614174002",
"metadata": {
"step": "KNOWLEDGE_BASE_REVIEW"
}
}
'import requests
url = "https://api.avidoai.com/v0/documents/upload-markdown-batch"
payload = {
"importName": "Knowledge Base v2",
"batchId": "456e7890-e89b-12d3-a456-426614174001",
"batchIndex": 0,
"totalBatches": 25,
"totalFiles": 5000,
"documents": [
{
"fileName": "getting-started/login.md",
"title": "Inloggen Internet Bankieren - ABN AMRO",
"content": "<string>",
"language": "english",
"tags": ["auth", "self-service"],
"metadata": {
"url": "https://example.com/page",
"sourceFileName": "login.md"
}
}
],
"documentType": "KNOWLEDGE",
"quickstartId": "456e7890-e89b-12d3-a456-426614174001",
"topicId": "789e0123-e89b-12d3-a456-426614174002",
"metadata": { "step": "KNOWLEDGE_BASE_REVIEW" }
}
headers = {
"x-api-key": "<api-key>",
"x-application-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-application-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
importName: 'Knowledge Base v2',
batchId: '456e7890-e89b-12d3-a456-426614174001',
batchIndex: 0,
totalBatches: 25,
totalFiles: 5000,
documents: [
{
fileName: 'getting-started/login.md',
title: 'Inloggen Internet Bankieren - ABN AMRO',
content: '<string>',
language: 'english',
tags: ['auth', 'self-service'],
metadata: {url: 'https://example.com/page', sourceFileName: 'login.md'}
}
],
documentType: 'KNOWLEDGE',
quickstartId: '456e7890-e89b-12d3-a456-426614174001',
topicId: '789e0123-e89b-12d3-a456-426614174002',
metadata: {step: 'KNOWLEDGE_BASE_REVIEW'}
})
};
fetch('https://api.avidoai.com/v0/documents/upload-markdown-batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avidoai.com/v0/documents/upload-markdown-batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'importName' => 'Knowledge Base v2',
'batchId' => '456e7890-e89b-12d3-a456-426614174001',
'batchIndex' => 0,
'totalBatches' => 25,
'totalFiles' => 5000,
'documents' => [
[
'fileName' => 'getting-started/login.md',
'title' => 'Inloggen Internet Bankieren - ABN AMRO',
'content' => '<string>',
'language' => 'english',
'tags' => [
'auth',
'self-service'
],
'metadata' => [
'url' => 'https://example.com/page',
'sourceFileName' => 'login.md'
]
]
],
'documentType' => 'KNOWLEDGE',
'quickstartId' => '456e7890-e89b-12d3-a456-426614174001',
'topicId' => '789e0123-e89b-12d3-a456-426614174002',
'metadata' => [
'step' => 'KNOWLEDGE_BASE_REVIEW'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-application-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.avidoai.com/v0/documents/upload-markdown-batch"
payload := strings.NewReader("{\n \"importName\": \"Knowledge Base v2\",\n \"batchId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"batchIndex\": 0,\n \"totalBatches\": 25,\n \"totalFiles\": 5000,\n \"documents\": [\n {\n \"fileName\": \"getting-started/login.md\",\n \"title\": \"Inloggen Internet Bankieren - ABN AMRO\",\n \"content\": \"<string>\",\n \"language\": \"english\",\n \"tags\": [\n \"auth\",\n \"self-service\"\n ],\n \"metadata\": {\n \"url\": \"https://example.com/page\",\n \"sourceFileName\": \"login.md\"\n }\n }\n ],\n \"documentType\": \"KNOWLEDGE\",\n \"quickstartId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"topicId\": \"789e0123-e89b-12d3-a456-426614174002\",\n \"metadata\": {\n \"step\": \"KNOWLEDGE_BASE_REVIEW\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-application-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.avidoai.com/v0/documents/upload-markdown-batch")
.header("x-api-key", "<api-key>")
.header("x-application-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"importName\": \"Knowledge Base v2\",\n \"batchId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"batchIndex\": 0,\n \"totalBatches\": 25,\n \"totalFiles\": 5000,\n \"documents\": [\n {\n \"fileName\": \"getting-started/login.md\",\n \"title\": \"Inloggen Internet Bankieren - ABN AMRO\",\n \"content\": \"<string>\",\n \"language\": \"english\",\n \"tags\": [\n \"auth\",\n \"self-service\"\n ],\n \"metadata\": {\n \"url\": \"https://example.com/page\",\n \"sourceFileName\": \"login.md\"\n }\n }\n ],\n \"documentType\": \"KNOWLEDGE\",\n \"quickstartId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"topicId\": \"789e0123-e89b-12d3-a456-426614174002\",\n \"metadata\": {\n \"step\": \"KNOWLEDGE_BASE_REVIEW\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avidoai.com/v0/documents/upload-markdown-batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-application-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"importName\": \"Knowledge Base v2\",\n \"batchId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"batchIndex\": 0,\n \"totalBatches\": 25,\n \"totalFiles\": 5000,\n \"documents\": [\n {\n \"fileName\": \"getting-started/login.md\",\n \"title\": \"Inloggen Internet Bankieren - ABN AMRO\",\n \"content\": \"<string>\",\n \"language\": \"english\",\n \"tags\": [\n \"auth\",\n \"self-service\"\n ],\n \"metadata\": {\n \"url\": \"https://example.com/page\",\n \"sourceFileName\": \"login.md\"\n }\n }\n ],\n \"documentType\": \"KNOWLEDGE\",\n \"quickstartId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"topicId\": \"789e0123-e89b-12d3-a456-426614174002\",\n \"metadata\": {\n \"step\": \"KNOWLEDGE_BASE_REVIEW\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Invalid request data",
"issues": [
{
"code": "invalid_string",
"message": "Invalid UUID",
"path": [
"id"
]
}
]
}{
"message": "Resource not found"
}Upload a batch of markdown documents
Uploads a batch of pre-parsed markdown documents from a folder upload. Documents are processed asynchronously via a background job.
curl --request POST \
--url https://api.avidoai.com/v0/documents/upload-markdown-batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-application-id: <api-key>' \
--data '
{
"importName": "Knowledge Base v2",
"batchId": "456e7890-e89b-12d3-a456-426614174001",
"batchIndex": 0,
"totalBatches": 25,
"totalFiles": 5000,
"documents": [
{
"fileName": "getting-started/login.md",
"title": "Inloggen Internet Bankieren - ABN AMRO",
"content": "<string>",
"language": "english",
"tags": [
"auth",
"self-service"
],
"metadata": {
"url": "https://example.com/page",
"sourceFileName": "login.md"
}
}
],
"documentType": "KNOWLEDGE",
"quickstartId": "456e7890-e89b-12d3-a456-426614174001",
"topicId": "789e0123-e89b-12d3-a456-426614174002",
"metadata": {
"step": "KNOWLEDGE_BASE_REVIEW"
}
}
'import requests
url = "https://api.avidoai.com/v0/documents/upload-markdown-batch"
payload = {
"importName": "Knowledge Base v2",
"batchId": "456e7890-e89b-12d3-a456-426614174001",
"batchIndex": 0,
"totalBatches": 25,
"totalFiles": 5000,
"documents": [
{
"fileName": "getting-started/login.md",
"title": "Inloggen Internet Bankieren - ABN AMRO",
"content": "<string>",
"language": "english",
"tags": ["auth", "self-service"],
"metadata": {
"url": "https://example.com/page",
"sourceFileName": "login.md"
}
}
],
"documentType": "KNOWLEDGE",
"quickstartId": "456e7890-e89b-12d3-a456-426614174001",
"topicId": "789e0123-e89b-12d3-a456-426614174002",
"metadata": { "step": "KNOWLEDGE_BASE_REVIEW" }
}
headers = {
"x-api-key": "<api-key>",
"x-application-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-application-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
importName: 'Knowledge Base v2',
batchId: '456e7890-e89b-12d3-a456-426614174001',
batchIndex: 0,
totalBatches: 25,
totalFiles: 5000,
documents: [
{
fileName: 'getting-started/login.md',
title: 'Inloggen Internet Bankieren - ABN AMRO',
content: '<string>',
language: 'english',
tags: ['auth', 'self-service'],
metadata: {url: 'https://example.com/page', sourceFileName: 'login.md'}
}
],
documentType: 'KNOWLEDGE',
quickstartId: '456e7890-e89b-12d3-a456-426614174001',
topicId: '789e0123-e89b-12d3-a456-426614174002',
metadata: {step: 'KNOWLEDGE_BASE_REVIEW'}
})
};
fetch('https://api.avidoai.com/v0/documents/upload-markdown-batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avidoai.com/v0/documents/upload-markdown-batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'importName' => 'Knowledge Base v2',
'batchId' => '456e7890-e89b-12d3-a456-426614174001',
'batchIndex' => 0,
'totalBatches' => 25,
'totalFiles' => 5000,
'documents' => [
[
'fileName' => 'getting-started/login.md',
'title' => 'Inloggen Internet Bankieren - ABN AMRO',
'content' => '<string>',
'language' => 'english',
'tags' => [
'auth',
'self-service'
],
'metadata' => [
'url' => 'https://example.com/page',
'sourceFileName' => 'login.md'
]
]
],
'documentType' => 'KNOWLEDGE',
'quickstartId' => '456e7890-e89b-12d3-a456-426614174001',
'topicId' => '789e0123-e89b-12d3-a456-426614174002',
'metadata' => [
'step' => 'KNOWLEDGE_BASE_REVIEW'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-application-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.avidoai.com/v0/documents/upload-markdown-batch"
payload := strings.NewReader("{\n \"importName\": \"Knowledge Base v2\",\n \"batchId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"batchIndex\": 0,\n \"totalBatches\": 25,\n \"totalFiles\": 5000,\n \"documents\": [\n {\n \"fileName\": \"getting-started/login.md\",\n \"title\": \"Inloggen Internet Bankieren - ABN AMRO\",\n \"content\": \"<string>\",\n \"language\": \"english\",\n \"tags\": [\n \"auth\",\n \"self-service\"\n ],\n \"metadata\": {\n \"url\": \"https://example.com/page\",\n \"sourceFileName\": \"login.md\"\n }\n }\n ],\n \"documentType\": \"KNOWLEDGE\",\n \"quickstartId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"topicId\": \"789e0123-e89b-12d3-a456-426614174002\",\n \"metadata\": {\n \"step\": \"KNOWLEDGE_BASE_REVIEW\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-application-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.avidoai.com/v0/documents/upload-markdown-batch")
.header("x-api-key", "<api-key>")
.header("x-application-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"importName\": \"Knowledge Base v2\",\n \"batchId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"batchIndex\": 0,\n \"totalBatches\": 25,\n \"totalFiles\": 5000,\n \"documents\": [\n {\n \"fileName\": \"getting-started/login.md\",\n \"title\": \"Inloggen Internet Bankieren - ABN AMRO\",\n \"content\": \"<string>\",\n \"language\": \"english\",\n \"tags\": [\n \"auth\",\n \"self-service\"\n ],\n \"metadata\": {\n \"url\": \"https://example.com/page\",\n \"sourceFileName\": \"login.md\"\n }\n }\n ],\n \"documentType\": \"KNOWLEDGE\",\n \"quickstartId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"topicId\": \"789e0123-e89b-12d3-a456-426614174002\",\n \"metadata\": {\n \"step\": \"KNOWLEDGE_BASE_REVIEW\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avidoai.com/v0/documents/upload-markdown-batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-application-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"importName\": \"Knowledge Base v2\",\n \"batchId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"batchIndex\": 0,\n \"totalBatches\": 25,\n \"totalFiles\": 5000,\n \"documents\": [\n {\n \"fileName\": \"getting-started/login.md\",\n \"title\": \"Inloggen Internet Bankieren - ABN AMRO\",\n \"content\": \"<string>\",\n \"language\": \"english\",\n \"tags\": [\n \"auth\",\n \"self-service\"\n ],\n \"metadata\": {\n \"url\": \"https://example.com/page\",\n \"sourceFileName\": \"login.md\"\n }\n }\n ],\n \"documentType\": \"KNOWLEDGE\",\n \"quickstartId\": \"456e7890-e89b-12d3-a456-426614174001\",\n \"topicId\": \"789e0123-e89b-12d3-a456-426614174002\",\n \"metadata\": {\n \"step\": \"KNOWLEDGE_BASE_REVIEW\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Invalid request data",
"issues": [
{
"code": "invalid_string",
"message": "Invalid UUID",
"path": [
"id"
]
}
]
}{
"message": "Resource not found"
}Authorizations
Your unique Avido API key
Your unique Avido Application ID
Body
Request for uploading a batch of pre-parsed markdown documents.
User-provided name for this import.
1 - 256"Knowledge Base v2"
Client-generated ID grouping batches from one folder upload.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"456e7890-e89b-12d3-a456-426614174001"
Zero-based index of this batch within the upload.
0 <= x <= 90071992547409910
Total number of batches in this upload.
1 <= x <= 900719925474099125
Total number of files across all batches.
1 <= x <= 100005000
Array of pre-parsed markdown documents.
1 - 200 elementsShow child attributes
Show child attributes
Type of the documents being uploaded. Defaults to KNOWLEDGE.
KNOWLEDGE, POLICY "KNOWLEDGE"
ID of the quickstart this upload belongs to.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"456e7890-e89b-12d3-a456-426614174001"
ID of the topic to associate uploaded documents with.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"789e0123-e89b-12d3-a456-426614174002"
Optional extra metadata persisted onto the FileProcessing row and forwarded to the processor. Used to flag uploads that should hand off to the KB-review classification orchestrator ({ step: "KNOWLEDGE_BASE_REVIEW" }).
Show child attributes
Show child attributes
{ "step": "KNOWLEDGE_BASE_REVIEW" }
Response
Batch uploaded and queued for processing successfully