Upload File to S3
POST /api/v3/organizations/{organisation}/ai/files
Uploads a file to S3 storage for later retrieval.
*
* Two Upload Modes:
*
* 1. Direct Upload (≤7MB): Send base64-encoded content in request body.
*
* 2. Presigned URL Upload (any size): Set requestUploadUrl: true to get a presigned S3 PUT URL, then upload directly to S3.
*
* Supported Content Types:
* - Images: image/png, image/jpeg, image/gif, image/webp, image/svg+xml
* - Documents: application/pdf, text/plain, text/markdown, text/html
* - Code: text/javascript, application/json, text/css, text/yaml
* - Archives: application/zip, application/gzip
* - Video: video/mp4, video/webm (use presigned URL for large files)
*
* Metadata:
* Attach any custom metadata for filtering. artifactType is auto-populated from contentType if not provided.
Authorizations
Parameters
Path Parameters
The organisation ID
Request Body required
object
Base64-encoded file content (for direct upload). Required unless using requestUploadUrl.
Set to true to get a presigned S3 upload URL instead of uploading directly.
File size in bytes. Optional but recommended for presigned uploads.
Original filename
diagram.pngMIME type of the file
image/pngCustom metadata for filtering. Any fields allowed.
object
{ "collectionId": "col-123", "tags": [ "architecture", "generated" ]}Responses
201
File uploaded or presigned URL generated
object
S3 URI (direct upload only)
Presigned download URL (direct upload only)
Presigned PUT URL (presigned upload only)
S3 object key (presigned upload only)
URL expiry in seconds (presigned upload only)
object
400
Invalid request parameters
403
Access denied
413
File too large (use requestUploadUrl for large files)
500
Failed to upload file