Create a course
curl --request POST \
--url https://api.example.com/v1/courses \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"language": "<string>",
"description": "<string>",
"hours": 123,
"ai": {
"instructions": "<string>",
"evaluator": {}
},
"tutor": {},
"metadata": {}
}
'import requests
url = "https://api.example.com/v1/courses"
payload = {
"name": "<string>",
"language": "<string>",
"description": "<string>",
"hours": 123,
"ai": {
"instructions": "<string>",
"evaluator": {}
},
"tutor": {},
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
language: '<string>',
description: '<string>',
hours: 123,
ai: {instructions: '<string>', evaluator: {}},
tutor: {},
metadata: {}
})
};
fetch('https://api.example.com/v1/courses', 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.example.com/v1/courses",
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([
'name' => '<string>',
'language' => '<string>',
'description' => '<string>',
'hours' => 123,
'ai' => [
'instructions' => '<string>',
'evaluator' => [
]
],
'tutor' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/courses"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"description\": \"<string>\",\n \"hours\": 123,\n \"ai\": {\n \"instructions\": \"<string>\",\n \"evaluator\": {}\n },\n \"tutor\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/courses")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"description\": \"<string>\",\n \"hours\": 123,\n \"ai\": {\n \"instructions\": \"<string>\",\n \"evaluator\": {}\n },\n \"tutor\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/courses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"description\": \"<string>\",\n \"hours\": 123,\n \"ai\": {\n \"instructions\": \"<string>\",\n \"evaluator\": {}\n },\n \"tutor\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodyCourses
Create a course
Create an empty course (status draft). Generate a syllabus next.
POST
/
v1
/
courses
Create a course
curl --request POST \
--url https://api.example.com/v1/courses \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"language": "<string>",
"description": "<string>",
"hours": 123,
"ai": {
"instructions": "<string>",
"evaluator": {}
},
"tutor": {},
"metadata": {}
}
'import requests
url = "https://api.example.com/v1/courses"
payload = {
"name": "<string>",
"language": "<string>",
"description": "<string>",
"hours": 123,
"ai": {
"instructions": "<string>",
"evaluator": {}
},
"tutor": {},
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
language: '<string>',
description: '<string>',
hours: 123,
ai: {instructions: '<string>', evaluator: {}},
tutor: {},
metadata: {}
})
};
fetch('https://api.example.com/v1/courses', 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.example.com/v1/courses",
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([
'name' => '<string>',
'language' => '<string>',
'description' => '<string>',
'hours' => 123,
'ai' => [
'instructions' => '<string>',
'evaluator' => [
]
],
'tutor' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/courses"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"description\": \"<string>\",\n \"hours\": 123,\n \"ai\": {\n \"instructions\": \"<string>\",\n \"evaluator\": {}\n },\n \"tutor\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/courses")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"description\": \"<string>\",\n \"hours\": 123,\n \"ai\": {\n \"instructions\": \"<string>\",\n \"evaluator\": {}\n },\n \"tutor\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/courses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"description\": \"<string>\",\n \"hours\": 123,\n \"ai\": {\n \"instructions\": \"<string>\",\n \"evaluator\": {}\n },\n \"tutor\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodyParameters
Human-readable course name.
BCP-47 language code:
"en", "es", "pt-BR", etc.Long-form description; doubles as the default brief when you call
generateSyllabus() without one.Target total student hours.
Tutor configuration. See Build an AI tutor.
Free-form key-value store.
Returns
A Course withstatus: "draft".
Examples
const course = await hk.courses.create({
name: "Intro to Special Relativity",
language: "en",
hours: 12,
description: "An undergraduate intro course...",
});
$course = $hk->courses->create([
'name' => 'Intro to Special Relativity',
'language' => 'en',
'hours' => 12,
'description' => 'An undergraduate intro course...',
]);
course = hk.courses.create(
name="Intro to Special Relativity",
language="en",
hours=12,
)
curl https://api.hawkings.education/v1/courses \
-H "x-api-key: $HAWKINGS_API_KEY" \
-H "X-Learning-Platform-Code: $HAWKINGS_PLATFORM_CODE" \
-H "Content-Type: application/json" \
-d '{
"name": "Intro to Special Relativity",
"language": "en",
"hours": 12
}'
Response
{
"id": "crs_01HX9N5AB3...",
"object": "course",
"name": "Intro to Special Relativity",
"language": "en",
"duration": { "hours": 12, "hours_generated": 0 },
"status": "draft",
"cohorts": [],
"created_at": "2026-05-10T12:00:00Z"
}
A course on its own has no lessons. Either call
generateSyllabus for an
AI-built tree, or create units, lessons, and content by hand.⌘I