Ingest documents (text, files, or mixed)
Unified document ingestion endpoint.
Accepts a multipart form with:
manifest(required): JSON array describing each itemfiles(optional): one or more file uploads, referenced byfile_indexin the manifest
Manifest format (JSON array):
[
{"type": "file", "file_index": 0, "title": "Report"},
{"type": "text", "title": "FAQ", "content": "What is..."},
{"type": "file", "file_index": 1, "title": "Old Report", "document_id": "uuid"}
]
POST
/
v1
/
knowledge-base
/
knowledge-bases
/
{kb_id}
/
ingest
Ingest documents (text, files, or mixed)
curl --request POST \
--url https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest \
--header 'x-api-key: <api-key>'import requests
url = "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/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_URL => "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <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"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ingestion_job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"manifest_index": 123,
"result": "queued",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"duplicate_of_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"duplicate_of_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"duplicate_of_document_title": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"retryable": true,
"retry_after": 123
}{
"error": "<string>",
"message": "<string>",
"retryable": true,
"retry_after": 123
}{
"error": "<string>",
"message": "<string>",
"retryable": true,
"retry_after": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Response
Successful Response
Response from the unified ingest endpoint.
ingestion_job_id is the parent IngestionJob for bulk submissions, or
the single-doc job for a 1-item manifest. items mirrors the manifest
order so callers can render per-item outcomes without a second call.
Was this page helpful?
⌘I
Ingest documents (text, files, or mixed)
curl --request POST \
--url https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest \
--header 'x-api-key: <api-key>'import requests
url = "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/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_URL => "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <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"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ingestion_job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"manifest_index": 123,
"result": "queued",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"duplicate_of_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"duplicate_of_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"duplicate_of_document_title": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"retryable": true,
"retry_after": 123
}{
"error": "<string>",
"message": "<string>",
"retryable": true,
"retry_after": 123
}{
"error": "<string>",
"message": "<string>",
"retryable": true,
"retry_after": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}