Skip to main content
GET
/
course
/
getCourseProtected
/
{courseID}
Get course (authenticated)
curl --request GET \
  --url https://api.example.com/course/getCourseProtected/{courseID} \
  --header 'x-access'\''courser-auth-token: <x-access'\''courser-auth-token>'
{
  "_id": "<string>",
  "name": "<string>",
  "instructions": "<string>",
  "color": "<string>",
  "placeholder": "<string>",
  "backgroundImg": "<string>",
  "openAIAssistantID": "<string>",
  "openAIFiles": [
    "<string>"
  ],
  "transcriptions": [
    "<string>"
  ],
  "sourceFiles": [
    "<string>"
  ],
  "openAIKey": "<string>"
}
Returns a single course by ID. Unlike GET /course/getCourse/:courseID, this endpoint requires authentication. Use it when you need to fetch full course details in a context where a valid session is already available.
Both this endpoint and GET /course/getCourse/:courseID return the same course object. The difference is that this endpoint verifies the caller’s JWT token first.

Request headers

x-access'courser-auth-token
string
required
A valid JWT token obtained from any auth endpoint.

Path parameters

courseID
string
required
The ID of the course to retrieve.

Response

200 — Success

Returns the course object directly (not wrapped in a key).
_id
string
Unique identifier for the course.
name
string
The course display name.
instructions
string
The AI system prompt used by the course chatbot. Defaults to "You are a helpful AI assistant for a University classroom that answers questions for students about this course".
color
string
The chatbot accent color as a hex string. Defaults to "#fecc4e".
placeholder
string
The input field hint text shown in the chatbot UI. Defaults to "What is significant about horseshoe crabs".
backgroundImg
string
URL of the chatbot background image.
openAIAssistantID
string
The OpenAI assistant ID for this course.
openAIFiles
string[]
IDs of files uploaded to OpenAI for retrieval.
transcriptions
string[]
Array of Transcription document IDs for the course’s processed videos.
sourceFiles
string[]
Array of Source document IDs (MongoDB ObjectIds) for the processed YouTube videos.
openAIKey
string
Custom OpenAI API key for this course, if set. Empty string if using the platform default.

401 — Unauthorized

Returned if the auth header is missing, the token is invalid, or no user is found for the token.

Example

curl --request GET \
  --url http://localhost:8000/course/getCourseProtected/64f1a2b3c4d5e6f7a8b9c0d1 \
  --header "x-access'courser-auth-token: <your_jwt_token>"
200
{
  "_id": "64f1a2b3c4d5e6f7a8b9c0d1",
  "name": "Introduction to Marine Biology",
  "instructions": "You are a helpful AI assistant for a University classroom that answers questions for students about this course",
  "color": "#fecc4e",
  "placeholder": "What is significant about horseshoe crabs",
  "backgroundImg": "https://res.cloudinary.com/dlk3ezbal/image/upload/v1699589098/jqmlca7vhr0cnzgdbaah.png",
  "openAIAssistantID": "asst_abc123xyz",
  "openAIFiles": [],
  "transcriptions": [],
  "sourceFiles": ["64f1a2b3c4d5e6f7a8b9c0d2"],
  "openAIKey": ""
}

Build docs developers (and LLMs) love