[GH-ISSUE #3275] [BUG]: Move to workspace does not work via AnythingLLM API #2106

Closed
opened 2026-02-22 18:28:10 -05:00 by yindo · 3 comments
Owner

Originally created by @tbar74235 on GitHub (Feb 19, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3275

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

Hi there,

I like to create an automatism to upload files to a workspace.
These are text-files.

For the upload I used:

curl -X POST 'http://localhost:3001/api/v1/document/upload'
-H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
-H 'Content-Type: multipart/form-data'
-F 'file=@/Users/my_user/planned_changes.txt'

I checked via AnythingLLM GUI,
the Upload works and I see the document in custom-documents.
Now I want to move it to my workspace (my_workspace) to be able to use it there.
This should be the same like clicking on the "Move to workspace"-Button within the GUI.

Therefore I tried:

curl -X 'POST'
'http://localhost:3001/api/v1/workspace/my_workspace/update-embeddings'
-H 'accept: application/json'
-H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
-H 'Content-Type: application/json'
-d '{"adds": [ "custom-documents/planned_changes.txt" ]}'

I checked via AnythingLLM GUI but the document is still within custom-documents and not within my workspace.
So what am I doing wrong here or is this a bug?

Kindly Regards,
Tom

Are there known steps to reproduce?

curl -X POST 'http://localhost:3001/api/v1/document/upload'
-H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
-H 'Content-Type: multipart/form-data'
-F 'file=@/Users/my_user/planned_changes.txt'

curl -X 'POST'
'http://localhost:3001/api/v1/workspace/my_workspace/update-embeddings'
-H 'accept: application/json'
-H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
-H 'Content-Type: application/json'
-d '{"adds": [ "custom-documents/planned_changes.txt" ]}'

Originally created by @tbar74235 on GitHub (Feb 19, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3275 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? Hi there, I like to create an automatism to upload files to a workspace. These are text-files. For the upload I used: curl -X POST 'http://localhost:3001/api/v1/document/upload' \ -H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \ -H 'Content-Type: multipart/form-data' \ -F 'file=@/Users/my_user/planned_changes.txt' I checked via AnythingLLM GUI, the Upload works and I see the document in custom-documents. Now I want to move it to my workspace (my_workspace) to be able to use it there. This should be the same like clicking on the "Move to workspace"-Button within the GUI. Therefore I tried: curl -X 'POST' \ 'http://localhost:3001/api/v1/workspace/my_workspace/update-embeddings' \ -H 'accept: application/json' \ -H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \ -H 'Content-Type: application/json' \ -d '{"adds": [ "custom-documents/planned_changes.txt" ]}' I checked via AnythingLLM GUI but the document is still within custom-documents and not within my workspace. So what am I doing wrong here or is this a bug? Kindly Regards, Tom ### Are there known steps to reproduce? curl -X POST 'http://localhost:3001/api/v1/document/upload' \ -H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \ -H 'Content-Type: multipart/form-data' \ -F 'file=@/Users/my_user/planned_changes.txt' curl -X 'POST' \ 'http://localhost:3001/api/v1/workspace/my_workspace/update-embeddings' \ -H 'accept: application/json' \ -H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \ -H 'Content-Type: application/json' \ -d '{"adds": [ "custom-documents/planned_changes.txt" ]}'
yindo added the possible bug label 2026-02-22 18:28:10 -05:00
yindo closed this issue 2026-02-22 18:28:10 -05:00
Author
Owner

@MiguelGarcia-Paccar commented on GitHub (Feb 19, 2025):

Im working from desktop, same issue, i find it impossible to embed to workspace

@MiguelGarcia-Paccar commented on GitHub (Feb 19, 2025): Im working from desktop, same issue, i find it impossible to embed to workspace
Author
Owner

@youngforblbl commented on GitHub (Feb 19, 2025):

me too, i can't move it by post

@youngforblbl commented on GitHub (Feb 19, 2025): me too, i can't move it by post
Author
Owner

@timothycarambat commented on GitHub (Feb 19, 2025):

custom-documents/planned_changes.txt"

There is no hash in this name and it is not JSON - so this is not the filename of the stored file. We do not raw copy the exact document and all documents have a hash appended to the end to prevent document name collisions. Your actual document is called something like custom-documents/planned_changes-uuid.json.

Image

Due to this uniqueness requirement, when you run

curl -X POST 'http://localhost:3001/api/v1/document/upload'
-H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
-H 'Content-Type: multipart/form-data'
-F 'file=@/Users/my_user/planned_changes.txt'

You are ignoring the response body, which has the value you need as the location key.

{
    "success": true,
    "error": null,
    "documents": [
        {
            "id": "53ae71da-a00d-4d2d-ac44-7e69e34cb0ef",
            "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/Receipt-2967-8118.pdf",
            "title": "Receipt-2967-8118.pdf",
            "docAuthor": "no author found",
            "description": "No description found.",
            "docSource": "pdf file uploaded by the user.",
            "chunkSource": "",
            "published": "2/19/2025, 12:00:53 PM",
            "wordCount": 47,
            "pageContent":"text of document here",
            "token_count_estimate": 207,
            "location": "custom-documents/Receipt-2967-8118.pdf-53ae71da-a00d-4d2d-ac44-7e69e34cb0ef.json"
        }
    ]
}

Use custom-documents/Receipt-2967-8118.pdf-53ae71da-a00d-4d2d-ac44-7e69e34cb0ef.json in update embedding instead of what you have and it works.

@timothycarambat commented on GitHub (Feb 19, 2025): > custom-documents/planned_changes.txt" There is no hash in this name and it is not JSON - so this is _not the filename of the stored file_. We do not raw copy the exact document and all documents have a hash appended to the end to prevent document name collisions. Your actual document is called something like `custom-documents/planned_changes-uuid.json`. <img width="1401" alt="Image" src="https://github.com/user-attachments/assets/db389959-da0d-4c93-a0b2-ffc908f2c94a" /> Due to this uniqueness requirement, when you run ``` curl -X POST 'http://localhost:3001/api/v1/document/upload' -H 'Authorization: Bearer XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' -H 'Content-Type: multipart/form-data' -F 'file=@/Users/my_user/planned_changes.txt' ``` You are ignoring the response body, which has the value you need as the `location` key. ```json { "success": true, "error": null, "documents": [ { "id": "53ae71da-a00d-4d2d-ac44-7e69e34cb0ef", "url": "file:///Users/tim/Documents/anything-llm/collector/hotdir/Receipt-2967-8118.pdf", "title": "Receipt-2967-8118.pdf", "docAuthor": "no author found", "description": "No description found.", "docSource": "pdf file uploaded by the user.", "chunkSource": "", "published": "2/19/2025, 12:00:53 PM", "wordCount": 47, "pageContent":"text of document here", "token_count_estimate": 207, "location": "custom-documents/Receipt-2967-8118.pdf-53ae71da-a00d-4d2d-ac44-7e69e34cb0ef.json" } ] } ``` Use `custom-documents/Receipt-2967-8118.pdf-53ae71da-a00d-4d2d-ac44-7e69e34cb0ef.json` in update embedding instead of what you have and it works.
yindo changed title from [BUG]: Move to workspace does not work via AnythingLLM API to [GH-ISSUE #3275] [BUG]: Move to workspace does not work via AnythingLLM API 2026-06-05 14:44:33 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2106