Skip to main content
Version: 1.0

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​

MethodPathDescriptionSync/Async
POST/api/v1/preprocessPreprocess a file in chunksSync
POST/api/v1/validateValidate uploaded files and/or web linksSync

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​

FieldTypeRequiredDescription
fileContentstringyesChunk content as base64 / data: URL.
fileNamestringyesOriginal filename including extension.
chunkIndexinteger ≥ 0yesZero-based index of this chunk.
totalChunksinteger ≥ 1yesTotal number of chunks for this upload.
requestIdentifierstringyesCaller-supplied identifier that groups chunks of the same upload.

Example (one chunk)​

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"
}'

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​

FieldTypeRequiredDescription
fileIdentifiersobjectconditionalMap of uuid → fileName for previously uploaded files.
webLinksarray of URIconditionalList of URLs to validate.

Example​

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"]
}'

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.