Skip to content

Upload File to S3

POST
/api/v3/organizations/{organisation}/ai/files
curl --request POST \
--url https://dashboard.quantcdn.io/api/v3/organizations/example/ai/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "content": "example", "requestUploadUrl": false, "size": 1, "filename": "diagram.png", "contentType": "image/png", "metadata": { "collectionId": "col-123", "tags": [ "architecture", "generated" ] } }'

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.

organisation
required
string

The organisation ID

Media typeapplication/json
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
Example
diagram.png
contentType
required

MIME type of the file

string
Example
image/png
metadata

Custom metadata for filtering. Any fields allowed.

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

File uploaded or presigned URL generated

Media typeapplication/json
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
Examplegenerated
{
"fileId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"s3Uri": "example",
"url": "https://example.com",
"uploadUrl": "https://example.com",
"s3Key": "example",
"expiresIn": 1,
"filename": "example",
"contentType": "example",
"size": 1,
"metadata": {},
"createdAt": "2026-04-15T12:00:00Z"
}

Invalid request parameters

Access denied

File too large (use requestUploadUrl for large files)

Failed to upload file