Overview
Add documents to your Wolfia knowledge base programmatically. The upload flow has three steps: prepare the upload, upload the files using the returned URLs, and confirm to start processing.How it works
Prepare upload
URL:POST https://api.wolfia.com/v1/content-source/prepare-upload
Authentication: API key required (see API overview for setup)
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
files | array | Yes | Array of file metadata objects |
files[].name | string | Yes | Filename including extension |
files[].size | integer | Yes | File size in bytes |
files[].type | string | Yes | MIME type |
files[].last_modified | integer | Yes | Last modified timestamp (Unix seconds) |
files[].context | string | No | Description to help AI understand the document |
files[].is_public_override | boolean | No | Set true to make the document publicly visible |
files[].tag_ids | array of UUIDs | No | Tags to associate with the file |
Supported file types
| Extension | MIME type (files[].type) |
|---|---|
.pdf | application/pdf |
.docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
.doc | application/msword |
.md | text/markdown |
.pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation |
.xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
.xlsm | application/vnd.ms-excel.sheet.macroenabled.12 |
.xls | application/vnd.ms-excel |
.csv | text/csv |
.txt | text/plain |
.json | application/json |
.html | text/html |
.png | image/png |
.jpg | image/jpeg |
.webp | image/webp |
.gif | image/gif |
.eml | message/rfc822 |
Response (200 OK)
Returns an upload URL and form fields for each file. Use these to upload the file content directly.| Field | Type | Description |
|---|---|---|
upload_urls[].source_id | string (UUID) | ID to use in the confirm step |
upload_urls[].upload_url | string | URL to POST the file to |
upload_urls[].fields | object | Form fields to include with the file upload |
Upload files
Use theupload_url and fields from the prepare response. Include all fields as form fields, then append the file as the last field.
Confirm upload
URL:POST https://api.wolfia.com/v1/content-source/confirm-upload
Authentication: API key required (see API overview for setup)
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
source_ids | array of strings | Yes | Source IDs from the prepare step |
Response (200 OK)
Integration example
Python: Upload a directory of documents
Error responses
| Status Code | What it means | How to fix |
|---|---|---|
| 400 | No files provided or no valid files confirmed | Check your request body has a non-empty files array (prepare) or valid source_ids (confirm) |
| 403 | Insufficient permissions | API key owner needs Expert or Admin role |
| 422 | Invalid request parameters | Check required fields and data types |
| 500 | Internal error | Retry with exponential backoff |
Best practices
Batch files in a single request
Batch files in a single request
Send multiple files in one prepare call to reduce round trips.
Handle partial failures
Handle partial failures
If some files fail during upload, confirm only the successful ones. The confirm endpoint processes each ID independently.
Add context for better results
Add context for better results
Use the
context field to describe what the document covers. This helps Wolfia extract more relevant knowledge.Getting help
- Check permissions: API key owner needs Expert or Admin role
- Verify file types: Use a supported extension and correct MIME type
- Contact support: Email [email protected]

