post
https://developers.teachable.com/v2/uploads
Generate pre-signed credentials for uploading files directly to cloud storage.
Workflow
- Request credentials: Call this endpoint with the resource
type,id,purpose, and fileextension - Upload your file: Use the response fields to upload directly to the storage provider
- Update the resource: After upload completes, update the resource with the returned
url(e.g.,PATCH /v2/courses/{id}withthumbnail_url)
How to Upload
Build your upload request using the response fields:
- Send a request to
upload_urlusingupload_method - Set all headers from
upload_headers(includesContent-Type) - Include each key-value pair from
upload_bodyin your request body - Include your file using the field name from
file_field_name
Note: Serialize
upload_bodyaccording to theContent-Typeheader. Iffile_field_nameis present, include your file as a field with that name alongside theupload_bodyfields. Iffile_field_nameisnull, 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
| Field | Description |
|---|---|
upload_url | The endpoint URL to send your file to |
upload_method | HTTP method to use (e.g., POST, PUT) |
upload_headers | Headers to include in your upload request (e.g., Content-Type) |
upload_body | Key-value pairs to include in your request body (serialize per Content-Type), or null if not needed |
file_field_name | The field name to use for your file (e.g., file), or null if the file is sent as the raw request body |
url | The CDN URL where your file will be available after upload. Use this to update the resource. |
expires | When the credentials expire (ISO 8601). Upload before this time. |
upload_id | Unique identifier for this upload request |
Supported Resources
| Type | Purpose | Description |
|---|---|---|
course | thumbnail | Course cover image |
product_collection | thumbnail | Learning path cover image |
digital_download | thumbnail | Digital product cover image |
digital_download | attachment | Downloadable file for customers |
lecture | attachment | Lecture file (PDF, video, etc.) |
membership | thumbnail | Membership cover image |
coaching | thumbnail | Coaching 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
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…