SoraiDocs
GuidesAPI reference

sorai courses add-lesson

Add a lesson to the end of a section.

A video or file lesson takes a file uploaded to the product first, or for a video an external_link. A lesson is hidden from buyers until published is true, and a course goes on sale only with at least one published lesson.

sorai courses add-lesson --product-id <uuid> --section-id <uuid> --kind <video|file|text> --title <string> [flags]

Flags

  • --store <id|slug>: A store id or slug. Defaults to SORAI_STORE, the saved login's store, or the only store.
  • --product-id <uuid> (required): The product's id, from sorai products list.
  • --section-id <uuid> (required): The section's id, from sorai courses get.
  • --kind <video|file|text> (required)
  • --title <string> (required)
  • --source <file|external_link>: file (the default) or external_link, for a YouTube or Vimeo video.
  • --file-id <uuid>: A file uploaded to this product, from sorai products files.
  • --external-url <string>: With source external_link: the video's address.
  • --body <string>: A text lesson's content.
  • --duration-seconds <int>
  • --preview: Let anyone watch this lesson before buying.
  • --published: Show the lesson to buyers.
  • --dry-run: Print the request it would send, and for an update the fields that would change, without changing anything.

Permissions

Needs a key with the catalog:write permission.

This command changes data. Run it with --dry-run first to see what it would do.

On this page