Skip to main content
Notebooks are collections of saved outputs from other DeepTutor modules (solve, question, research, co-writer, chat). The Guide and IdeaGen modules read from notebooks to power learning sessions and research idea generation.

Endpoints

MethodPathDescription
GET/api/v1/notebook/healthHealth check
GET/api/v1/notebook/listList all notebooks
GET/api/v1/notebook/statisticsGet global statistics
POST/api/v1/notebook/createCreate a notebook
GET/api/v1/notebook/{notebook_id}Get notebook details
PUT/api/v1/notebook/{notebook_id}Update a notebook
DELETE/api/v1/notebook/{notebook_id}Delete a notebook
POST/api/v1/notebook/add_recordAdd a record to notebooks
DELETE/api/v1/notebook/{notebook_id}/records/{record_id}Remove a record

GET /api/v1/notebook/list

List all notebooks with summary information.
curl http://localhost:8001/api/v1/notebook/list
notebooks
object[]
Array of notebook summaries.
total
number
Total number of notebooks.
{
  "notebooks": [
    {
      "id": "nb_abc123",
      "name": "Deep Learning Notes",
      "description": "Chapter summaries and solved problems",
      "color": "#3B82F6",
      "icon": "book",
      "record_count": 5,
      "created_at": "2025-01-01T10:00:00Z"
    }
  ],
  "total": 1
}

GET /api/v1/notebook/statistics

Get aggregate statistics across all notebooks.
curl http://localhost:8001/api/v1/notebook/statistics

POST /api/v1/notebook/create

Create a new notebook.

Request body

name
string
required
Display name for the notebook.
description
string
default:"\"\""
Optional description.
color
string
default:"\"#3B82F6\""
Hex color code for the notebook icon.
icon
string
default:"\"book\""
Icon name for the notebook.
curl -X POST http://localhost:8001/api/v1/notebook/create \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Deep Learning Notes",
    "description": "Chapter summaries and solved problems",
    "color": "#3B82F6",
    "icon": "book"
  }'
{
  "success": true,
  "notebook": {
    "id": "nb_abc123",
    "name": "Deep Learning Notes",
    "description": "Chapter summaries and solved problems",
    "color": "#3B82F6",
    "icon": "book",
    "records": [],
    "created_at": "2025-01-01T10:00:00Z"
  }
}

GET /api/v1/notebook/{notebook_id}

Get full notebook details including all records.
notebook_id
string
required
Notebook identifier.
curl http://localhost:8001/api/v1/notebook/nb_abc123
Returns 404 if the notebook is not found.

PUT /api/v1/notebook/{notebook_id}

Update notebook metadata. All fields are optional; only supplied fields are updated.
notebook_id
string
required
Notebook identifier.

Request body

name
string
New display name.
description
string
New description.
color
string
New hex color code.
icon
string
New icon name.
curl -X PUT http://localhost:8001/api/v1/notebook/nb_abc123 \
  -H "Content-Type: application/json" \
  -d '{ "name": "Updated Notebook Name" }'
{
  "success": true,
  "notebook": { "id": "nb_abc123", "name": "Updated Notebook Name", ... }
}
Returns 404 if the notebook is not found.

DELETE /api/v1/notebook/{notebook_id}

Delete a notebook and all its records.
notebook_id
string
required
Notebook identifier.
curl -X DELETE http://localhost:8001/api/v1/notebook/nb_abc123
{ "success": true, "message": "Notebook deleted successfully" }

POST /api/v1/notebook/add_record

Save an AI-generated output to one or more notebooks. This is the primary way to populate notebooks with content for guided learning and idea generation.

Request body

notebook_ids
string[]
required
List of notebook IDs to add the record to.
record_type
string
required
Type of the record. One of: "solve", "question", "research", "co_writer", "chat".
title
string
required
Display title for the record.
user_query
string
required
The original user question or prompt that produced this output.
output
string
required
The AI-generated output content (Markdown).
metadata
object
default:"{}"
Additional metadata to store with the record.
kb_name
string
Knowledge base that was used.
curl -X POST http://localhost:8001/api/v1/notebook/add_record \
  -H "Content-Type: application/json" \
  -d '{
    "notebook_ids": ["nb_abc123"],
    "record_type": "solve",
    "title": "Backpropagation explanation",
    "user_query": "Explain the backpropagation algorithm.",
    "output": "# Backpropagation\n\nBackpropagation is...",
    "kb_name": "ai_textbook"
  }'
{
  "success": true,
  "record": {
    "id": "rec_xyz789",
    "record_type": "solve",
    "title": "Backpropagation explanation",
    "created_at": "2025-01-01T12:00:00Z"
  },
  "added_to_notebooks": ["nb_abc123"]
}

DELETE /api/v1/notebook/{notebook_id}/records/{record_id}

Remove a record from a notebook. The record itself is not deleted from other notebooks it may belong to.
notebook_id
string
required
Notebook identifier.
record_id
string
required
Record identifier.
curl -X DELETE http://localhost:8001/api/v1/notebook/nb_abc123/records/rec_xyz789
{ "success": true, "message": "Record removed successfully" }
Returns 404 if the record is not found in the notebook.

Build docs developers (and LLMs) love