Skip to main content

Bookmarks Endpoints

Manage user bookmarks for verses. All endpoints require authentication.

GET /api/bookmarks

Retrieve all bookmarks for the authenticated user.

Authentication

Requires Clerk authentication. Include authentication headers with the request.

Response

Returns an array of bookmarked verses sorted by creation date (newest first).
[].id
integer
Unique bookmark ID
[].user_id
string
User’s unique identifier
[].chapter
integer
Chapter number (1-18)
[].verse
integer
Verse number
[].translation
string
English translation of the verse
[].summarized_commentary
string
Commentary or summary for the verse
[].created_at
string
ISO 8601 timestamp when the bookmark was created

Response Example

[
  {
    "id": 123,
    "user_id": "user_abc123",
    "chapter": 2,
    "verse": 47,
    "translation": "You have the right to perform your prescribed duties...",
    "summarized_commentary": "This verse teaches the principle of performing duty...",
    "created_at": "2024-03-10T12:34:56.789Z"
  }
]

Error Responses

Status CodeDescription
401Unauthorized - authentication required
429Rate limit exceeded (30 requests per minute)
500Failed to fetch bookmarks
503Database not configured

POST /api/bookmarks

Create a new bookmark for a verse.

Authentication

Requires Clerk authentication.

Request

chapter
integer
required
Chapter number (1-18)
verse
integer
required
Verse number (must be valid for the chapter)
translation
string
required
English translation of the verse (max 10,000 characters)
summarized_commentary
string
required
Commentary or summary for the verse (max 10,000 characters)

Request Body Example

{
  "chapter": 2,
  "verse": 47,
  "translation": "You have the right to perform your prescribed duties...",
  "summarized_commentary": "This verse teaches the principle of performing duty..."
}

Response

{
  "success": true
}

Error Responses

Status CodeDescription
400Missing required fields, invalid chapter/verse, or text too long
401Unauthorized
409Already bookmarked (duplicate)
429Rate limit exceeded
500Failed to save bookmark
503Database not configured

DELETE /api/bookmarks

Remove a bookmark for a specific verse.

Authentication

Requires Clerk authentication.

Query Parameters

chapter
integer
required
Chapter number (1-18)
verse
integer
required
Verse number

Response

{
  "success": true
}

Error Responses

Status CodeDescription
400Invalid chapter or verse
401Unauthorized
429Rate limit exceeded
500Failed to remove bookmark
503Database not configured

Rate Limiting

All bookmark endpoints: 30 requests per minute per client

Code Examples

curl -X GET https://gitachat.org/api/bookmarks \
  -H "Authorization: Bearer YOUR_TOKEN"

Notes

  • Bookmarks are unique per user, chapter, and verse combination
  • Attempting to bookmark the same verse twice returns a 409 conflict error
  • Bookmarks are stored in Supabase database
  • All text fields have a maximum length of 10,000 characters

Build docs developers (and LLMs) love