curl --request PATCH \
--url https://schoolmaker.co/api/v1/lessons/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated introduction",
"drip_delay": 2
}
'import requests
url = "https://schoolmaker.co/api/v1/lessons/{id}"
payload = {
"name": "Updated introduction",
"drip_delay": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated introduction', drip_delay: 2})
};
fetch('https://schoolmaker.co/api/v1/lessons/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated introduction',
'drip_delay' => 2
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated introduction\",\n \"drip_delay\": 2\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://schoolmaker.co/api/v1/lessons/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated introduction\",\n \"drip_delay\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/lessons/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated introduction\",\n \"drip_delay\": 2\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"
}Set Lesson Details
Updates a lesson’s content, settings or section. Omitted fields remain unchanged.
curl --request PATCH \
--url https://schoolmaker.co/api/v1/lessons/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated introduction",
"drip_delay": 2
}
'import requests
url = "https://schoolmaker.co/api/v1/lessons/{id}"
payload = {
"name": "Updated introduction",
"drip_delay": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated introduction', drip_delay: 2})
};
fetch('https://schoolmaker.co/api/v1/lessons/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated introduction',
'drip_delay' => 2
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated introduction\",\n \"drip_delay\": 2\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://schoolmaker.co/api/v1/lessons/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated introduction\",\n \"drip_delay\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/lessons/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated introduction\",\n \"drip_delay\": 2\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
Body
- Option 1
- Option 2
Send fields directly or inside attributes. Omitted fields keep their current values. 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.
Lesson content in HTML, or Markdown with content_format=markdown. Maximum 200000 characters. Send null to clear it. 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.
200000Position in the section, starting at 1. Inserting at an occupied position moves later lessons down. Omit to keep the current order, or place the lesson last when moving sections. Null is not accepted. Zero is accepted, but positions starting at 1 are recommended. Deleting a lesson does not renumber the others.
x >= 0Wistia video ID or supported HTTP(S) share, watch or embed URL for lesson_type=video. URLs are saved as IDs. Send null or an empty string to clear it. 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. Send null or an empty string to clear it. 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. Send null or an empty string to clear it. 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. Send null or an empty string to clear it. 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. Send null or an empty string to clear it. A changed 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.
200000Additional delay in days, from 0 to 32767. Null is not accepted. 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.
Was this page helpful?