documents
Ingest Document Handler
Upload a file, create document + version, and trigger ingestion workflow.
Returns 201 with the Temporal workflow ID.
POST
/
v1
/
documents
/
ingest
Ingest Document Handler
curl --request POST \
--url http://localhost:8000/v1/documents/ingest \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form path_part_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'name=<string>' \
--form page_dpi=72import requests
url = "http://localhost:8000/v1/documents/ingest"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"page_dpi": "72"
}
response = requests.post(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('path_part_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('name', '<string>');
form.append('page_dpi', '72');
const options = {method: 'POST'};
options.body = form;
fetch('http://localhost:8000/v1/documents/ingest', 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/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"path_part_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"page_dpi\"\r\n\r\n72\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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/ingest"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"path_part_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"page_dpi\"\r\n\r\n72\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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/ingest")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"path_part_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"page_dpi\"\r\n\r\n72\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/documents/ingest")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"path_part_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"page_dpi\"\r\n\r\n72\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"workflow_id": "<string>",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Cookies
Body
multipart/form-data
Parent path part ID (must be a FOLDER type)
Document name (defaults to filename)
Ingestion pipeline mode: 'high_accuracy' (default for PDF), 'standard' (default for DOCX/XLSX/PPTX/PLAINTEXT), or 'single_chunk' (default for IMAGE/CSV). Auto-resolved when omitted.
Available options:
high_accuracy, standard, single_chunk Force chunk type (TABLE/IMAGE/HTML). Only valid with single_chunk mode.
Available options:
TEXT, TABLE, IMAGE, HTML, UNKNOWN Force secondary taxonomy (e.g. 'picture', 'flowchart'). Only valid with single_chunk mode and chunk_type=IMAGE.
Available options:
picture, flowchart DPI for PDF page screenshots (default 72, min 36, max 216).
Required range:
36 <= x <= 216⌘I
Ingest Document Handler
curl --request POST \
--url http://localhost:8000/v1/documents/ingest \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form path_part_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'name=<string>' \
--form page_dpi=72import requests
url = "http://localhost:8000/v1/documents/ingest"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"page_dpi": "72"
}
response = requests.post(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('path_part_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('name', '<string>');
form.append('page_dpi', '72');
const options = {method: 'POST'};
options.body = form;
fetch('http://localhost:8000/v1/documents/ingest', 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/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"path_part_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"page_dpi\"\r\n\r\n72\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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/ingest"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"path_part_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"page_dpi\"\r\n\r\n72\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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/ingest")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"path_part_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"page_dpi\"\r\n\r\n72\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/documents/ingest")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"path_part_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"page_dpi\"\r\n\r\n72\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"workflow_id": "<string>",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}