Data Ingestion
Learn how to upload documents/text and manage your content
Upload Flow
How document/text processing works
POST /seeds
Upload file
Returns jobIds
Track progress
GET /seeds/job/{id}
Poll status
waiting / active
completed
failed
Async Processing
Extract Chunk Embed Store
POST /seeds
Upload your file or text
Returns jobIds
Use to track progress
GET /seeds/job/{id}
Poll until complete
waiting
done
failed
Async Processing:
Extract → Chunk → Embed → Store
Upload Files
PDF, Word, Excel, and more
const formData = new FormData();
formData.append('files', file);
formData.append('fileTypes', JSON.stringify(['pdf']));
formData.append('fileSources', JSON.stringify(['upload']));
formData.append('fileTitles', JSON.stringify(['Annual Report 2024']));
const response = await fetch(`${baseUrl}/seeds?${params}`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}` },
body: formData
});
const { jobIds } = await response.json();Supported File Types
| Type | Extensions | Value |
|---|---|---|
| Word | .doc, .docx | word |
| Excel | .xls, .xlsx | excel |
| PowerPoint | .ppt, .pptx | ppt |
| Text | .txt | text |
| Markdown | .md | markdown |
| CSV | .csv | csv |
| JSON | .json | json |
| Image | .png, .jpg | image |
Upload Text Content
const formData = new FormData();
formData.append('text', JSON.stringify(['This is my document content...']));
formData.append('textTypes', JSON.stringify(['text']));
formData.append('textSources', JSON.stringify(['upload']));
formData.append('textTitles', JSON.stringify(['My Notes']));
const response = await fetch(`${baseUrl}/seeds?${params}`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}` },
body: formData
});Check Processing Status
Poll until processing is complete
async function waitForProcessing(jobId: string): Promise<string> {
while (true) {
const response = await fetch(
`${baseUrl}/seeds/job/${jobId}?${params}`,
{ headers }
);
const status = await response.json();
if (status.state === 'completed') return status.seedId;
if (status.state === 'failed') throw new Error(status.error);
await new Promise(resolve => setTimeout(resolve, 2000));
}
}Organize with Bundles
// Add during upload
formData.append('bundleIds', JSON.stringify(['bundle-123']));
// Or add after upload
await fetch(`${baseUrl}/bundles/${bundleId}/seeds?${params}`, {
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify({ seedIds: ['seed-1', 'seed-2'] })
});