Used by thousands of students worldwide - help us reach 150 members
Bookmarks
/bookmarksPer-user bookmarks on book lines, with an optional note. A bookmark points at a line by its zero-based position (lineId) within the book, and is unique per user, book and line. All routes require authentication and only ever touch the caller's own bookmarks.
/bookmarks/:bookIdList my bookmarks in a bookGET/bookmarks/user/allList all my bookmarksPOST/bookmarksCreate a bookmarkPUT/bookmarks/:bookmarkIdUpdate a bookmark noteDELETE/bookmarks/:bookmarkIdDelete a bookmarkList my bookmarks in a book
Returns the authenticated user's bookmarks for one book as raw bookmark documents, sorted by lineId ascending. Returns an empty array if there are none (the book itself is not looked up).
Path parameters
bookIdstring | Book ObjectId |
Errors
401Unauthorized: No token provided403Forbidden: Invalid token, or the user does not have one of the allowed roles404User not found (the token's user no longer exists)500Internal Server Error (also returned for a malformed bookId)
curl -X GET "https://app.ummahspot.com/bookmarks/:bookId" \
-H "Authorization: Bearer $SHARH_TOKEN"{
"bookmarks": [
{
"_id": "6501a3b4c5d6e7f8a9b0c1d2",
"user": "64e0b7f2a1c3d4e5f6a7b8c9",
"book": "64f1c2a9e4b0a1d2c3e4f567",
"lineId": 12,
"notes": "Review the definition of kalam",
"createdAt": "2026-09-01T09:30:00.000Z",
"__v": 0
}
]
}List all my bookmarks
Returns every bookmark of the authenticated user across all books, newest first, each joined with its book title and the content of the bookmarked line. The line is resolved by using the stored lineId as a zero-based index into the book's lines. Note that in this response "lineId" is the ObjectId of the resolved line, not the numeric index that was stored. No pagination.
Errors
401Unauthorized: No token provided403Forbidden: Invalid token, or the user does not have one of the allowed roles404User not found (the token's user no longer exists)500Internal Server Error (also returned when a bookmark's book no longer exists or its lineId no longer points at a line)
curl -X GET "https://app.ummahspot.com/bookmarks/user/all" \
-H "Authorization: Bearer $SHARH_TOKEN"{
"bookmarks": [
{
"_id": "6501a3b4c5d6e7f8a9b0c1d2",
"bookId": "64f1c2a9e4b0a1d2c3e4f567",
"bookTitle": "Al-Ajrumiyyah",
"lineId": "64f1c2a9e4b0a1d2c3e4f570",
"notes": "Review the definition of kalam",
"createdAt": "2026-09-01T09:30:00.000Z",
"line": {
"Arabic": "الكلام هو اللفظ المركب المفيد بالوضع",
"English": "Speech is a composed utterance that conveys a complete meaning by convention.",
"commentary": "The author begins with the definition of kalam.",
"rootwords": "ك ل م"
}
}
]
}Create a bookmark
Bookmarks a line of a book for the authenticated user. Only one bookmark may exist per user, book and lineId. The book and line are not checked for existence. Returns the created bookmark document.
Body parameters
bookIdrequiredstring | Book ObjectId. |
lineIdrequirednumber | Zero-based index of the line within the book's lines array. |
notesstring | Optional note attached to the bookmark.Default: "" |
Errors
400{ "message": "Bookmark already exists" } — the user already bookmarked this line of this book401Unauthorized: No token provided403Forbidden: Invalid token, or the user does not have one of the allowed roles404User not found (the token's user no longer exists)500Internal Server Error (also returned when bookId or lineId is missing or invalid)
curl -X POST "https://app.ummahspot.com/bookmarks" \
-H "Authorization: Bearer $SHARH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"bookId":"string","lineId":0}'{
"_id": "6501a3b4c5d6e7f8a9b0c1d2",
"user": "64e0b7f2a1c3d4e5f6a7b8c9",
"book": "64f1c2a9e4b0a1d2c3e4f567",
"lineId": 12,
"notes": "Review the definition of kalam",
"createdAt": "2026-09-01T09:30:00.000Z",
"__v": 0
}Update a bookmark note
Replaces the note on one of the authenticated user's bookmarks and returns the updated bookmark document. Bookmarks belonging to other users are treated as not found.
Path parameters
bookmarkIdstring | Bookmark ObjectId |
Body parameters
notesstring | New note text. |
Errors
401Unauthorized: No token provided403Forbidden: Invalid token, or the user does not have one of the allowed roles404{ "message": "Bookmark not found" } — no such bookmark owned by the caller (or plain text "User not found")500Internal Server Error (also returned for a malformed bookmarkId)
curl -X PUT "https://app.ummahspot.com/bookmarks/:bookmarkId" \
-H "Authorization: Bearer $SHARH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"notes":"string"}'{
"_id": "6501a3b4c5d6e7f8a9b0c1d2",
"user": "64e0b7f2a1c3d4e5f6a7b8c9",
"book": "64f1c2a9e4b0a1d2c3e4f567",
"lineId": 12,
"notes": "Memorise this definition",
"createdAt": "2026-09-01T09:30:00.000Z",
"__v": 0
}Delete a bookmark
Permanently deletes one of the authenticated user's bookmarks. Bookmarks belonging to other users are treated as not found.
Path parameters
bookmarkIdstring | Bookmark ObjectId |
Errors
401Unauthorized: No token provided403Forbidden: Invalid token, or the user does not have one of the allowed roles404{ "message": "Bookmark not found" } — no such bookmark owned by the caller (or plain text "User not found")500Internal Server Error (also returned for a malformed bookmarkId)
curl -X DELETE "https://app.ummahspot.com/bookmarks/:bookmarkId" \
-H "Authorization: Bearer $SHARH_TOKEN"No content — the response body is empty.