Create Document
curl --request POST \
--url https://{api-address}.org.machina.gg/document \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data @- <<EOF
{
"embed-vector": false,
"metadata": {
"agent_id": "123"
},
"name": "New test document",
"value": {
"chat": [
"What is Lorem Ipsum?",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
]
}
}
EOFimport requests
url = "https://{api-address}.org.machina.gg/document"
payload = {
"embed-vector": False,
"metadata": { "agent_id": "123" },
"name": "New test document",
"value": { "chat": ["What is Lorem Ipsum?", "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.", " It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."] }
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
'embed-vector': false,
metadata: {agent_id: '123'},
name: 'New test document',
value: {
chat: [
'What is Lorem Ipsum?',
'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
' It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'
]
}
})
};
fetch('https://{api-address}.org.machina.gg/document', 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-address}.org.machina.gg/document",
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([
'embed-vector' => false,
'metadata' => [
'agent_id' => '123'
],
'name' => 'New test document',
'value' => [
'chat' => [
'What is Lorem Ipsum?',
'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
' It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <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-address}.org.machina.gg/document"
payload := strings.NewReader("{\n \"embed-vector\": false,\n \"metadata\": {\n \"agent_id\": \"123\"\n },\n \"name\": \"New test document\",\n \"value\": {\n \"chat\": [\n \"What is Lorem Ipsum?\",\n \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\",\n \" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<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-address}.org.machina.gg/document")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"embed-vector\": false,\n \"metadata\": {\n \"agent_id\": \"123\"\n },\n \"name\": \"New test document\",\n \"value\": {\n \"chat\": [\n \"What is Lorem Ipsum?\",\n \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\",\n \" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api-address}.org.machina.gg/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"embed-vector\": false,\n \"metadata\": {\n \"agent_id\": \"123\"\n },\n \"name\": \"New test document\",\n \"value\": {\n \"chat\": [\n \"What is Lorem Ipsum?\",\n \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\",\n \" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"_id": "67e1fc8c2a5ade8c69c03fe7",
"created": "Tue, 25 Mar 2025 00:45:00 GMT",
"embed-vector": false,
"id": "67e1fc8c2a5ade8c69c03fe7",
"metadata": {
"agent_id": "123"
},
"name": "New test document",
"status": null,
"updated": "Tue, 25 Mar 2025 00:45:00 GMT",
"value": {
"chat": [
"What is Lorem Ipsum?",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
]
}
},
"message": "document saved",
"status": true
}Documents
Create Document
Create a new document and configure metadata and properties.
POST
/
document
Create Document
curl --request POST \
--url https://{api-address}.org.machina.gg/document \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data @- <<EOF
{
"embed-vector": false,
"metadata": {
"agent_id": "123"
},
"name": "New test document",
"value": {
"chat": [
"What is Lorem Ipsum?",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
]
}
}
EOFimport requests
url = "https://{api-address}.org.machina.gg/document"
payload = {
"embed-vector": False,
"metadata": { "agent_id": "123" },
"name": "New test document",
"value": { "chat": ["What is Lorem Ipsum?", "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.", " It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."] }
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
'embed-vector': false,
metadata: {agent_id: '123'},
name: 'New test document',
value: {
chat: [
'What is Lorem Ipsum?',
'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
' It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'
]
}
})
};
fetch('https://{api-address}.org.machina.gg/document', 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-address}.org.machina.gg/document",
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([
'embed-vector' => false,
'metadata' => [
'agent_id' => '123'
],
'name' => 'New test document',
'value' => [
'chat' => [
'What is Lorem Ipsum?',
'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
' It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <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-address}.org.machina.gg/document"
payload := strings.NewReader("{\n \"embed-vector\": false,\n \"metadata\": {\n \"agent_id\": \"123\"\n },\n \"name\": \"New test document\",\n \"value\": {\n \"chat\": [\n \"What is Lorem Ipsum?\",\n \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\",\n \" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<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-address}.org.machina.gg/document")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"embed-vector\": false,\n \"metadata\": {\n \"agent_id\": \"123\"\n },\n \"name\": \"New test document\",\n \"value\": {\n \"chat\": [\n \"What is Lorem Ipsum?\",\n \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\",\n \" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api-address}.org.machina.gg/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"embed-vector\": false,\n \"metadata\": {\n \"agent_id\": \"123\"\n },\n \"name\": \"New test document\",\n \"value\": {\n \"chat\": [\n \"What is Lorem Ipsum?\",\n \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\",\n \" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"_id": "67e1fc8c2a5ade8c69c03fe7",
"created": "Tue, 25 Mar 2025 00:45:00 GMT",
"embed-vector": false,
"id": "67e1fc8c2a5ade8c69c03fe7",
"metadata": {
"agent_id": "123"
},
"name": "New test document",
"status": null,
"updated": "Tue, 25 Mar 2025 00:45:00 GMT",
"value": {
"chat": [
"What is Lorem Ipsum?",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
" It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
]
}
},
"message": "document saved",
"status": true
}Authorizations
API key authentication
Body
application/json
Unique identifier for the document
The main data of the document, can be any type (string, object, array, etc.)
Additional metadata for the document
Current status of the document
Available options:
active, draft, archived Whether to create a vector embedding for the document
⌘I

