[GH-ISSUE #5172] [BUG]: Cannot move/link document into users workspace #4949

Closed
opened 2026-06-05 14:51:04 -04:00 by yindo · 1 comment
Owner

Originally created by @ohromeo on GitHub (Mar 8, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5172

Originally assigned to: @timothycarambat on GitHub.

How are you running AnythingLLM?

AnythingLLM desktop app, php

What happened?

uploaded file, shows in the custom-documents folder, but cannot link or move to the users workspace.
tried every possible api method including:
curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"workspaceId\":6}" http://localhost:3001/api/v1/document/0b68969d-b339-4d9c-adaa-82ddc52a2991/pin
curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"textContent\":\"test content\",\"addToWorkspaces\":[\"user_user69aacfb305fb46f43bac6d60a6d49\"]}" http://localhost:3001/api/v1/document/raw-text
curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"textContent\":\"test content\",\"metadata\":{\"title\":\"test.pdf\"},\"addToWorkspaces\":[\"user_user69aacfb305fb46f43bac6d60a6d49\"]}" http://localhost:3001/api/v1/document/raw-text
and the calls go on... you name we tried it, documents will not move out of the custom-documents folder.

any insight appreciated.

Are there known steps to reproduce?

upload documents via the api's and try to move to the users workspace

Originally created by @ohromeo on GitHub (Mar 8, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5172 Originally assigned to: @timothycarambat on GitHub. ### How are you running AnythingLLM? AnythingLLM desktop app, php ### What happened? uploaded file, shows in the custom-documents folder, but cannot link or move to the users workspace. tried every possible api method including: `curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"workspaceId\":6}" http://localhost:3001/api/v1/document/0b68969d-b339-4d9c-adaa-82ddc52a2991/pin ` ` curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"textContent\":\"test content\",\"addToWorkspaces\":[\"user_user69aacfb305fb46f43bac6d60a6d49\"]}" http://localhost:3001/api/v1/document/raw-text ` ` curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"textContent\":\"test content\",\"metadata\":{\"title\":\"test.pdf\"},\"addToWorkspaces\":[\"user_user69aacfb305fb46f43bac6d60a6d49\"]}" http://localhost:3001/api/v1/document/raw-text ` and the calls go on... you name we tried it, documents will not move out of the custom-documents folder. any insight appreciated. ### Are there known steps to reproduce? upload documents via the api's and try to move to the users workspace
yindo added the possible buginvestigating labels 2026-06-05 14:51:04 -04:00
yindo closed this issue 2026-06-05 14:51:04 -04:00
Author
Owner

@timothycarambat commented on GitHub (Mar 9, 2026):

Are you checking the responses from the API call to add a document to workspace?

This one has to do with pinning, so this one for sure isnt helping right now

curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"workspaceId\":6}" http://localhost:3001/api/v1/document/0b68969d-b339-4d9c-adaa-82ddc52a2991/pi

This one returns with a 422 error

curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"textContent\":\"test content\",\"addToWorkspaces\":[\"user_user69aacfb305fb46f43bac6d60a6d49\"]}" 
{
    "success": false,
    "error": "You are missing required metadata key:value pairs in your request. Required metadata key:values are 'title'"
}

This one results in an internal server error because in the swagger docs addToWorkspaces is supposed to be a CSV, not an array of slugs! Will update these endpoints to catch this early so the error is more clear, but that is your issue.
Image

curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"textContent\":\"test content\",\"metadata\":{\"title\":\"test.pdf\"},\"addToWorkspaces\":[\"user_user69aacfb305fb46f43bac6d60a6d49\"]}" http://localhost:3001/api/v1/document/raw-text

This, however, would work (and will log no-workspace found error if slug is DNF)

curl --location 'http://localhost:3001/api/v1/document/raw-text' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ********' \
--data '{
    "textContent": "test content",
    "addToWorkspaces": "user_user69aacfb305fb46f43bac6d60a6d49",
    "metadata": {
        "title": "test.pdf"
    }
}'

multiple slugs

curl --location 'http://localhost:3001/api/v1/document/raw-text' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ********' \
--data '{
    "textContent": "test content",
    "addToWorkspaces": "user_user69aacfb305fb46f43bac6d60a6d49,workspace-two,my-workspace",
    "metadata": {
        "title": "test.pdf"
    }
}'
<!-- gh-comment-id:4025839574 --> @timothycarambat commented on GitHub (Mar 9, 2026): Are you checking the responses from the API call to add a document to workspace? This one has to do with pinning, so this one for sure isnt helping right now ``` curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"workspaceId\":6}" http://localhost:3001/api/v1/document/0b68969d-b339-4d9c-adaa-82ddc52a2991/pi ``` This one returns with a 422 error ``` curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"textContent\":\"test content\",\"addToWorkspaces\":[\"user_user69aacfb305fb46f43bac6d60a6d49\"]}" ``` ```json { "success": false, "error": "You are missing required metadata key:value pairs in your request. Required metadata key:values are 'title'" } ``` This one results in an internal server error because in the swagger docs `addToWorkspaces` is supposed to be a CSV, not an array of slugs! Will update these endpoints to catch this early so the error is more clear, but that is your issue. <img width="1255" height="305" alt="Image" src="https://github.com/user-attachments/assets/60c81434-0147-4456-8b88-535aab0d291c" /> ``` curl -X POST -H "Authorization: Bearer API-KEY" -H "Content-Type: application/json" -d "{\"textContent\":\"test content\",\"metadata\":{\"title\":\"test.pdf\"},\"addToWorkspaces\":[\"user_user69aacfb305fb46f43bac6d60a6d49\"]}" http://localhost:3001/api/v1/document/raw-text ``` This, however, would work (and will log no-workspace found error if slug is DNF) ```bash curl --location 'http://localhost:3001/api/v1/document/raw-text' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ********' \ --data '{ "textContent": "test content", "addToWorkspaces": "user_user69aacfb305fb46f43bac6d60a6d49", "metadata": { "title": "test.pdf" } }' ``` multiple slugs ```bash curl --location 'http://localhost:3001/api/v1/document/raw-text' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ********' \ --data '{ "textContent": "test content", "addToWorkspaces": "user_user69aacfb305fb46f43bac6d60a6d49,workspace-two,my-workspace", "metadata": { "title": "test.pdf" } }' ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4949