Skip to content

Files

All endpoints require a valid API key in the Authorization header.

File delivery uses a two-step upload process: request a presigned upload URL, upload the file directly to S3, then confirm the upload.

Upload flow

  1. Call Generate upload URL to get a presigned S3 URL
  2. PUT the file to the presigned URL
  3. Call Confirm upload to finalize

Generate upload URL

Terminal window
POST /v1/files/upload-url

Scope: files:write

Request body

{
"file_name": "course-module-1.pdf",
"file_size": 5242880,
"mime_type": "application/pdf",
"product_id": "prod_xyz"
}
FieldRequiredDescription
file_nameYesFile name (max 255 chars, no path traversal characters)
file_sizeYesFile size in bytes
mime_typeYesMIME type (must be in the allowed list below)
product_idNoAssociate with a product

Response

201 Created

{
"data": {
"upload_url": "https://s3.amazonaws.com/...",
"file_id": "file_001",
"file": {
"id": "file_001",
"file_name": "course-module-1.pdf",
"file_size": 5242880,
"mime_type": "application/pdf",
"upload_status": "PENDING",
"created_at": "2026-03-01T12:00:00.000Z"
}
},
"meta": { "request_id": "req_abc123", "timestamp": "2026-03-01T12:00:00.000Z" }
}

The presigned URL expires after 1 hour. Upload the file with a PUT request:

Terminal window
curl -X PUT -T course-module-1.pdf \
-H "Content-Type: application/pdf" \
"https://s3.amazonaws.com/..."

Allowed MIME types

CategoryTypes
Documentsapplication/pdf, text/plain, text/csv
Archivesapplication/zip, application/x-zip-compressed, application/epub+zip
Office.docx, .xlsx, .pptx (OpenXML formats)
Imagesimage/jpeg, image/png, image/gif, image/webp, image/svg+xml
Audioaudio/mpeg, audio/wav, audio/ogg, audio/flac, audio/aac
Videovideo/mp4, video/webm, video/quicktime
Fontsfont/ttf, font/otf, font/woff, font/woff2

Errors

CodeStatusDescription
MISSING_REQUIRED_FIELD400Missing or invalid required field
FILE_TOO_LARGE400Exceeds plan’s max file size
STORAGE_LIMIT_REACHED402Merchant storage quota exceeded

Confirm upload

Terminal window
POST /v1/files/{file_id}/confirm

Scope: files:write

Confirms the file was uploaded to S3 successfully. Validates the file exists and its size is within tolerance (10% of declared size).

Response

{
"data": {
"id": "file_001",
"file_name": "course-module-1.pdf",
"file_size": 5242880,
"mime_type": "application/pdf",
"upload_status": "CONFIRMED",
"download_count": 0,
"product_id": "prod_xyz",
"created_at": "2026-03-01T12:00:00.000Z",
"updated_at": "2026-03-01T12:00:05.000Z"
},
"meta": { "request_id": "req_abc123", "timestamp": "2026-03-01T12:00:05.000Z" }
}

Publishes a file.uploaded webhook event.

Errors

CodeStatusDescription
FILE_NOT_FOUND404File doesn’t exist
UPLOAD_NOT_CONFIRMED409File not in PENDING status or not found in S3

Download file

Terminal window
GET /v1/files/{file_id}/download?entitlement_id={ent_id}&customer_id={cust_id}

Scope: files:read

Generates a signed CloudFront download URL (60-second TTL).

Query parameters

ParameterRequiredDescription
entitlement_idYesEntitlement granting access
customer_idYesCustomer requesting the download

Validation

The endpoint validates:

  • The entitlement exists and belongs to the customer
  • The entitlement status is ACTIVE
  • The file belongs to the entitled product
  • The file upload status is CONFIRMED
  • Bandwidth limits are not exceeded

Response

{
"data": {
"download_url": "https://cdn.simplersuite.co/download/...",
"download": {
"id": "dl_abc123",
"file_id": "file_001",
"entitlement_id": "ent_abc123",
"downloaded_at": "2026-03-01T12:05:00.000Z"
}
},
"meta": { "request_id": "req_abc123", "timestamp": "2026-03-01T12:05:00.000Z" }
}

Each download:

  • Creates a download record
  • Increments the file’s download count
  • Tracks bandwidth usage against the merchant’s plan
  • Publishes a download.completed webhook event

Errors

CodeStatusDescription
MISSING_REQUIRED_FIELD400Missing required query parameters
NOT_FOUND404File or entitlement not found
UPLOAD_NOT_CONFIRMED400File not ready for download
BANDWIDTH_LIMIT_REACHED402Bandwidth quota exceeded

Plan limits

PlanMax file sizeStorageIncluded bandwidth
Free50 MB100 MB1 GB (hard cap)
Growth200 MB1 GB10 GB
Pro1 GB10 GB100 GB
Enterprise5 GB100 GB1 TB

Paid plans support bandwidth overage billing. The Free plan enforces a hard cap.