Feature request: Allow selective field retreival in list files API #2868

Closed
opened 2025-11-11 15:16:03 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @sreinwald on GitHub (Nov 29, 2024).

Is your feature request related to a problem? Please describe.

The current /api/v1/files API returns all file details including their entire content, which is problematic for deployments with a large amount of files in knowledge bases. This results in significant performance degradation and makes the files API largely unusable due to the large volume of data being transferred.

Describe the solution you'd like

I would like to see an enhancement where the List Files API can be dynamically queried to return only certain fields the user actually requests. This should significantly improve performance and usability of the files API for systems with large numbers of files.

So, for example, a get request for api/v1/files?fields=id,user_id,created_at should only return

[
	{
	 "id": "476b7e0b-c41a-4e98-9077-f56d7195bb51",
	 "user_id":"126aaeba-bc1c-48b5-b47c-c9dc9a5394a1",
	 "created_at": "1732877376"
	}
]

Describe alternatives you've considered

Another option is to create a separate endpoint specifically designed for metadata only retrieval, but this would add complexity to the API structure and increase maintenance efforts.

Originally created by @sreinwald on GitHub (Nov 29, 2024). **Is your feature request related to a problem? Please describe.** The current `/api/v1/files` API returns all file details including their entire content, which is problematic for deployments with a large amount of files in knowledge bases. This results in significant performance degradation and makes the files API largely unusable due to the large volume of data being transferred. **Describe the solution you'd like** I would like to see an enhancement where the List Files API can be dynamically queried to return only certain fields the user actually requests. This should significantly improve performance and usability of the files API for systems with large numbers of files. So, for example, a get request for `api/v1/files?fields=id,user_id,created_at` should only return ```json [ { "id": "476b7e0b-c41a-4e98-9077-f56d7195bb51", "user_id":"126aaeba-bc1c-48b5-b47c-c9dc9a5394a1", "created_at": "1732877376" } ] ``` **Describe alternatives you've considered** Another option is to create a separate endpoint specifically designed for metadata only retrieval, but this would add complexity to the API structure and increase maintenance efforts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#2868