Create a Knowledge Base
curl --request POST \
--url https://api.getmalakai.com/knowledgebase \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'x-access-token: <x-access-token>' \
--data '
{
"name": "<string>",
"description": "<string>",
"files": [
"<string>"
],
"urls": [
"<string>"
]
}
'import requests
url = "https://api.getmalakai.com/knowledgebase"
payload = {
"name": "<string>",
"description": "<string>",
"files": ["<string>"],
"urls": ["<string>"]
}
headers = {
"Authorization": "<authorization>",
"x-access-token": "<x-access-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'x-access-token': '<x-access-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
files: ['<string>'],
urls: ['<string>']
})
};
fetch('https://api.getmalakai.com/knowledgebase', 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.getmalakai.com/knowledgebase",
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([
'name' => '<string>',
'description' => '<string>',
'files' => [
'<string>'
],
'urls' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"x-access-token: <x-access-token>"
],
]);
$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.getmalakai.com/knowledgebase"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"files\": [\n \"<string>\"\n ],\n \"urls\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-access-token", "<x-access-token>")
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.getmalakai.com/knowledgebase")
.header("Authorization", "<authorization>")
.header("x-access-token", "<x-access-token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"files\": [\n \"<string>\"\n ],\n \"urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmalakai.com/knowledgebase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["x-access-token"] = '<x-access-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"files\": [\n \"<string>\"\n ],\n \"urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"responseCode": 2000,
"message": "Knowledgebase created successfully",
"data": {
"name": "test",
"description": "description",
"files": [],
"urls": [
"https://en.wikipedia.org/wiki/Pakistan"
],
"user_id": "<hidden>",
"ml_file_id": null,
"id": "<hidden>",
"status": "pending",
"createdAt": "2025-07-29T10:44:05.242Z",
"updatedAt": "2025-07-29T10:44:05.242Z"
}
}
Knowledge Bases
Create a Knowledge Base
Create a knowledgebase from multiple files to use in your workflows
POST
knowledgebase
Create a Knowledge Base
curl --request POST \
--url https://api.getmalakai.com/knowledgebase \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'x-access-token: <x-access-token>' \
--data '
{
"name": "<string>",
"description": "<string>",
"files": [
"<string>"
],
"urls": [
"<string>"
]
}
'import requests
url = "https://api.getmalakai.com/knowledgebase"
payload = {
"name": "<string>",
"description": "<string>",
"files": ["<string>"],
"urls": ["<string>"]
}
headers = {
"Authorization": "<authorization>",
"x-access-token": "<x-access-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'x-access-token': '<x-access-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
files: ['<string>'],
urls: ['<string>']
})
};
fetch('https://api.getmalakai.com/knowledgebase', 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.getmalakai.com/knowledgebase",
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([
'name' => '<string>',
'description' => '<string>',
'files' => [
'<string>'
],
'urls' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"x-access-token: <x-access-token>"
],
]);
$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.getmalakai.com/knowledgebase"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"files\": [\n \"<string>\"\n ],\n \"urls\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-access-token", "<x-access-token>")
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.getmalakai.com/knowledgebase")
.header("Authorization", "<authorization>")
.header("x-access-token", "<x-access-token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"files\": [\n \"<string>\"\n ],\n \"urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmalakai.com/knowledgebase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["x-access-token"] = '<x-access-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"files\": [\n \"<string>\"\n ],\n \"urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"responseCode": 2000,
"message": "Knowledgebase created successfully",
"data": {
"name": "test",
"description": "description",
"files": [],
"urls": [
"https://en.wikipedia.org/wiki/Pakistan"
],
"user_id": "<hidden>",
"ml_file_id": null,
"id": "<hidden>",
"status": "pending",
"createdAt": "2025-07-29T10:44:05.242Z",
"updatedAt": "2025-07-29T10:44:05.242Z"
}
}
Headers
string
required
Your API key for authentication. Prefix with
Bearer .string
required
Your access token for authentication.
Body
string
required
The name of the knowledgebase to be created.
string
required
The description of the knowledgebase to be created.
string[]
required
An array of file urls that contain the information to be used in the knowledgebase
string[]
required
Array of web urls that have content to be used in the knowledgebase.
Request Example
{
"name": "test",
"description": "description",
"files": [],
"urls": [
"https://en.wikipedia.org/wiki/aboutWiki"
]
}
Response
string
Status of the request in the form of a short message.
object
Object containing the created knowledgebase.
{
"responseCode": 2000,
"message": "Knowledgebase created successfully",
"data": {
"name": "test",
"description": "description",
"files": [],
"urls": [
"https://en.wikipedia.org/wiki/Pakistan"
],
"user_id": "<hidden>",
"ml_file_id": null,
"id": "<hidden>",
"status": "pending",
"createdAt": "2025-07-29T10:44:05.242Z",
"updatedAt": "2025-07-29T10:44:05.242Z"
}
}
⌘I