Skip to content

Documents

Upload documents to give a character knowledge. Uploaded files are automatically chunked, embedded, and indexed — when the character responds, relevant chunks are retrieved and included as context (RAG).

The Document object

json
{
  "id": "doc_AbCdEfGh12345678",
  "createdAt": "2026-01-15T12:00:00Z",
  "characterId": "character_PuTlWmWuynYZu8sP",
  "name": "world-lore.pdf",
  "mimeType": "application/pdf",
  "fileSize": 524288,
  "status": "ready",
  "chunkCount": 42,
  "errorMessage": null
}
FieldTypeDescription
idstringUnique identifier (doc_ prefix)
characterIdstringCharacter this document belongs to
namestringOriginal file name
mimeTypestringFile MIME type
fileSizenumberSize in bytes
statusstringProcessing status (see below)
chunkCountnumberNumber of indexed chunks
errorMessagestring | nullError details if processing failed

Document status

StatusDescription
pendingUploaded, waiting to be processed
processingCurrently being chunked and embedded
readyProcessed and available for retrieval
failedProcessing failed (check errorMessage)

Upload a document

POST /characters/{characterId}/documents

Upload a file as multipart/form-data. Processing happens asynchronously — the response returns immediately with status pending.

Supported file types

TypeMIME type
PDFapplication/pdf
Word (.docx)application/vnd.openxmlformats-officedocument.wordprocessingml.document
Plain texttext/plain
Markdowntext/markdown
HTMLtext/html
Imagesimage/png, image/jpeg, image/webp

Maximum file size: 50 MB.

sh
curl -X POST https://api.mindforge.ai/characters/character_PuTlWmWuynYZu8sP/documents \
  -H "Authorization: Bearer $MINDFORGE_API_KEY" \
  -F "file=@world-lore.pdf"

Returns a Document object with status 202 Accepted.

List documents

GET /characters/{characterId}/documents
sh
curl https://api.mindforge.ai/characters/character_PuTlWmWuynYZu8sP/documents \
  -H "Authorization: Bearer $MINDFORGE_API_KEY"

Get a document

GET /characters/{characterId}/documents/{documentId}

Delete a document

DELETE /characters/{characterId}/documents/{documentId}

Deletes the document and removes all associated chunks from the vector index.

json
{ "id": "doc_AbCdEfGh12345678", "deleted": true }

Reprocess a document

POST /characters/{characterId}/documents/{documentId}/reprocess

Re-queues the document for processing. Useful if processing previously failed or if the chunking pipeline has been updated.

sh
curl -X POST https://api.mindforge.ai/characters/character_PuTlWmWuynYZu8sP/documents/doc_AbCdEfGh12345678/reprocess \
  -H "Authorization: Bearer $MINDFORGE_API_KEY"

Returns the document with status reset to pending.