Course CRUD API — Create, Update, Archive
Course CRUD API — Create, Update, Archive
Available since: v1.0.11
The Course CRUD API is the central authoring surface for managing courses within an organization. It exposes three tRPC procedures — course.create, course.update, and course.archive — that are used by both the course builder UI and the Teachable import engine.
Procedures
course.create
Creates a new course inside the caller's organization.
Input fields:
| Field | Type | Required | Description |
|---|---|---|---|
title | string | ✅ | The display title of the course |
description | string | ❌ | A short description of the course |
thumbnail | string (URL) | ❌ | URL of the course thumbnail image |
status | CourseStatus | ❌ | Initial publication status (defaults to draft) |
Returns: The newly created course object, including its generated id.
course.update
Updates metadata for an existing course. All fields are optional — only the fields provided will be changed.
Input fields:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | ID of the course to update |
title | string | ❌ | New title |
description | string | ❌ | New description |
thumbnail | string (URL) | ❌ | New thumbnail URL |
status | CourseStatus | ❌ | New publication status |
Returns: The updated course object.
course.archive
Soft-deletes a course, removing it from learner-facing views while retaining all content and enrollment data.
Input fields:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | ID of the course to archive |
Returns: The archived course object with an updated archivedAt timestamp.
Note: Archiving is non-destructive. Course content, lessons, and enrollment records are preserved and can be recovered.
Authorization
All three procedures are organization-scoped. The caller must be authenticated and a member of the organization that owns the course. Cross-organization mutations are rejected with an authorization error.
Course Status
The status field is shared across the course builder UI and the import engine. Supported values:
| Value | Description |
|---|---|
draft | Not visible to learners; default for newly created courses |
published | Visible and accessible to enrolled learners |
archived | Hidden from learners; set automatically by course.archive |
Usage by the Import Engine
When importing a course from a connected Teachable school, the import engine calls course.create to initialize the course record and then course.update to apply metadata as it is extracted (title, description, thumbnail). This ensures imported courses go through the same validation and authorization layer as manually authored ones.
Usage by the Course Builder UI
The course builder UI calls these procedures directly for all authoring operations:
- New course flow calls
course.create. - Settings panel calls
course.updatewhen the author saves changes to title, description, thumbnail, or status. - Archive action in the course management table calls
course.archive.