Replace text inside entity fields

POST /Platform/entities/{entity_type}/edit

Replace text inside entity fields. Use it for text WITHIN a string value; patch sets whole values.

Two writers exist; pick by what you're changing:

old must match exactly once (per entity) unless replace_all is set. When old is not unique, do NOT paste a huge block -- pass anchor (a field name or JSONPath, e.g. a or $.a.b) to scope the replacement to that field's region. Run search first to find the anchor.

Multi-line / block-scalar text: a long string that YAML stores as a | / > block scalar is written with every continuation line indented to the block. You may pass a multi-line old exactly as search shows it (the logical, unfolded value) -- edit matches it against the field's logical value and re-serializes, so you never hand-indent old to the YAML block.

A plain List[string] field renders as a single | literal block scalar -- one physical line per list item, reading like a plain markdown document (no - type: string / value: wrapper). To change one line, edit that line's text with a unique old (use search first); to add/remove/replace whole lines, prefer patch against the array index. Authoring note: such a field may be written as one | block and it is split into one line per newline on load.

Bulk: pass multiple ids to apply the SAME edit across all of them. The edit is validated against EVERY entity first; if any fails validation NOTHING is written (all-or-nothing at the validation boundary). Each successful entity is its own commit.

Do not use text editing to retarget an entity reference. Use patch with the typed object {"entity_type": "Agent", "id": "..."}; bare ID strings do not identify a concrete entity class.

Path parameters

Body parameters

Returns

EntityEditResponse

Example request

curl -X POST "https://api.hilus.ai/Platform/entities/{entity_type}/edit" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'