Skip to navigation

Replace a piece of a document

View as Markdown

Replace one piece of text in a document’s markdown body, without sending the full body. Give oldText exactly as it is in the document (read it with read_doc). oldText must occur one time. Basement records a new version that you can restore. You cannot change agent-memory documents (isAgentMemory in list_docs). Requires write access.

Authentication

AuthorizationBearer

A Basement key (bsmt_...), from Agents, Connect in the app.

Request

This endpoint expects an object.
docIdstringRequired

The document ID from list_docs

oldTextstringRequired
The text to replace, exactly as it is in the document
newTextstringRequired
The new text. An empty string deletes oldText
changeSummarystringRequired
One line on what changed and why

Response

The tool's answer.
oktrue
noopboolean
true when the text was already the same
versionCountinteger
The document's new version

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error