documents
Create Document Handler
Create a new document with initial v0 version.
The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
POST
/
v1
/
documents
Create Document Handler
curl --request POST \
--url http://localhost:8000/v1/documents \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"parent_path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "http://localhost:8000/v1/documents"
payload = {
"name": "<string>",
"parent_path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', parent_path_part_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('http://localhost:8000/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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/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>',
'parent_path_part_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:8000/v1/documents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"parent_path_part_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8000/v1/documents")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"parent_path_part_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/documents")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"parent_path_part_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"part_type": "DOCUMENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"parent_path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_type": "PDF",
"document_origin": "SOURCE",
"active_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"name": "<string>",
"parent_path_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"materialized_path": "<string>",
"system_managed": true,
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_s3_url": "<string>",
"fast_plaintext_url": "<string>",
"system_metadata": {
"source_s3": "<string>",
"cleaned_source_s3": "<string>",
"fast_plaintext_s3": "<string>",
"hash": "<string>",
"pipeline_state": {
"status": "pending",
"last_run_timestamp": "2023-11-07T05:31:56Z",
"last_state_update_timestamp": "2023-11-07T05:31:56Z",
"last_activity": "<string>",
"error": "<string>",
"temporal_workflow_id": "<string>",
"chunks_processed": 123,
"page_dpi": 123,
"ingestion_mode": "high_accuracy",
"chunk_type": "TEXT"
},
"total_pages": 123,
"total_sections": 123,
"total_chunks": 123,
"total_formulas": 123,
"xlsx_parse_result_s3": "<string>",
"xlsx_named_ranges": [
{}
],
"xlsx_kpi_catalog": [
{}
],
"information_statistics": {
"num_chunks_by_type": {},
"total_tokens": 0,
"num_direct_children": 0,
"children_depth": 0
}
}
},
"materialized_path": "<string>",
"system_managed": true,
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"color": "<string>",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Cookies
Body
application/json
Request to create a new document.
Document name
Required string length:
1 - 255Parent PathPart ID (must be a FOLDER type)
Type of document (PDF, UNKNOWN, etc.)
Available options:
PDF, DOCX, PLAINTEXT, IMAGE, XLSX, CSV, PPTX, UNKNOWN Origin of document (SOURCE, GENERATED)
Available options:
SOURCE, GENERATED Response
Successful Response
Document response model.
Path part type
Available options:
DOCUMENT Document ID
PathPart ID
Document name
Parent PathPart ID
Type of document
Available options:
PDF, DOCX, PLAINTEXT, IMAGE, XLSX, CSV, PPTX, UNKNOWN Origin of document
Available options:
SOURCE, GENERATED Active version ID
Active version details
Show child attributes
Show child attributes
Full materialized path from root
Whether this document is system-managed
Tenant ID
Creation timestamp
Last update timestamp
Tags attached to this document
Show child attributes
Show child attributes
⌘I
Create Document Handler
curl --request POST \
--url http://localhost:8000/v1/documents \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"parent_path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "http://localhost:8000/v1/documents"
payload = {
"name": "<string>",
"parent_path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', parent_path_part_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('http://localhost:8000/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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/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>',
'parent_path_part_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:8000/v1/documents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"parent_path_part_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8000/v1/documents")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"parent_path_part_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/documents")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"parent_path_part_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"part_type": "DOCUMENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"parent_path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_type": "PDF",
"document_origin": "SOURCE",
"active_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"name": "<string>",
"parent_path_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"materialized_path": "<string>",
"system_managed": true,
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_s3_url": "<string>",
"fast_plaintext_url": "<string>",
"system_metadata": {
"source_s3": "<string>",
"cleaned_source_s3": "<string>",
"fast_plaintext_s3": "<string>",
"hash": "<string>",
"pipeline_state": {
"status": "pending",
"last_run_timestamp": "2023-11-07T05:31:56Z",
"last_state_update_timestamp": "2023-11-07T05:31:56Z",
"last_activity": "<string>",
"error": "<string>",
"temporal_workflow_id": "<string>",
"chunks_processed": 123,
"page_dpi": 123,
"ingestion_mode": "high_accuracy",
"chunk_type": "TEXT"
},
"total_pages": 123,
"total_sections": 123,
"total_chunks": 123,
"total_formulas": 123,
"xlsx_parse_result_s3": "<string>",
"xlsx_named_ranges": [
{}
],
"xlsx_kpi_catalog": [
{}
],
"information_statistics": {
"num_chunks_by_type": {},
"total_tokens": 0,
"num_direct_children": 0,
"children_depth": 0
}
}
},
"materialized_path": "<string>",
"system_managed": true,
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"color": "<string>",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}