scientific-skills/open-notebook/references/api_reference.md
http://localhost:5055/api
Interactive API documentation is available at http://localhost:5055/docs (Swagger UI) and http://localhost:5055/redoc (ReDoc).
If OPEN_NOTEBOOK_PASSWORD is configured, include the password in requests. The following routes are excluded from authentication: /, /health, /docs, /openapi.json, /redoc, /api/auth/status, /api/config.
GET /api/notebooks
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
archived | boolean | Filter by archived status |
order_by | string | Sort field (default: updated_at) |
Response: Array of notebook objects with source_count and note_count.
POST /api/notebooks
Request Body:
{
"name": "My Research",
"description": "Optional description"
}
GET /api/notebooks/{notebook_id}
PUT /api/notebooks/{notebook_id}
Request Body:
{
"name": "Updated Name",
"description": "Updated description",
"archived": false
}
DELETE /api/notebooks/{notebook_id}
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
delete_sources | boolean | Also delete exclusive sources (default: false) |
GET /api/notebooks/{notebook_id}/delete-preview
Returns counts of notes and sources that would be affected by deletion.
POST /api/notebooks/{notebook_id}/sources/{source_id}
Idempotent operation to associate a source with a notebook.
DELETE /api/notebooks/{notebook_id}/sources/{source_id}
GET /api/sources
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
notebook_id | string | Filter by notebook |
limit | integer | Number of results |
offset | integer | Pagination offset |
order_by | string | Sort field |
POST /api/sources
Accepts multipart form data for file uploads or JSON for URL/text sources.
Form Parameters:
| Parameter | Type | Description |
|---|---|---|
file | file | Upload file (PDF, DOCX, audio, video) |
url | string | Web URL to ingest |
text | string | Raw text content |
notebook_id | string | Associate with notebook |
process_async | boolean | Process asynchronously (default: true) |
POST /api/sources/json
Legacy JSON-based endpoint for source creation.
GET /api/sources/{source_id}
GET /api/sources/{source_id}/status
Poll processing status for asynchronously ingested sources.
PUT /api/sources/{source_id}
Request Body:
{
"title": "Updated Title",
"topic": "Updated topic"
}
DELETE /api/sources/{source_id}
GET /api/sources/{source_id}/download
Returns the original uploaded file.
HEAD /api/sources/{source_id}/download
POST /api/sources/{source_id}/retry
Requeue a failed source for processing.
GET /api/sources/{source_id}/insights
Retrieve AI-generated insights for a source.
GET /api/notes
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
notebook_id | string | Filter by notebook |
POST /api/notes
Request Body:
{
"title": "My Note",
"content": "Note content...",
"note_type": "human",
"notebook_id": "notebook:abc123"
}
note_type must be "human" or "ai". AI notes without titles get auto-generated titles.
GET /api/notes/{note_id}
PUT /api/notes/{note_id}
Request Body:
{
"title": "Updated Title",
"content": "Updated content",
"note_type": "human"
}
DELETE /api/notes/{note_id}
GET /api/chat/sessions
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
notebook_id | string | Filter by notebook |
POST /api/chat/sessions
Request Body:
{
"notebook_id": "notebook:abc123",
"title": "Discussion Topic",
"model_override": "optional_model_id"
}
GET /api/chat/sessions/{session_id}
Returns session details with message history.
PUT /api/chat/sessions/{session_id}
DELETE /api/chat/sessions/{session_id}
POST /api/chat/execute
Request Body:
{
"session_id": "chat_session:abc123",
"message": "Your question here",
"context": {
"include_sources": true,
"include_notes": true
},
"model_override": "optional_model_id"
}
POST /api/chat/context
Build contextual data from sources and notes for a chat session.
POST /api/search
Request Body:
{
"query": "search terms",
"search_type": "vector",
"limit": 10,
"source_ids": [],
"note_ids": [],
"min_similarity": 0.7
}
search_type can be "vector" (requires embedding model) or "text" (keyword matching).
POST /api/search/ask
Returns Server-Sent Events with AI-generated answers based on knowledge base content.
POST /api/search/ask/simple
Non-streaming version that returns a complete response.
POST /api/podcasts/generate
Request Body:
{
"notebook_id": "notebook:abc123",
"episode_profile_id": "episode_profile:xyz",
"speaker_profile_ids": ["speaker:a", "speaker:b"]
}
Returns a job_id for tracking generation progress.
GET /api/podcasts/jobs/{job_id}
GET /api/podcasts/episodes
GET /api/podcasts/episodes/{episode_id}
GET /api/podcasts/episodes/{episode_id}/audio
Streams the podcast audio file.
POST /api/podcasts/episodes/{episode_id}/retry
DELETE /api/podcasts/episodes/{episode_id}
GET /api/transformations
POST /api/transformations
Request Body:
{
"name": "summarize",
"title": "Summarize Content",
"description": "Generate a concise summary",
"prompt": "Summarize the following text...",
"apply_default": false
}
POST /api/transformations/execute
Request Body:
{
"transformation_id": "transformation:abc",
"input_text": "Text to transform...",
"model_id": "model:xyz"
}
GET /api/transformations/default-prompt
PUT /api/transformations/default-prompt
GET /api/transformations/{transformation_id}
PUT /api/transformations/{transformation_id}
DELETE /api/transformations/{transformation_id}
GET /api/models
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
model_type | string | Filter by type (llm, embedding, stt, tts) |
POST /api/models
DELETE /api/models/{model_id}
POST /api/models/{model_id}/test
GET /api/models/defaults
Returns default model assignments for seven service slots: chat, transformation, embedding, speech-to-text, text-to-speech, podcast, and summary.
PUT /api/models/defaults
GET /api/models/providers
GET /api/models/discover/{provider}
POST /api/models/sync/{provider}
POST /api/models/sync
POST /api/models/auto-assign
Automatically populate empty default model slots using provider priority rankings.
GET /api/models/count/{provider}
GET /api/models/by-provider/{provider}
GET /api/credentials/status
GET /api/credentials/env-status
GET /api/credentials
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
provider | string | Filter by provider |
GET /api/credentials/by-provider/{provider}
POST /api/credentials
Request Body:
{
"provider": "openai",
"name": "My OpenAI Key",
"api_key": "sk-...",
"base_url": null
}
GET /api/credentials/{credential_id}
Note: API key values are never returned.
PUT /api/credentials/{credential_id}
DELETE /api/credentials/{credential_id}
POST /api/credentials/{credential_id}/test
POST /api/credentials/{credential_id}/discover
POST /api/credentials/{credential_id}/register-models
The API returns standard HTTP status codes with JSON error bodies:
| Status | Meaning |
|---|---|
| 400 | Invalid input |
| 401 | Authentication required |
| 404 | Resource not found |
| 422 | Configuration error |
| 429 | Rate limited |
| 500 | Internal server error |
| 502 | External service error |
Error Response Format:
{
"detail": "Description of the error"
}