curl --request POST \
--url https://api.devic.ai/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"markdownContent": "<string>",
"projectId": "<string>",
"parentDocumentId": "<string>",
"folderId": "<string>"
}
'import requests
url = "https://api.devic.ai/v1/documents"
payload = {
"name": "<string>",
"markdownContent": "<string>",
"projectId": "<string>",
"parentDocumentId": "<string>",
"folderId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
markdownContent: '<string>',
projectId: '<string>',
parentDocumentId: '<string>',
folderId: '<string>'
})
};
fetch('https://api.devic.ai/v1/documents', 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.devic.ai/v1/documents",
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>',
'markdownContent' => '<string>',
'projectId' => '<string>',
'parentDocumentId' => '<string>',
'folderId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.devic.ai/v1/documents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"projectId\": \"<string>\",\n \"parentDocumentId\": \"<string>\",\n \"folderId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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.devic.ai/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"projectId\": \"<string>\",\n \"parentDocumentId\": \"<string>\",\n \"folderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"projectId\": \"<string>\",\n \"parentDocumentId\": \"<string>\",\n \"folderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"clientUID": "<string>",
"projectId": "<string>",
"name": "<string>",
"fileName": "<string>",
"fileType": "md",
"mimeType": "<string>",
"size": 123,
"status": "pending",
"markdownContent": "<string>",
"summary": "<string>",
"tokenCount": 123,
"currentVersion": 123,
"folderId": "<string>",
"parentDocumentId": "<string>",
"createdByUserUID": "<string>",
"creationTimestampMs": 123,
"lastEditTimestampMs": 123
}Create a markdown document
Creates a markdown document and indexes its content for RAG. Optionally scope it to a project and/or file it inside a folder.
curl --request POST \
--url https://api.devic.ai/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"markdownContent": "<string>",
"projectId": "<string>",
"parentDocumentId": "<string>",
"folderId": "<string>"
}
'import requests
url = "https://api.devic.ai/v1/documents"
payload = {
"name": "<string>",
"markdownContent": "<string>",
"projectId": "<string>",
"parentDocumentId": "<string>",
"folderId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
markdownContent: '<string>',
projectId: '<string>',
parentDocumentId: '<string>',
folderId: '<string>'
})
};
fetch('https://api.devic.ai/v1/documents', 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.devic.ai/v1/documents",
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>',
'markdownContent' => '<string>',
'projectId' => '<string>',
'parentDocumentId' => '<string>',
'folderId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.devic.ai/v1/documents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"projectId\": \"<string>\",\n \"parentDocumentId\": \"<string>\",\n \"folderId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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.devic.ai/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"projectId\": \"<string>\",\n \"parentDocumentId\": \"<string>\",\n \"folderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"projectId\": \"<string>\",\n \"parentDocumentId\": \"<string>\",\n \"folderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"clientUID": "<string>",
"projectId": "<string>",
"name": "<string>",
"fileName": "<string>",
"fileType": "md",
"mimeType": "<string>",
"size": 123,
"status": "pending",
"markdownContent": "<string>",
"summary": "<string>",
"tokenCount": 123,
"currentVersion": 123,
"folderId": "<string>",
"parentDocumentId": "<string>",
"createdByUserUID": "<string>",
"creationTimestampMs": 123,
"lastEditTimestampMs": 123
}Authorizations
Use JWT token for authentication
Body
Document name (without extension)
Markdown content to store and index for RAG
Optional project ID to scope the document
Optional parent document ID (for subdocuments referenced via @ mentions)
Optional folder ID to file the document
Response
Document created successfully
Document ID
Client UID
Project ID the document is scoped to
Document name
File name (with extension)
File type
md, pdf, txt, docx MIME type
File size in bytes
Processing / indexing status
pending, ready, failed Markdown content (for markdown documents)
Auto-generated summary
Token count
Current version number
Folder ID the document is filed in
Parent document ID (for subdocuments referenced via @ mentions)
UID of the user that created the document
Creation timestamp (ms)
Last edit timestamp (ms)