Skip to main content
POST
/
chatbot
/
create
Create chatbot
curl --request POST \
  --url https://api.example.com/chatbot/create \
  --header 'Content-Type: application/json' \
  --header 'x-access'\''courser-auth-token: <x-access'\''courser-auth-token>' \
  --data '
{
  "name": "<string>",
  "youtubeUrls": [
    "<string>"
  ]
}
'
{
  "course": {
    "_id": "<string>",
    "name": "<string>",
    "instructions": "<string>",
    "color": "<string>",
    "placeholder": "<string>",
    "backgroundImg": "<string>",
    "openAIAssistantID": "<string>",
    "openAIFiles": [
      "<string>"
    ],
    "transcriptions": [
      "<string>"
    ],
    "sourceFiles": [
      "<string>"
    ],
    "openAIKey": "<string>"
  }
}
Creates a new course, processes the provided YouTube lecture videos to extract transcriptions, and sets up an OpenAI assistant for the course. Authentication is required.
This endpoint performs heavy background work: downloading YouTube captions and building an OpenAI assistant configuration. Expect 30–90 seconds of processing time per video. The request will not return until processing is complete.

Request headers

x-access'courser-auth-token
string
required
Your JWT authentication token.

Request body

name
string
required
The display name for the chatbot and course.
youtubeUrls
string[]
required
An array of YouTube video URLs to use as the chatbot’s knowledge base. Each URL must be a standard watch URL.
URLs must use the format https://www.youtube.com/watch?v=VIDEO_ID. Shortened URLs (youtu.be), playlist URLs, and embed URLs are not supported.

Response

200 — Success

course
object
required
The newly created course object.

Example

curl --request POST \
  --url http://localhost:8000/chatbot/create \
  --header "x-access'courser-auth-token: <your_jwt_token>" \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Introduction to Marine Biology",
    "youtubeUrls": [
      "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "https://www.youtube.com/watch?v=xvFZjo5PgG0"
    ]
  }'
200
{
  "course": {
    "_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": ["file-abc123", "file-def456"],
    "transcriptions": ["64f1a2b3c4d5e6f7a8b9c0d2", "64f1a2b3c4d5e6f7a8b9c0d3"],
    "sourceFiles": [],
    "openAIKey": ""
  }
}

Build docs developers (and LLMs) love