File Upload API
The File Upload API is the entry point for supplying supporting files (PowerPoint, PDF, images, etc.) to downstream jobs such as AutoGenerator and Template Converter.
Two endpoints cover the upload patterns:
POST /api/v1/preprocess— chunked upload.POST /api/v1/validate— validate previously uploaded files and/or web links.
Full schemas and try-it-out forms live in the interactive API Reference.
Authentication
All endpoints require a Bearer token:
Authorization: Bearer YOUR_API_KEY
See Getting Started → Authentication.
Response envelope
Every endpoint returns the canonical envelope: { "success": true, "data": { ... } }
on success or the standard
error envelope on error.
Endpoint summary
| Method | Path | Description | Sync/Async |
|---|---|---|---|
POST | /api/v1/preprocess | Preprocess a file in chunks | Sync |
POST | /api/v1/validate | Validate uploaded files and/or web links | Sync |
All endpoints are in the auto_generator rate-limit category. See
Developer Guide → Usage quotas and rate limits.
POST /api/v1/preprocess — Chunked upload
Accepts one chunk of a multi-chunk file upload. The caller drives
chunking via chunkIndex and totalChunks; chunks for the same upload
share a requestIdentifier. Once all chunks for a requestIdentifier
arrive, the file is assembled and made available to downstream
operations.
A parallel chunked-upload endpoint exists for Template Converter
specifically (POST /api/v1/template-converter/preprocess) and uses
the same request shape; only .pptx files are accepted there.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
fileContent | string | yes | Chunk content as base64 / data: URL. |
fileName | string | yes | Original filename including extension. |
chunkIndex | integer ≥ 0 | yes | Zero-based index of this chunk. |
totalChunks | integer ≥ 1 | yes | Total number of chunks for this upload. |
requestIdentifier | string | yes | Caller-supplied identifier that groups chunks of the same upload. |
Example (one chunk)
- cURL
- Node.js
- Python
curl -X POST https://api.prezent.ai/api/v1/preprocess \
-H "Authorization: Bearer $PREZENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileName": "big-deck.pptx",
"fileContent": "UEsDBBQAAAAIAA...",
"chunkIndex": 0,
"totalChunks": 4,
"requestIdentifier": "upload-2026-05-18-001"
}'
const axios = require('axios');
const preprocessChunk = async () => {
const { data } = await axios.post(
'https://api.prezent.ai/api/v1/preprocess',
{
fileName: 'big-deck.pptx',
fileContent: 'UEsDBBQAAAAIAA...',
chunkIndex: 0,
totalChunks: 4,
requestIdentifier: 'upload-2026-05-18-001'
},
{
headers: {
Authorization: `Bearer ${process.env.PREZENT_API_KEY}`,
'Content-Type': 'application/json'
}
}
);
console.log(data);
return data;
};
preprocessChunk();
import os
import requests
url = "https://api.prezent.ai/api/v1/preprocess"
headers = {
"Authorization": f"Bearer {os.environ['PREZENT_API_KEY']}",
"Content-Type": "application/json",
}
payload = {
"fileName": "big-deck.pptx",
"fileContent": "UEsDBBQAAAAIAA...",
"chunkIndex": 0,
"totalChunks": 4,
"requestIdentifier": "upload-2026-05-18-001",
}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
print(response.json())
Success response (200)
{
"success": true,
"data": {
"request_identifier": "upload-2026-05-18-001",
"file_name": "big-deck.pptx",
"message": "Chunk received."
}
}
POST /api/v1/validate — Validate files / links
Validates a set of previously uploaded files (referenced by
fileIdentifiers) and/or a list of web links. At least one of
fileIdentifiers or webLinks must be non-empty.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
fileIdentifiers | object | conditional | Map of uuid → fileName for previously uploaded files. |
webLinks | array of URI | conditional | List of URLs to validate. |
Example
- cURL
- Node.js
- Python
curl -X POST https://api.prezent.ai/api/v1/validate \
-H "Authorization: Bearer $PREZENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileIdentifiers": { "file_abc123": "context.pdf" },
"webLinks": ["https://example.com/whitepaper"]
}'
const axios = require('axios');
const validateFiles = async () => {
const { data } = await axios.post(
'https://api.prezent.ai/api/v1/validate',
{
fileIdentifiers: { file_abc123: 'context.pdf' },
webLinks: ['https://example.com/whitepaper']
},
{
headers: {
Authorization: `Bearer ${process.env.PREZENT_API_KEY}`,
'Content-Type': 'application/json'
}
}
);
console.log(data);
return data;
};
validateFiles();
import os
import requests
url = "https://api.prezent.ai/api/v1/validate"
headers = {
"Authorization": f"Bearer {os.environ['PREZENT_API_KEY']}",
"Content-Type": "application/json",
}
payload = {
"fileIdentifiers": {"file_abc123": "context.pdf"},
"webLinks": ["https://example.com/whitepaper"],
}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
print(response.json())
Success response (200)
{
"success": true,
"data": {
"files": [
{ "uuid": "file_abc123", "file_name": "context.pdf", "valid": true }
],
"web_links": [
{ "url": "https://example.com/whitepaper", "valid": true }
],
"message": "Validation complete."
}
}
If validation fails, the entry includes a reason field:
{ "uuid": "file_zzz999", "file_name": "broken.docx", "valid": false, "reason": "Unsupported file type." }
Errors
Common error codes:
400—MISSING_FILE_CONTENT,MISSING_REQUIRED_FIELD,INVALID_PAYLOAD,FILE_UPLOAD_FAILED.401—INVALID_API_KEY,EXPIRED_API_KEY,UNAUTHORIZED.404—ENDPOINT_NOT_FOUND,RESOURCE_NOT_FOUND.415—UNSUPPORTED_FILE_TYPE.422—INVALID_INPUT,UNPROCESSABLE_ENTITY.429—RATE_LIMIT_EXCEEDED,TOO_MANY_REQUESTS.500/503/504— standard server-side codes.
See the full catalog in Developer Guide → Error codes.