curl --request POST \
--url https://schoolmaker.co/api/v1/lessons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"section_id": "section_id",
"name": "Introduction",
"lesson_type": "text",
"body": "# Welcome",
"content_format": "markdown",
"is_published": false
}
'import requests
url = "https://schoolmaker.co/api/v1/lessons"
payload = {
"section_id": "section_id",
"name": "Introduction",
"lesson_type": "text",
"body": "# Welcome",
"content_format": "markdown",
"is_published": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
section_id: 'section_id',
name: 'Introduction',
lesson_type: 'text',
body: JSON.stringify('# Welcome'),
content_format: 'markdown',
is_published: false
})
};
fetch('https://schoolmaker.co/api/v1/lessons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://schoolmaker.co/api/v1/lessons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'section_id' => 'section_id',
'name' => 'Introduction',
'lesson_type' => 'text',
'body' => '# Welcome',
'content_format' => 'markdown',
'is_published' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://schoolmaker.co/api/v1/lessons"
payload := strings.NewReader("{\n \"section_id\": \"section_id\",\n \"name\": \"Introduction\",\n \"lesson_type\": \"text\",\n \"body\": \"# Welcome\",\n \"content_format\": \"markdown\",\n \"is_published\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://schoolmaker.co/api/v1/lessons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"section_id\": \"section_id\",\n \"name\": \"Introduction\",\n \"lesson_type\": \"text\",\n \"body\": \"# Welcome\",\n \"content_format\": \"markdown\",\n \"is_published\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/lessons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"section_id\": \"section_id\",\n \"name\": \"Introduction\",\n \"lesson_type\": \"text\",\n \"body\": \"# Welcome\",\n \"content_format\": \"markdown\",\n \"is_published\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "lesson_id",
"section_id": "section_id",
"name": "Introduction",
"position": 1,
"lesson_type": "text",
"drip_delay": 0,
"is_published": false,
"is_progression_locked": false,
"description": "",
"body": "<div class=\"lexxy-content\"><h1>Welcome</h1></div>",
"settings_embed_wistia": null,
"settings_embed_vimeo": null,
"settings_embed_youtube": null,
"settings_embed_loom": null,
"settings_embed_code": null,
"embed_code": null,
"transcripts": [],
"media": {
"pdf_url": null,
"audio_url": null,
"video_poster_url": null,
"video_status": null,
"video_id": null,
"video_error": null,
"video_progress": null
}
}{
"error": "Access denied"
}{
"error": "Access denied"
}{
"error": "Record not found"
}{
"error": "Invalid arguments: /attributes/drip_delay integer"
}Create a Lesson
Creates a lesson in a section. New lessons are published by default and include one completion step.
curl --request POST \
--url https://schoolmaker.co/api/v1/lessons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"section_id": "section_id",
"name": "Introduction",
"lesson_type": "text",
"body": "# Welcome",
"content_format": "markdown",
"is_published": false
}
'import requests
url = "https://schoolmaker.co/api/v1/lessons"
payload = {
"section_id": "section_id",
"name": "Introduction",
"lesson_type": "text",
"body": "# Welcome",
"content_format": "markdown",
"is_published": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
section_id: 'section_id',
name: 'Introduction',
lesson_type: 'text',
body: JSON.stringify('# Welcome'),
content_format: 'markdown',
is_published: false
})
};
fetch('https://schoolmaker.co/api/v1/lessons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://schoolmaker.co/api/v1/lessons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'section_id' => 'section_id',
'name' => 'Introduction',
'lesson_type' => 'text',
'body' => '# Welcome',
'content_format' => 'markdown',
'is_published' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://schoolmaker.co/api/v1/lessons"
payload := strings.NewReader("{\n \"section_id\": \"section_id\",\n \"name\": \"Introduction\",\n \"lesson_type\": \"text\",\n \"body\": \"# Welcome\",\n \"content_format\": \"markdown\",\n \"is_published\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://schoolmaker.co/api/v1/lessons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"section_id\": \"section_id\",\n \"name\": \"Introduction\",\n \"lesson_type\": \"text\",\n \"body\": \"# Welcome\",\n \"content_format\": \"markdown\",\n \"is_published\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/lessons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"section_id\": \"section_id\",\n \"name\": \"Introduction\",\n \"lesson_type\": \"text\",\n \"body\": \"# Welcome\",\n \"content_format\": \"markdown\",\n \"is_published\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "lesson_id",
"section_id": "section_id",
"name": "Introduction",
"position": 1,
"lesson_type": "text",
"drip_delay": 0,
"is_published": false,
"is_progression_locked": false,
"description": "",
"body": "<div class=\"lexxy-content\"><h1>Welcome</h1></div>",
"settings_embed_wistia": null,
"settings_embed_vimeo": null,
"settings_embed_youtube": null,
"settings_embed_loom": null,
"settings_embed_code": null,
"embed_code": null,
"transcripts": [],
"media": {
"pdf_url": null,
"audio_url": null,
"video_poster_url": null,
"video_status": null,
"video_id": null,
"video_error": null,
"video_progress": null
}
}{
"error": "Access denied"
}{
"error": "Access denied"
}{
"error": "Record not found"
}{
"error": "Invalid arguments: /attributes/drip_delay integer"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
- Option 1
- Option 2
Send fields directly or inside attributes. JSON numbers and booleans must use their native types. Form requests accept number and boolean values, including nested fields such as attributes[is_published]. Use JSON for null values. Empty strings and the text null are not treated as null.
ID of the section for this lesson. Required and cannot be null.
1 - 255Required lesson title, up to 255 characters. Cannot be blank or null.
1 - 255Lesson description, up to 200000 characters. Defaults to an empty string when omitted or null. Use content_format=markdown to convert Markdown to HTML.
200000Lesson content in HTML, or Markdown with content_format=markdown. Maximum 200000 characters. Omitted or null gives an empty body. Responses return HTML. Scripts, iframes, object and embed tags, and attachment markup are not accepted. Use the video or embed fields for embedded media. Use HTML blockquote tags for quotes because Markdown blockquotes display as ordinary text.
200000Format of the body and description sent in this request. Use html (default when omitted or null) or markdown. Responses return HTML. This does not change content omitted from the request.
html, markdown, null 200000Position in the section, starting at 1. Omitted, null or 0 places the lesson last. Inserting at an occupied position moves later lessons down.
x >= 0Lock the rest of the program until members complete all steps in this lesson. If a drip delay also applies, both conditions must be met. Defaults to false when omitted or null.
Publish this lesson. Defaults to true when omitted or null, including in unpublished programs. Send false to create a draft. Program publication and member access still apply.
Wistia video ID or supported HTTP(S) share, watch or embed URL for lesson_type=video. URLs are saved as IDs. Omitted or null leaves it empty. A changed nonblank value clears the other video providers and settings_embed_code, while keeping embed_code. Supply one video source. For multiple changed sources, priority is Wistia, YouTube, Vimeo, Loom, then settings_embed_code.
200000Vimeo video ID or supported HTTP(S) share, watch or embed URL for lesson_type=video. URLs are saved as IDs. Omitted or null leaves it empty. A changed nonblank value clears the other video providers and settings_embed_code, while keeping embed_code. Supply one video source. For multiple changed sources, priority is Wistia, YouTube, Vimeo, Loom, then settings_embed_code.
200000YouTube video ID or supported HTTP(S) share, watch or embed URL for lesson_type=video. URLs are saved as IDs. Omitted or null leaves it empty. A changed nonblank value clears the other video providers and settings_embed_code, while keeping embed_code. Supply one video source. For multiple changed sources, priority is Wistia, YouTube, Vimeo, Loom, then settings_embed_code.
200000Loom video ID or supported HTTP(S) share, watch or embed URL for lesson_type=video. URLs are saved as IDs. Omitted or null leaves it empty. A changed nonblank value clears the other video providers and settings_embed_code, while keeping embed_code. Supply one video source. For multiple changed sources, priority is Wistia, YouTube, Vimeo, Loom, then settings_embed_code.
200000Custom video embed HTML for lesson_type=video. Defaults to empty when omitted or null. A nonblank value clears video provider fields unless a changed provider takes precedence. The separate embed_code field is kept. Supply one video source per request.
200000Custom HTML for lesson_type=embed. Defaults to empty when omitted or null. This is separate from settings_embed_code and keeps any video provider settings.
200000Lesson type. Defaults to video when omitted or null.
video, text, pdf, embed, audio, null 200000Additional delay in days, from 0 to 32767. Defaults to 0 when omitted or null. Adds to the section unlock time, including the member drip boost. If program access has a drip start date, uses the earliest start date plus section and lesson delays, without the boost. Progression locks and access restrictions still apply.
0 <= x <= 32767Response
Successful request.
video, text, pdf, embed, audio Rendered HTML.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?