Bookmarks
This guide explain how to create Account's private bookmarks.
The bookmarks feature allows a user to save references to posts. The list is private to the authenticated Account, hence the owner and ANY Account Manager can access the list.
This feature is provided by the Lens API as a convenience to the user. The bookmarks are stored off-chain, so they are instant and do not require signatures or gas to use.
Add to Bookmarks
- GraphQL
- React
- TypeScript
Use the bookmarkPost mutation to add a post to the Account's bookmarks list.
You MUST be authenticated as Account Owner or Account Manager to make this request.
AddBookmark.graphql
mutation { bookmarkPost(request: { postId: "42" })}
That's it—the post is now saved to the Account's bookmarks list.
List Bookmarks
- GraphQL
- React
- TypeScript
Use the paginated postBookmarks query to list the Account's bookmarks.
You MUST be authenticated as Account Owner or Account Manager to make this request.
See the Pagination guide for more information on how to handle paginated results.
Remove from Bookmarks
- GraphQL
- React
- TypeScript
Use the undoBookmarkPost mutation to remove a post from the Account's bookmarks list.
You MUST be authenticated as Account Owner or Account Manager to make this request.
RemoveBookmark.graphql
mutation { undoBookmarkPost(request: { postId: "42" })}
That's it—the post is now removed from the Account's bookmarks list.