[GH-ISSUE #1434] api: fix missing /api/assets to allow uploading pdfs and images from api #907

Closed
opened 2026-03-02 11:53:40 +03:00 by kerem · 5 comments
Owner

Originally created by @thiswillbeyourgithub on GitHub (May 18, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1434

Describe the Bug

Keeping track of that bug mentioned in this message:

it's an oversight from my side that it's indeed not documented.

Uploading an asset is a two step thing,

first you:

POST /api/assets

with a form containing a field called "file", which contains the file you're uploading. This will give you back an "assetId".

From there, you follow the "create a new bookmark" docs with the type being asset and the asset id is what you acquired from the upload endpoint.

Steps to Reproduce

.

Expected Behaviour

,

Screenshots or Additional Context

Resurrected from #1359 as I was trying if I could resurrect #562 but am stuck for sending pdf because of this.

Device Details

No response

Exact Karakeep Version

0.24.1

Have you checked the troubleshooting guide?

  • I have checked the troubleshooting guide and I haven't found a solution to my problem
Originally created by @thiswillbeyourgithub on GitHub (May 18, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1434 ### Describe the Bug Keeping track of that bug mentioned [in this message](https://github.com/karakeep-app/karakeep/issues/1359#issuecomment-2851355202): > it's an oversight from my side that it's indeed not documented. > Uploading an asset is a two step thing, > first you: > POST /api/assets > with a form containing a field called "file", which contains the file you're uploading. This will give you back an "assetId". > From there, you follow the "create a new bookmark" docs with the type being asset and the asset id is what you acquired from the upload endpoint. ### Steps to Reproduce . ### Expected Behaviour , ### Screenshots or Additional Context Resurrected from #1359 as I was trying if I could resurrect #562 but am stuck for sending pdf because of this. ### Device Details _No response_ ### Exact Karakeep Version 0.24.1 ### Have you checked the troubleshooting guide? - [x] I have checked the troubleshooting guide and I haven't found a solution to my problem
kerem 2026-03-02 11:53:40 +03:00
Author
Owner

@thiswillbeyourgithub commented on GitHub (May 18, 2025):

Actually maybe I could fix it myself as well as #1433 but would like to know if you wrote the open-api spec yourself or if you generated it and if so how.

<!-- gh-comment-id:2888929062 --> @thiswillbeyourgithub commented on GitHub (May 18, 2025): Actually maybe I could fix it myself as well as #1433 but would like to know if you wrote the open-api spec yourself or if you generated it and if so how.
Author
Owner

@MohamedBassem commented on GitHub (May 18, 2025):

@thiswillbeyourgithub I'm addressing this in #1432 as I'm re-writing the entire API layer.

<!-- gh-comment-id:2888930382 --> @MohamedBassem commented on GitHub (May 18, 2025): @thiswillbeyourgithub I'm addressing this in #1432 as I'm re-writing the entire API layer.
Author
Owner

@thiswillbeyourgithub commented on GitHub (May 18, 2025):

Alright thanks. Apparently we need to have a single unified endpoint to send files from android as it does not seem able to do the two calls (1 to get the assetId and then 2 to send the file) anyway. Feel free to close this if you prefer.

<!-- gh-comment-id:2888955806 --> @thiswillbeyourgithub commented on GitHub (May 18, 2025): Alright thanks. Apparently we need to have a single unified endpoint to send files from android as it does not seem able to do the two calls (1 to get the assetId and then 2 to send the file) anyway. Feel free to close this if you prefer.
Author
Owner

@MohamedBassem commented on GitHub (May 24, 2025):

@thiswillbeyourgithub I think it's fair to add such an endpoint specifically for the PWA. We did a similar one for the singlefile extension.

<!-- gh-comment-id:2906760781 --> @MohamedBassem commented on GitHub (May 24, 2025): @thiswillbeyourgithub I think it's fair to add such an endpoint specifically for the PWA. We did a similar one for the `singlefile` extension.
Author
Owner

@MohamedBassem commented on GitHub (Jun 7, 2025):

Fixed in: github.com/karakeep-app/karakeep@a98f02369c

<!-- gh-comment-id:2952704288 --> @MohamedBassem commented on GitHub (Jun 7, 2025): Fixed in: https://github.com/karakeep-app/karakeep/commit/a98f02369c5b2aea8831cbbff840fbd2ae395a7d
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#907
No description provided.