Update Course

Update a generated course, its chapters, and its lessons using a Platform API key.

Authenticated Update Endpoints

These endpoints use the Platform API key and the course request id returned by Create Course. Use them when your backend or agent needs to edit a generated course without using the public editToken URL.

All paths are prefixed with /v1/platform/courses/:id.

MethodPathPurpose
PATCH/Update course metadata
PATCH/canonicalBulk-update course metadata, chapters, and lessons
PATCH/chapters/:chapterIdUpdate a single chapter
PATCH/lessons/:sequenceUpdate a lesson by sequence
PATCH/lessons/by-id/:lessonId/fullUpdate a full lesson by UUID

Updates are available only after the course request has completed and has a result row. If the request is still pending, poll Get Course until isTerminal is true.


PATCH /

Updates course-level metadata.

curl -X PATCH https://api.tutorflow.io/v1/platform/courses/{id} \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Python Foundations",
    "description": "A concise introduction to Python for first-time programmers."
  }'

Body

FieldTypeDescription
titlestringUpdated course title
descriptionstringUpdated course description

Returns the updated CourseResDto.


PATCH /canonical

Bulk-updates the complete course shape. This is the preferred endpoint for curriculum editors and agents that need to update course, chapter, and lesson state in one save.

curl -X PATCH https://api.tutorflow.io/v1/platform/courses/{id}/canonical \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Python Foundations",
    "description": "A practical Python course.",
    "slug": "python-foundations",
    "chapters": [
      {
        "id": "getting-started",
        "title": "Getting Started",
        "slug": "getting-started",
        "sequence": 1
      }
    ],
    "lessons": [
      {
        "id": "2ca91d88-7b0c-4287-89f1-89a74d8a5b26",
        "chapterId": "getting-started",
        "title": "Variables and Types",
        "description": "Learn how Python stores data.",
        "slug": "variables-and-types",
        "type": "ai-tutor",
        "sequence": 1,
        "lecture": "<p>Python variables are names for values...</p>",
        "content": { "blocks": [] },
        "quizzes": [],
        "problems": [],
        "metadata": { "duration": 12 }
      }
    ]
  }'

Body

FieldTypeDescription
titlestringCourse title
descriptionstringCourse description
slugstringCourse slug
chaptersarrayChapter rename / slug updates
lessonsarrayFull lesson upsert list

Chapter Fields

FieldTypeDescription
idstringExisting chapter id/slug from the canonical response
titlestringNew chapter title
slugstringNew chapter slug
sequencenumberDisplay order metadata

Chapter data is denormalized onto lessons. Updating a chapter updates the chapterTitle and/or chapterSlug of every lesson currently assigned to that chapter.

Lesson Fields

FieldTypeDescription
idstringExisting PlatformLesson id. Omit to insert a new lesson.
chapterIdstringChapter id/slug to assign the lesson to
titlestringLesson title
descriptionstring | nullLesson description
slugstringLesson slug
typestringLesson type, such as ai-tutor or markdown
sequencenumberLesson order
lecturestring | nullHTML lecture body
contentobject | string | nullStructured lesson content
quizzesarray | nullQuiz JSON
problemsarray | nullPractice problem JSON
metadataobject | nullFree-form metadata

When lessons is supplied, the list is treated as authoritative: existing lessons that are not present in the incoming list are removed, matching ids are patched, and entries without an id are inserted.

Returns the updated full course payload.


PATCH /chapters/:chapterId

Updates a single chapter by its canonical chapter id/slug.

curl -X PATCH https://api.tutorflow.io/v1/platform/courses/{id}/chapters/getting-started \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{ "title": "Python Basics", "slug": "python-basics", "sequence": 1 }'

Returns the updated full course payload.


PATCH /lessons/:sequence

Updates a lesson by its numeric sequence.

curl -X PATCH https://api.tutorflow.io/v1/platform/courses/{id}/lessons/1 \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Variables and Types",
    "description": "Updated lesson description.",
    "lessonSlug": "variables-and-types",
    "lecture": "<p>Updated lecture HTML...</p>"
  }'

Returns the updated PlatformLessonPublicDto.


PATCH /lessons/by-id/:lessonId/full

Updates all supported lesson fields by PlatformLesson UUID.

curl -X PATCH https://api.tutorflow.io/v1/platform/courses/{id}/lessons/by-id/{lessonId}/full \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Control Flow",
    "type": "ai-tutor",
    "chapterId": "python-basics",
    "sequence": 2,
    "lecture": "<p>Use if statements to branch...</p>",
    "content": { "blocks": [] },
    "quizzes": [],
    "problems": [],
    "metadata": { "duration": 15 }
  }'

Returns the updated canonical lesson shape.