Enroll
curl --request POST \
--url https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll', 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://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}B2B Learn
Enroll
Enroll the header learner in a listed, in-org course.
Auth: portal API key + X-Learner-Email header (see module docstring).
Idempotent: a repeat enroll does not error or reset progress; it bumps
last_opened_at and returns the existing enrollment_id + current
completion_pct.
404 (opaque, no oracle) whenever the course cannot be enrolled into:
course not found, not listed in the caller's org catalog, wrong owner,
cross-org, or unverified when the org requires verification. All of these
collapse to the same "Course not found" response so a caller cannot probe
catalog visibility rules by watching the error vary.
Returns 200 {enrollment_id: int, completion_pct: float} (0.0 on first
enroll).
POST
/
api
/
v1
/
learn
/
courses
/
{course_id}
/
enroll
Enroll
curl --request POST \
--url https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll', 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://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myustadia.com/api/v1/learn/courses/{course_id}/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}