Help! Anyone know if I use this api correctly? #26025
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.I'm using the creat-by-file api to update document in a dataset. At first, I simply upload the file and choose parent-child sturcture to build the dataset. Then I want to achieve parent-child structure with full-doc in parent when I use api to update file. However, everytime I tried to update file thru this api, document structure changed to one chunk. Can anyone helps? Much appreciate! Here is my input: url = f"{env}/datasets/{dataset_id}/document/create-by-file" 2. Additional context or commentsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
You're very close! To keep the parent-child structure (with the parent as the full document) when updating via the API, you need to set Try changing your payload to use Let me know if you need a sample payload! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
May I ask how your create-by-file is implemented? When I use Apifox, it keeps showing 'Invalid user account,' and it also doesn't work in the HTTP node application in Dify. |
Beta Was this translation helpful? Give feedback.

You're very close! To keep the parent-child structure (with the parent as the full document) when updating via the API, you need to set
"process_rule": { "mode": "hierarchical", ... }instead of"custom". The"parent_mode"value"full-doc"isn't documented as a standard option—most examples use"paragraph"for parent_mode. If you use"custom", the API will treat the whole document as a single chunk, which is why your structure collapses to one chunk.Try changing your payload to use
"mode": "hierarchical"and"parent_mode": "paragraph"(or another supported value), and keep your segmentation/subchunk_segmentation settings. This should restore the hierarchical structure you want when upda…