Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Mintplex-Labs/anything-llm/llms.txt

Use this file to discover all available pages before exploring further.

The Documents API controls the raw document library — the central store of parsed files that sit beneath all workspace embeddings. You can upload files directly, scrape URLs, or push plain text through the API; browse the folder hierarchy; create and remove folders; and move files between them. Uploading a document does not automatically embed it into a workspace — use the workspace update-embeddings endpoint for that step. All requests require a valid Bearer token.
The document collector service must be running for file and URL uploads to be processed. If the service is offline you will receive a 500 response with the message "Document processing API is not online".

POST /v1/document/upload

Upload a file to the AnythingLLM document library. The file is parsed, chunked, and stored as a JSON document ready for embedding. Optionally specify workspaces to embed the document into immediately after upload.

Body Parameters

file
file
required
The binary file to upload. Send as multipart/form-data.
addToWorkspaces
string
Comma-separated list of workspace slugs to automatically embed the document into after upload. Example: "workspace-a,workspace-b".
metadata
object
Key-value pairs of metadata to attach to the document. Supported keys: title, docAuthor, description, docSource.

Response Fields

success
boolean
Whether the upload succeeded.
error
string | null
null on success or an error message.
documents
array
curl -X POST https://your-instance.com/api/v1/document/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@/path/to/document.pdf" \
  -F "addToWorkspaces=product-docs,onboarding" \
  -F 'metadata={"title":"Product Manual","docAuthor":"Engineering"}'

POST /v1/document/upload/{folderName}

Upload a file directly into a named sub-folder. If the target folder does not exist it will be created automatically.

Path Parameters

folderName
string
required
Name of the destination folder (e.g. my-folder). Defaults to custom-documents if the path parameter is omitted.

Body Parameters

Same multipart fields as POST /v1/document/upload: file (required), addToWorkspaces, and metadata.

Response Fields

Same response schema as POST /v1/document/upload.
curl -X POST https://your-instance.com/api/v1/document/upload/legal-contracts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@/path/to/contract.pdf"

POST /v1/document/upload-link

Provide a URL for AnythingLLM to scrape, parse, and store as a document. Optionally embed the result into one or more workspaces.

Body Parameters

The publicly accessible URL to scrape (e.g. "https://docs.example.com/overview").
addToWorkspaces
string
Comma-separated workspace slugs to embed the scraped document into after processing.
scraperHeaders
object
Key-value pairs of HTTP headers to send with the scrape request. Useful when the target URL requires authentication or custom headers. Example: { "Authorization": "Bearer token123" }.
metadata
object
Key-value metadata to attach to the scraped document. Supported keys: title, docAuthor, description, docSource.

Response Fields

success
boolean
Upload status.
error
string | null
Error or null.
documents
array
curl -X POST https://your-instance.com/api/v1/document/upload-link \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "link": "https://docs.anythingllm.com/overview",
    "addToWorkspaces": "product-docs"
  }'

POST /v1/document/raw-text

Upload a document by providing its text content directly as a string — no file required. The metadata title key is required.

Body Parameters

textContent
string
required
The full plain-text content to store as a document.
metadata
object
required
Metadata object. The title key is required. Additional keys must match the schema returned by GET /v1/document/metadata-schema.
addToWorkspaces
string
Comma-separated workspace slugs to embed the document into after creation.

Response Fields

Same schema as POST /v1/document/upload.
curl -X POST https://your-instance.com/api/v1/document/raw-text \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "textContent": "AnythingLLM is a self-hosted, all-in-one AI platform...",
    "metadata": {
      "title": "AnythingLLM Overview",
      "docAuthor": "Mintplex Labs",
      "description": "Overview of the AnythingLLM platform"
    },
    "addToWorkspaces": "product-docs"
  }'

GET /v1/documents

List every document currently stored in the local document library, organized as a folder tree.

Response Fields

localFiles
object
curl https://your-instance.com/api/v1/documents \
  -H "Authorization: Bearer YOUR_API_KEY"

GET /v1/documents/folder/{folderName}

Retrieve all documents stored inside a specific folder.

Path Parameters

folderName
string
required
Name of the folder to inspect (e.g. custom-documents or legal-contracts).

Response Fields

folder
string
Name of the queried folder.
documents
array
Array of document metadata objects including name, type, cached, pinnedWorkspaces, and watched.
curl https://your-instance.com/api/v1/documents/folder/custom-documents \
  -H "Authorization: Bearer YOUR_API_KEY"

GET /v1/document/accepted-file-types

Return the file MIME types and corresponding extensions the document collector currently accepts for upload.

Response Fields

types
object
Map of MIME type strings to arrays of file extensions. Example:
{
  "application/pdf": [".pdf"],
  "text/plain": [".txt", ".md"]
}
curl https://your-instance.com/api/v1/document/accepted-file-types \
  -H "Authorization: Bearer YOUR_API_KEY"

GET /v1/document/metadata-schema

Return the known metadata key schema and acceptable value types for use when calling POST /v1/document/raw-text.

Response Fields

schema
object
Map of metadata key names to their accepted value type descriptor (e.g. "string | number | nullable" or "string"). The title key is always present and required.
curl https://your-instance.com/api/v1/document/metadata-schema \
  -H "Authorization: Bearer YOUR_API_KEY"

GET /v1/document/{docName}

Fetch the full metadata for a single stored document by its internal name (the UUID-suffixed JSON filename).

Path Parameters

docName
string
required
Internal document filename as returned in the name field of list responses (e.g. my-file.txt-uuid1234.json).

Response Fields

localFiles
object
Same structure as GET /v1/documents, scoped to the single matched document.
curl "https://your-instance.com/api/v1/document/my-file.txt-bb07c334-4dab-4419-9462-9d00065a49a1.json" \
  -H "Authorization: Bearer YOUR_API_KEY"

POST /v1/document/create-folder

Create a new empty folder inside the documents storage directory.

Body Parameters

name
string
required
Name for the new folder (e.g. "legal-contracts").

Response Fields

success
boolean
Whether the folder was created.
message
string | null
null on success or an error message.
curl -X POST https://your-instance.com/api/v1/document/create-folder \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "legal-contracts"}'

DELETE /v1/document/remove-folder

Remove a folder and all its contained documents from the storage directory. This is irreversible.
Removing a folder permanently deletes its contents from the document library. Any workspace that had those documents embedded will lose access to that context.

Body Parameters

name
string
required
Name of the folder to remove.

Response Fields

success
boolean
Whether the folder was removed.
message
string
"Folder removed successfully" or an error description.
curl -X DELETE https://your-instance.com/api/v1/document/remove-folder \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "old-archive"}'

POST /v1/document/move-files

Move one or more documents from a source path to a destination path within the document library. Both from and to values are relative to the top-level documents/ directory.

Body Parameters

files
array
required
Array of move-operation objects.

Response Fields

success
boolean
Whether all moves completed successfully.
message
string | null
null on success or an error description.
curl -X POST https://your-instance.com/api/v1/document/move-files \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "files": [
      {
        "from": "custom-documents/contract.pdf-fc4beeeb.json",
        "to": "legal-contracts/contract.pdf-fc4beeeb.json"
      }
    ]
  }'

GET /v1/document/generated-files/{filename}

Download a file that was generated by an agent skill (e.g. a PDF, DOCX, XLSX, or PPTX). The storageFilename value appears in the outputs array of a chat response when an agent produces a file.

Path Parameters

filename
string
required
The storage filename returned in the chat response outputs array (e.g. pdf-e9e14f28-d6b6-4f49-91a0-dd331517f567.pdf).

Response

Returns the binary file content with the appropriate Content-Type and Content-Disposition headers for download.
curl -OJ https://your-instance.com/api/v1/document/generated-files/pdf-e9e14f28-d6b6-4f49-91a0-dd331517f567.pdf \
  -H "Authorization: Bearer YOUR_API_KEY"

Build docs developers (and LLMs) love