All Docs
FeaturesCSI Teachable Replacement AppUpdated March 13, 2026

Course Thumbnail Upload & Image Asset API

Course Thumbnail Upload & Image Asset API

Available from: v1.0.20

The Course Thumbnail Upload feature provides a server-side handler for attaching a thumbnail image to any course. Images are stored in Vercel Blob and the resulting URL is saved directly to the course record — no additional configuration step required after uploading.


Supported Formats

FormatMIME Type
JPEGimage/jpeg
PNGimage/png
WebPimage/webp

Uploads with any other MIME type will be rejected with a 400 Bad Request response.


Server-Side Validation

All uploads are validated on the server before the file is written to storage:

  • File type — Only the three supported MIME types are accepted.
  • File size — The payload must not exceed the configured maximum size. Oversized uploads are rejected before storage, keeping Blob usage clean.

Validation errors are returned as JSON with a descriptive error field so clients can surface meaningful feedback to users.


How It Works

  1. The client submits a multipart/form-data request containing the image file to the upload endpoint.
  2. The server validates the file type and size.
  3. If validation passes, the file is uploaded to Vercel Blob.
  4. The Blob URL returned by the storage layer is written to the thumbnailUrl field of the associated course record.
  5. The endpoint responds with the updated course object (including the new thumbnailUrl).

Usage Notes

  • Uploading a new thumbnail for a course that already has one will replace the existing thumbnailUrl on the course record. The previous Blob object is not automatically deleted.
  • Thumbnail URLs are publicly accessible Vercel Blob URLs and can be used directly in <img> tags or as Open Graph images.
  • Ensure your Vercel project has Blob storage enabled and the appropriate environment variables configured (BLOB_READ_WRITE_TOKEN).

Related