[GH-ISSUE #371] Possible to set List via API? #241

Closed
opened 2026-03-02 11:47:56 +03:00 by kerem · 4 comments
Owner

Originally created by @crosbyh on GitHub (Sep 2, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/371

Hello, first I want to say thanks for creating this app!

Is it possible to set the list of an item at the time it's added, via the API?

Context is, I am using Node-Red to consume some RSS feeds of my Reddit saved items into Hoarder, and I would like to automatically move these items into a specific list upon import.

Thanks again!

Originally created by @crosbyh on GitHub (Sep 2, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/371 Hello, first I want to say thanks for creating this app! Is it possible to set the list of an item at the time it's added, via the API? Context is, I am using Node-Red to consume some RSS feeds of my Reddit saved items into Hoarder, and I would like to automatically move these items into a specific list upon import. Thanks again!
kerem 2026-03-02 11:47:56 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@kamtschatka commented on GitHub (Sep 2, 2024):

is it not working? Should already be implemented with https://github.com/hoarder-app/hoarder/pull/211

<!-- gh-comment-id:2325053596 --> @kamtschatka commented on GitHub (Sep 2, 2024): is it not working? Should already be implemented with https://github.com/hoarder-app/hoarder/pull/211
Author
Owner

@crosbyh commented on GitHub (Sep 3, 2024):

This is likely me being dense, as it does appear you have the functionality. I am trying to call it via a CURL request. I have the following code in Node-Red, which works correctly for just sending a bookmark to my Hoarder instance:

const apiKey = 'api_key';

// Assuming the URL is passed to this function node's topic
const url = msg.topic;

// Define the request options
msg.method = 'POST';
msg.url = 'https://hoarder.example.net/api/trpc/bookmarks.createBookmark';
msg.headers = {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
};

// Set the request body
msg.payload = {
    json: {
        type: 'link',
        url: url,

    }

return msg;

Based on the issue you linked, I've tried adding the list-id parameter to the JSON payload a couple of different ways, both as list-id and listid, and by sending the plain text name of my list "Reddit" as well as the listid that appears in the body of the request when I inspect it from my browser when manually adding to the list, which looks something like sroxe11ufh1brw8ygs9zbocd, but nothing seems to work.

Am I missing something obvious?

<!-- gh-comment-id:2326786726 --> @crosbyh commented on GitHub (Sep 3, 2024): This is likely me being dense, as it does appear you have the functionality. I am trying to call it via a CURL request. I have the following code in Node-Red, which works correctly for just sending a bookmark to my Hoarder instance: ``` const apiKey = 'api_key'; // Assuming the URL is passed to this function node's topic const url = msg.topic; // Define the request options msg.method = 'POST'; msg.url = 'https://hoarder.example.net/api/trpc/bookmarks.createBookmark'; msg.headers = { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }; // Set the request body msg.payload = { json: { type: 'link', url: url, } return msg; ``` Based on the issue you linked, I've tried adding the list-id parameter to the JSON payload a couple of different ways, both as `list-id` and `listid`, and by sending the plain text name of my list "Reddit" as well as the `listid` that appears in the body of the request when I inspect it from my browser when manually adding to the list, which looks something like `sroxe11ufh1brw8ygs9zbocd`, but nothing seems to work. Am I missing something obvious?
Author
Owner

@kamtschatka commented on GitHub (Sep 21, 2024):

If you look at the cli, there is no call that allows creating a bookmark AND assigning it to a list in 1 go.
There is an API call to create the Bookmark and there is an API call to add it to a list.
The CLI simply makes it easier for the user to do it with 1 command.

If you have a look at the API calls the WebUI makes, when you add a bookmark to a list, you can see how it is done.
The API call is to "lists.addToList" and takes the parameters of the listId and the bookmarkId. If you don't have the id of the list, there is also "lists.list" to get a list of all lists, with the name and the id, as well as the parentId if it exists.

<!-- gh-comment-id:2365279610 --> @kamtschatka commented on GitHub (Sep 21, 2024): If you look at the cli, there is no call that allows creating a bookmark AND assigning it to a list in 1 go. There is an API call to create the Bookmark and there is an API call to add it to a list. The CLI simply makes it easier for the user to do it with 1 command. If you have a look at the API calls the WebUI makes, when you add a bookmark to a list, you can see how it is done. The API call is to "lists.addToList" and takes the parameters of the listId and the bookmarkId. If you don't have the id of the list, there is also "lists.list" to get a list of all lists, with the name and the id, as well as the parentId if it exists.
Author
Owner

@kamtschatka commented on GitHub (Oct 3, 2024):

closing, as it should be possible already

<!-- gh-comment-id:2392108188 --> @kamtschatka commented on GitHub (Oct 3, 2024): closing, as it should be possible already
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#241
No description provided.