Skip to main content
POST
/
api
/
courses
Create a course
curl --request POST \
  --url https://api.terang.ai/api/courses \
  --header 'Content-Type: application/json' \
  --data '
{
  "institutionId": 1,
  "name": "Introduction to Machine Learning",
  "teacherId": "usr_abc123",
  "courseCode": "ML101",
  "coverPicture": "<string>",
  "currency": "<string>",
  "description": "A beginner-friendly course",
  "endDate": "2026-06-15T00:00:00.000Z",
  "enrollmentType": "code",
  "instructor": "Dr. Ahmad",
  "isPurchasable": true,
  "previewMode": true,
  "price": "<string>",
  "startDate": "2026-01-15T00:00:00.000Z",
  "type": "self_paced"
}
'
{
  "course": {
    "courseCode": "COURSE0042",
    "coverPicture": "https://example.com/cover.jpg",
    "createdAt": "2026-01-01T00:00:00.000Z",
    "currency": "IDR",
    "description": "A beginner-friendly course on ML fundamentals",
    "endDate": "2026-06-15T00:00:00.000Z",
    "enrollmentType": "code",
    "id": 1,
    "institutionId": 1,
    "instructor": "Dr. Ahmad",
    "isPurchasable": true,
    "name": "Introduction to Machine Learning",
    "previewMode": false,
    "price": "150000",
    "startDate": "2026-01-15T00:00:00.000Z",
    "teacherId": "usr_abc123",
    "type": "self_paced",
    "updatedAt": "2026-01-10T00:00:00.000Z"
  },
  "message": "<string>",
  "success": true
}

Body

application/json
institutionId
number
required
Example:

1

name
string
required
Minimum string length: 1
Example:

"Introduction to Machine Learning"

teacherId
string
required
Example:

"usr_abc123"

courseCode
string
Example:

"ML101"

coverPicture
string
currency
string
description
string
Example:

"A beginner-friendly course"

endDate
string
Example:

"2026-06-15T00:00:00.000Z"

enrollmentType
enum<string>
default:code
Available options:
code,
open,
approval
instructor
string
Example:

"Dr. Ahmad"

isPurchasable
boolean
previewMode
boolean
price
string
startDate
string
Example:

"2026-01-15T00:00:00.000Z"

type
enum<string>
default:self_paced
Available options:
self_paced,
scheduled

Response

Course created

course
object
required
message
string
required
success
boolean
required