curl --request POST \
--url https://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"assign": {
"allTeam": true,
"userIds": [
123
],
"dueInDays": 183,
"required": true
},
"announce": {
"slackChannelId": "<string>"
},
"allowPendingMedia": false
}
'import requests
url = "https://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply"
payload = {
"assign": {
"allTeam": True,
"userIds": [123],
"dueInDays": 183,
"required": True
},
"announce": { "slackChannelId": "<string>" },
"allowPendingMedia": False
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assign: {allTeam: true, userIds: [123], dueInDays: 183, required: true},
announce: {slackChannelId: '<string>'},
allowPendingMedia: false
})
};
fetch('https://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply', 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://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply",
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([
'assign' => [
'allTeam' => true,
'userIds' => [
123
],
'dueInDays' => 183,
'required' => true
],
'announce' => [
'slackChannelId' => '<string>'
],
'allowPendingMedia' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$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://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply"
payload := strings.NewReader("{\n \"assign\": {\n \"allTeam\": true,\n \"userIds\": [\n 123\n ],\n \"dueInDays\": 183,\n \"required\": true\n },\n \"announce\": {\n \"slackChannelId\": \"<string>\"\n },\n \"allowPendingMedia\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
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://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"assign\": {\n \"allTeam\": true,\n \"userIds\": [\n 123\n ],\n \"dueInDays\": 183,\n \"required\": true\n },\n \"announce\": {\n \"slackChannelId\": \"<string>\"\n },\n \"allowPendingMedia\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assign\": {\n \"allTeam\": true,\n \"userIds\": [\n 123\n ],\n \"dueInDays\": 183,\n \"required\": true\n },\n \"announce\": {\n \"slackChannelId\": \"<string>\"\n },\n \"allowPendingMedia\": false\n}"
response = http.request(request)
puts response.read_bodyPublish and assign a course draft
Publishes the draft’s lessons, course and certification to every learner in the organization. Lessons upsert by key, so publishing an edited draft again updates the same lessons and keeps learners’ progress. With assign, assigns the certification (or the course when there is none) and messages each assignee (Slack DM, or email when Slack can’t reach them); repeating the same assign does not assign or message again. With announce.slackChannelId, posts the announcement in that channel. Refused while clips are still being cut unless allowPendingMedia. The token’s user needs the Lessons create and update permissions. Requires write:learning. Also at POST /v1/learning/drafts/{draftId}/apply.
curl --request POST \
--url https://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"assign": {
"allTeam": true,
"userIds": [
123
],
"dueInDays": 183,
"required": true
},
"announce": {
"slackChannelId": "<string>"
},
"allowPendingMedia": false
}
'import requests
url = "https://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply"
payload = {
"assign": {
"allTeam": True,
"userIds": [123],
"dueInDays": 183,
"required": True
},
"announce": { "slackChannelId": "<string>" },
"allowPendingMedia": False
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assign: {allTeam: true, userIds: [123], dueInDays: 183, required: true},
announce: {slackChannelId: '<string>'},
allowPendingMedia: false
})
};
fetch('https://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply', 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://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply",
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([
'assign' => [
'allTeam' => true,
'userIds' => [
123
],
'dueInDays' => 183,
'required' => true
],
'announce' => [
'slackChannelId' => '<string>'
],
'allowPendingMedia' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$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://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply"
payload := strings.NewReader("{\n \"assign\": {\n \"allTeam\": true,\n \"userIds\": [\n 123\n ],\n \"dueInDays\": 183,\n \"required\": true\n },\n \"announce\": {\n \"slackChannelId\": \"<string>\"\n },\n \"allowPendingMedia\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
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://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"assign\": {\n \"allTeam\": true,\n \"userIds\": [\n 123\n ],\n \"dueInDays\": 183,\n \"required\": true\n },\n \"announce\": {\n \"slackChannelId\": \"<string>\"\n },\n \"allowPendingMedia\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.sessionboard.com/v1/organization/{orgId}/learning/drafts/{draftId}/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assign\": {\n \"allTeam\": true,\n \"userIds\": [\n 123\n ],\n \"dueInDays\": 183,\n \"required\": true\n },\n \"announce\": {\n \"slackChannelId\": \"<string>\"\n },\n \"allowPendingMedia\": false\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Organization API token. Generate from Organization Settings → API Tokens.
Path Parameters
Your organization ID. Any other organization returns 404.
Body
Response
Published; the draft with apply_result (diff, the assignment and its delivery report).

