curl --request POST \
--url https://api.myustadia.com/api/v1/courses/{course_id}/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_urls": [
"<string>"
],
"source_files": [
{}
]
}
'import requests
url = "https://api.myustadia.com/api/v1/courses/{course_id}/sources"
payload = {
"source_urls": ["<string>"],
"source_files": [{}]
}
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({source_urls: ['<string>'], source_files: [{}]})
};
fetch('https://api.myustadia.com/api/v1/courses/{course_id}/sources', 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/courses/{course_id}/sources",
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([
'source_urls' => [
'<string>'
],
'source_files' => [
[
]
]
]),
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://api.myustadia.com/api/v1/courses/{course_id}/sources"
payload := strings.NewReader("{\n \"source_urls\": [\n \"<string>\"\n ],\n \"source_files\": [\n {}\n ]\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://api.myustadia.com/api/v1/courses/{course_id}/sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_urls\": [\n \"<string>\"\n ],\n \"source_files\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myustadia.com/api/v1/courses/{course_id}/sources")
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 \"source_urls\": [\n \"<string>\"\n ],\n \"source_files\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Add Course Sources
Attach more source URLs/files to a course DURING intake, then rebuild its document digest.
The course must be awaiting_brief (409 course_not_awaiting_brief otherwise:
after launch the sources are frozen because scene generation may already be
reading them). URLs are stored as-is (create parity); files are validated by the
same validator create uses and uploaded to R2. The new refs are merged into the
course under its row lock (concurrent add-files are serialized). If the merged
source set differs from the current one, a metered digest rebuild is enqueued.
Bounds: at most SOURCE_ADD_MAX_REBUILDS metered builds per course (409
source_rebuild_cap_reached beyond it) and a per-client burst limiter (429). The
response carries the updated source lists and the digest status
(pending while a rebuild runs, ready, or failed).
curl --request POST \
--url https://api.myustadia.com/api/v1/courses/{course_id}/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_urls": [
"<string>"
],
"source_files": [
{}
]
}
'import requests
url = "https://api.myustadia.com/api/v1/courses/{course_id}/sources"
payload = {
"source_urls": ["<string>"],
"source_files": [{}]
}
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({source_urls: ['<string>'], source_files: [{}]})
};
fetch('https://api.myustadia.com/api/v1/courses/{course_id}/sources', 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/courses/{course_id}/sources",
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([
'source_urls' => [
'<string>'
],
'source_files' => [
[
]
]
]),
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://api.myustadia.com/api/v1/courses/{course_id}/sources"
payload := strings.NewReader("{\n \"source_urls\": [\n \"<string>\"\n ],\n \"source_files\": [\n {}\n ]\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://api.myustadia.com/api/v1/courses/{course_id}/sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_urls\": [\n \"<string>\"\n ],\n \"source_files\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myustadia.com/api/v1/courses/{course_id}/sources")
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 \"source_urls\": [\n \"<string>\"\n ],\n \"source_files\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Additional source URLs to attach to the course. Stored as-is (create parity: URLs are not pre-validated; the SSRF guard is inside the scrape path).
Additional source files as {name|filename, base64, content_type}. Validated by the SAME validator create uses (type/size/page caps) and uploaded to R2.
Response
Successful Response