Endpoint
server/procedures/bookmarks.ts:41
Authentication
This endpoint requires authentication. See Authentication for details.Request
Display title for the bookmark. For link-type bookmarks, this will be overridden by the fetched page title if available.
The bookmark URL. Required for
link type bookmarks, optional for other types.Type of bookmark to create:
link: A standard URL bookmark with automatic metadata fetchingcolor: A color swatch bookmarktext: A text-only bookmark
Hex color code. Primarily used for
color type bookmarks.ID of the group to add the bookmark to. The group must exist and belong to the authenticated user.
Input Schema
lib/schema.ts:90.
Response
Returns the created bookmark object.Unique identifier for the created bookmark
The bookmark’s title (may be auto-fetched from the URL)
The normalized bookmark URL
Auto-fetched favicon URL for link bookmarks
The bookmark type
The color value for color-type bookmarks
Canonicalized URL used for duplicate detection
ID of the group containing this bookmark
ID of the authenticated user
Creation timestamp
Last update timestamp
Examples
Create a Link Bookmark
Create a Color Bookmark
Create a Text Bookmark
Behavior
URL Normalization
For link-type bookmarks, the URL is automatically normalized:- Removes tracking parameters
- Standardizes protocol and domain
- Creates a canonical version for duplicate detection
lib/utils.ts for normalizeUrl() and canonicalizeUrl() implementations.
Automatic Metadata Fetching
When creating a link bookmark:- The URL is normalized
- Page metadata is fetched in parallel (title, favicon)
- If successful, the title is updated with the page title
- The favicon URL is stored for display
server/procedures/bookmarks.ts:53:
Duplicate Handling
If a bookmark with the same normalized URL already exists in the same group:- The existing bookmark is updated instead of creating a new one
- The title and favicon are refreshed from the latest metadata
- The
updatedAttimestamp is updated - The existing bookmark is returned
server/procedures/bookmarks.ts:64:
Errors
The specified
groupId does not exist or does not belong to the authenticated user.User is not authenticated.
Notes
- Group ownership is verified before creating the bookmark (see
server/procedures/bookmarks.ts:18) - Metadata fetching happens asynchronously and won’t block bookmark creation if it fails
- The normalized URL is used for duplicate detection within the same group
- Color and text bookmarks don’t trigger metadata fetching