Brain

PATCH /v1/brain/doc

Surgical str_replace edit of a doc body — oldStr must match exactly once (SDK/CLI; agent uses str_replace_based_edit_tool).

unison-brain
PATCH /v1/brain/doc

Surgical str_replace edit of a doc body — oldStr must match exactly once (SDK/CLI; agent uses str_replace_based_edit_tool).

Required scope: brain:write

Body fields

NameRequiredNotes
pathyes
oldStryes
newStryes
expectedContentHashno

Example

curl -X PATCH 'https://brain.unisonlabs.ai/v1/brain/doc' \
  -H "Authorization: Bearer $UNISON_TOKEN" \
  -H 'content-type: application/json' \
  -d '{"path": "...", "oldStr": "...", "newStr": "..."}'

Returns the JSON described above on success, or an error envelope { "error": { "code", "message" } } on failure.