Files API
The Files API enables uploading source documents to S3 and retrieving files with presigned URLs for direct download.List Files
Retrieve all files in a specific container (folder) for your organization.Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
container | string | Yes | Container/folder name (e.g., ‘templates’, ‘documents’, ‘input’) |
Request Example
Response
Response Fields
| Field | Type | Description |
|---|---|---|
files | array | Array of file objects |
files[].name | string | File name |
files[].url | string | Presigned S3 URL for direct access |
Status Codes
- 200 OK: Successfully retrieved file list
- 400 Bad Request: Authentication failed
- 401 Unauthorized: Missing or invalid Bearer token
- 500 Internal Server Error: S3 operation failed
Upload File
Upload a file to S3. Automatically converts DOCX to PDF (except in templates container). Validates file type by extension and MIME type.Request
Content-Type:multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
file_name | string | Yes | Name to give the uploaded file |
file_content | file | Yes | Binary file content |
container | string | Yes | Container/folder name for upload |
Supported File Types
.docx- Word documents.pdf- PDF documents.csv- CSV files.xlsx- Excel spreadsheets.rtf- Rich Text Format
Request Example
Python Example
Response
Status Codes
- 200 OK: File uploaded successfully
- 400 Bad Request: File validation failure (invalid type, size, etc.)
- 401 Unauthorized: Missing or invalid Bearer token
- 500 Internal Server Error: S3 upload failed
Error Examples
Invalid File Type:Auto-Conversion: DOCX to PDF
Files uploaded as.docx are automatically converted to PDF (except in the templates container):
- Input:
document.docx - Output:
document.pdf - Exception: Files uploaded to
templatescontainer are not converted
Container Types
Common container names and their purposes:| Container | Purpose |
|---|---|
documents | Processed documents |
templates | MRT template files (not auto-converted) |
input | Source documents for ingestion |
output | Generated output files |
Presigned URLs
File URLs returned by the API are presigned S3 URLs that:- Allow direct download without additional authentication
- Expire after 1 hour for security
- Require HTTPS to access
- Are organization-scoped in the URL path