Notes Endpoints
Manage personal notes on verses. All endpoints require authentication.GET /api/notes
Retrieve notes for the authenticated user. Can fetch a specific note or all notes.Authentication
Requires Clerk authentication.Query Parameters
Chapter number (1-18). If provided with verse, fetches a specific note.
Verse number. If provided with chapter, fetches a specific note.
Behavior
- With chapter and verse: Returns a single note object or null if no note exists
- Without parameters: Returns all notes for the user as an array
Response - Single Note
Unique note ID
User’s unique identifier
Chapter number (1-18)
Verse number
The note content (trimmed)
ISO 8601 timestamp when the note was created
ISO 8601 timestamp when the note was last updated
Response Example - Single Note
Response Example - All Notes
Error Responses
| Status Code | Description |
|---|---|
| 400 | Invalid chapter or verse |
| 401 | Unauthorized |
| 500 | Failed to fetch notes |
| 503 | Database not configured |
POST /api/notes
Create a new note or update an existing note for a verse (upsert operation).Authentication
Requires Clerk authentication.Request
Chapter number (1-18)
Verse number (must be valid for the chapter)
The note content. Maximum 5,000 characters (trimmed).
Request Body Example
Response
Returns the created or updated note object.Error Responses
| Status Code | Description |
|---|---|
| 400 | Missing required fields, invalid chapter/verse, or note text too long |
| 401 | Unauthorized |
| 500 | Failed to save note |
| 503 | Database not configured |
DELETE /api/notes
Delete a note for a specific verse.Authentication
Requires Clerk authentication.Query Parameters
Chapter number (1-18)
Verse number
Response
Error Responses
| Status Code | Description |
|---|---|
| 400 | Invalid chapter or verse |
| 401 | Unauthorized |
| 500 | Failed to delete note |
| 503 | Database not configured |
Code Examples
Notes
- Notes are unique per user, chapter, and verse combination
- Creating a note for an existing verse will update the existing note (upsert)
- Note text is automatically trimmed of leading/trailing whitespace
- Maximum note length: 5,000 characters
- Notes are sorted by updated_at when fetching all notes (newest first)
- Empty or whitespace-only notes cannot be saved