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).
PATCH /v1/brain/docSurgical 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
| Name | Required | Notes |
|---|---|---|
path | yes | |
oldStr | yes | |
newStr | yes | |
expectedContentHash | no |
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.