dify icon indicating copy to clipboard operation
dify copied to clipboard

show knowledge metadata `id` in frontend or allow setting metadata via API by `name` only

Open Mutantpenguin opened this issue 2 months ago • 3 comments

Self Checks

  • [x] I have read the Contributing Guide and Language Policy.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report, otherwise it will be closed.
  • [x] Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

I am uploading files via API into a knowledgebase and wanted to set the metadata at the same time. This is not possible and so I had to use the separate endpoint /datasets/<uuid:dataset_id>/documents/metadata. I am hoping that I am allowed to use it since it is not documented in the API documentation.

For this endpoint, you need to specify the id, name and value of the metadata.

But: there is no way to get this id from the frontend. I had to manually call another API just to get the id of the metadata which was very frustating.

What I also don't understand: why do I need to specify both id and name? Especially since name is already unique. Being able to only specify name would lead to the great feature of uploading metadata with the same name to different datasets, without needing to know the specific id of that metadata from that specific dataset. I hope that makes sense.

2. Additional context or comments

Please either give us the ability to set metadata by name only (which I would prefer), or make the id visible in the frontend.

3. Can you help us with this feature?

  • [ ] I am interested in contributing to this feature.

Mutantpenguin avatar Nov 05 '25 13:11 Mutantpenguin

Hi, @Mutantpenguin. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested an enhancement to simplify metadata handling in the API or frontend.
  • Specifically, you suggested either showing the metadata id in the frontend or allowing metadata to be set using only the unique name via the API.
  • Currently, both id and name are required, but the id is not accessible from the frontend, complicating metadata uploads.
  • No further comments or updates have been made on this issue so far.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of Dify by commenting here.
  • If I don’t hear back within 15 days, I will automatically close this issue.

Thanks for your understanding and contribution!

dosubot[bot] avatar Dec 06 '25 16:12 dosubot[bot]

It's still relevant.

Mutantpenguin avatar Dec 11 '25 09:12 Mutantpenguin

@crazywoola The user has confirmed that the issue regarding simplifying metadata handling in the API/frontend is still relevant and needs attention. Could you please assist?

dosubot[bot] avatar Dec 11 '25 09:12 dosubot[bot]