Skip to content

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

organisation
required
string

The organisation ID

Request Body required

object
content

Base64-encoded file content (for direct upload). Required unless using requestUploadUrl.

string
requestUploadUrl

Set to true to get a presigned S3 upload URL instead of uploading directly.

boolean
size

File size in bytes. Optional but recommended for presigned uploads.

integer
filename

Original filename

string
diagram.png
contentType
required

MIME type of the file

string
image/png
metadata

Custom metadata for filtering. Any fields allowed.

object
key
additional properties
any
{
"collectionId": "col-123",
"tags": [
"architecture",
"generated"
]
}

Responses

201

File uploaded or presigned URL generated

object
fileId
string format: uuid
s3Uri

S3 URI (direct upload only)

string
url

Presigned download URL (direct upload only)

string format: uri
uploadUrl

Presigned PUT URL (presigned upload only)

string format: uri
s3Key

S3 object key (presigned upload only)

string
expiresIn

URL expiry in seconds (presigned upload only)

integer
filename
string
contentType
string
size
integer
metadata
object
createdAt
string format: date-time

400

Invalid request parameters

403

Access denied

413

File too large (use requestUploadUrl for large files)

500

Failed to upload file