task_id immediately, which you
then poll until ingestion completes.
Upload a Document
The default upload flow streams your file bytes straight from your client to Polyvia’s storage backend, then asks our API to register and parse it. This is a three-step flow that works for any file size — there is no practical upper limit.Step 1 — Get an upload URL
POST /api/v1/ingest/upload-url
No request body.
Short-lived signed URL for the storage backend. Expires in ~1 hour and
is single-use.
Step 2 — PUT the file to that URL
Stream the raw file bytes to the returnedupload_url. Set Content-Type
to the file’s MIME type.
Storage responds with the new object’s identifier:
Step 3 — Finalize the upload
POST /api/v1/ingest/finalize
application/json
The
storageId returned by storage in Step 2.MIME type of the uploaded file.
Display name. Defaults to “Untitled” if omitted.
Assign the document to a group on creation.
Response
Unique identifier for the uploaded document
Ingestion task identifier — use this to poll for status
Initial status: always
pendingExample
Upload Multiple Documents
For batches, run the direct-upload flow once per file. The official SDKs do this inclient.ingest.batch(...) — each file is uploaded and
finalized independently, so a failure on one file is isolated to that
entry instead of failing the whole batch.
Quick Multipart Upload (small files)
These multipart endpoints proxy file bytes through the API server,
which has a 4.5 MB total request-body limit. They exist as a
one-call convenience for small uploads. For any file size, prefer the
direct-upload flow above (or use an SDK, which does it for you).
POST /api/v1/ingest
multipart/form-data
The document to upload. See Supported File Formats below.
Display name in your workspace. Defaults to the filename.
Assign the document to a group on upload.
{document_id, task_id, status} shape as /finalize.
POST /api/v1/ingest/batch
multipart/form-data. Same fields as /ingest but files is repeated
per file and names is a comma-separated string aligned to files.
Returns {results: [...], errors: [...] | null}.
Check Ingestion Status
Poll a parse task started by either upload flow.Endpoint
GET /api/v1/ingest/{task_id}
Path Parameters
The task identifier returned by
/ingest/finalize (or the legacy multipart endpoints)Response
Task identifier
Document identifier
Processing status (see table below)
Error message if status is
failed, otherwise nullstatus value | Meaning |
|---|---|
pending | Queued, not yet started |
parsing | Being parsed and indexed |
completed | Ready to query |
failed | Parsing failed; see error field |
Example
cURL
Supported File Formats
| Category | Extensions |
|---|---|
| Documents | .pdf, .docx, .pptx |
| Text | .txt, .md (Markdown) |
| Images | .png, .jpg / .jpeg, .webp, .gif |
| Audio | .wav, .mp3, .m4a |
