Skip to main content
The Ingest API handles document uploads and file management for the Polyvia knowledge base.

Upload Document

Upload a file to be processed through the Polyvia pipeline.

Endpoint

POST /api/ingest

Request Body

file
file
required
The file to upload. Supported formats: PDF, DOCX, PPTX, MP3, MP4, WAV
name
string
required
Display name for the document
metadata
object
Optional metadata to attach to the document

Response

document_id
string
required
Unique identifier for the uploaded document
name
string
Document display name
status
string
Current processing status: pending, processing, completed, failed
file_url
string
Secure URL to access the uploaded file
created_at
timestamp
ISO 8601 timestamp of when the document was uploaded

Example

curl -X POST https://api.polyvia.ai/api/ingest \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@/path/to/document.pdf" \
  -F "name=Q4 Financial Report" \
  -F 'metadata={"tags":["finance","quarterly"],"author":"Finance Team"}'
{
  "document_id": "doc_abc123xyz",
  "name": "Q4 Financial Report",
  "status": "pending",
  "file_url": "https://storage.polyvia.ai/files/doc_abc123xyz.pdf",
  "created_at": "2024-01-27T10:30:00Z"
}

Get Document Status

Retrieve the current status and metadata of an uploaded document.

Endpoint

GET /api/ingest/{document_id}

Path Parameters

document_id
string
required
The document identifier returned from the upload endpoint

Response

document_id
string
Document identifier
name
string
Document display name
status
string
Processing status: pending, processing, completed, failed
file_url
string
URL to access the file
metadata
object
Document metadata
error
string | null
Error message if status is failed

Example

curl https://api.polyvia.ai/api/ingest/doc_abc123xyz \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "document_id": "doc_abc123xyz",
  "name": "Q4 Financial Report",
  "status": "completed",
  "file_url": "https://storage.polyvia.ai/files/doc_abc123xyz.pdf",
  "metadata": {
    "tags": ["finance", "quarterly"],
    "author": "Finance Team"
  },
  "created_at": "2024-01-27T10:30:00Z",
  "error": null
}

Supported File Formats

Documents

  • PDF (.pdf)
  • Word (.docx, .doc)
  • PowerPoint (.pptx, .ppt)

Media

  • Audio (.mp3, .wav, .m4a)
  • Video (.mp4, .mov, .avi)
Maximum file size: 100 MB per file. Contact support for larger file processing.

Rate Limits

  • Free tier: 10 uploads per day
  • Pro tier: 100 uploads per day
  • Enterprise: Custom limits
Use batch processing for multiple documents to optimize your quota usage.