Create pre-signed upload credentials

Generate pre-signed credentials for uploading files directly to cloud storage.

Workflow

  1. Request credentials: Call this endpoint with the resource type, id, purpose, and file extension
  2. Upload your file: Use the response fields to upload directly to the storage provider
  3. Update the resource: After upload completes, update the resource with the returned url (e.g., PATCH /v2/courses/{id} with thumbnail_url)

How to Upload

Build your upload request using the response fields:

  1. Send a request to upload_url using upload_method
  2. Set all headers from upload_headers (includes Content-Type)
  3. Include each key-value pair from upload_body in your request body
  4. Include your file using the field name from file_field_name

Note: Serialize upload_body according to the Content-Type header. If file_field_name is present, include your file as a field with that name alongside the upload_body fields. If file_field_name is null, send the file as the raw request body.

Example

# 1. Request upload credentials
curl -X POST "https://developers.teachable.com/v2/uploads" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "course", "id": 123, "purpose": "thumbnail", "extension": "jpg"}'

# Response:
# {
#   "upload_url": "https://api2.transloadit.com/assemblies",
#   "upload_method": "POST",
#   "upload_headers": {"Content-Type": "multipart/form-data"},
#   "upload_body": {"params": "...", "signature": "..."},
#   "file_field_name": "file",
#   "url": "https://cdn.teachablecdn.com/...",
#   "expires": "2024-01-01T13:00:00Z",
#   "upload_id": "abc-123"
# }

# 2. Upload the file using the credentials
curl -X POST "https://api2.transloadit.com/assemblies" \
  -H "Content-Type: multipart/form-data" \
  -F "params=..." \
  -F "signature=..." \
  -F "file=@/path/to/image.jpg"

# 3. Update the resource with the CDN URL
curl -X PATCH "https://developers.teachable.com/v2/courses/123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"thumbnail_url": "https://cdn.teachablecdn.com/..."}'

Response Fields

FieldDescription
upload_urlThe endpoint URL to send your file to
upload_methodHTTP method to use (e.g., POST, PUT)
upload_headersHeaders to include in your upload request (e.g., Content-Type)
upload_bodyKey-value pairs to include in your request body (serialize per Content-Type), or null if not needed
file_field_nameThe field name to use for your file (e.g., file), or null if the file is sent as the raw request body
urlThe CDN URL where your file will be available after upload. Use this to update the resource.
expiresWhen the credentials expire (ISO 8601). Upload before this time.
upload_idUnique identifier for this upload request

Supported Resources

TypePurposeDescription
coursethumbnailCourse cover image
product_collectionthumbnailLearning path cover image
digital_downloadthumbnailDigital product cover image
digital_downloadattachmentDownloadable file for customers
lectureattachmentLecture file (PDF, video, etc.)
membershipthumbnailMembership cover image
coachingthumbnailCoaching product cover image

Constraints

  • Maximum file size: 20 GB
  • Extension: 1-10 alphanumeric characters (e.g., jpg, pdf, mp4)
  • Credentials expire: 1 hour after creation
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
enum
required

The resource type to upload for.

Allowed:
integer
required
≥ 1

The ID of the resource.

string
enum
required

The purpose of the upload (e.g., thumbnail, attachment).

Allowed:
string
required
^[a-zA-Z0-9]{1,10}$

File extension without the dot (e.g., 'jpg', 'pdf', 'mp4'). Case-insensitive, 1-10 alphanumeric characters.

Headers
string
required

Generated Admin API key

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json