enhancedocs
For agentsOpen Enhance ↗
Reference / canvas.edit

Enhance documentation

canvas.edit

Change selected text, styles, names, duplicates, or positions in one atomic design edit.

↓ Markdown

canvas.edit

mutation write

Use when the requested change exactly matches canvas.edit; read the current state first when a version or identifier may have changed.

Before calling

  • Authenticate as the accountable Enhance person.
  • Use only resource identifiers returned by an earlier capability result or supplied by the person.
  • Reuse clientToken only when retrying this exact mutation input.

Input

Show complete JSON Schema
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"canvas":{"type":"string","minLength":1,"description":"Canvas UUID or full canvas/selection URL; selection limits the entire edit batch."},"baseVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Exact version to edit, including the version returned by a previous successful write."},"edits":{"minItems":1,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"set_text"},"nodeId":{"type":"string","minLength":1},"text":{"type":"string"}},"required":["kind","nodeId","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"set_styles"},"nodeIds":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"styles":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"}]}}},"required":["kind","nodeIds","styles"]},{"type":"object","properties":{"kind":{"type":"string","const":"rename"},"nodeId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["kind","nodeId","name"]},{"type":"object","properties":{"kind":{"type":"string","const":"duplicate"},"nodeIds":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"parentId":{"type":"string","minLength":1}},"required":["kind","nodeIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"move"},"nodeId":{"type":"string","minLength":1},"destination":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"before"},"nodeId":{"type":"string","minLength":1}},"required":["kind","nodeId"]},{"type":"object","properties":{"kind":{"type":"string","const":"after"},"nodeId":{"type":"string","minLength":1}},"required":["kind","nodeId"]},{"type":"object","properties":{"kind":{"type":"string","const":"parent"},"parentId":{"type":"string","minLength":1},"index":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","parentId"]}]}},"required":["kind","nodeId","destination"]}]},"description":"Sequential text, style, rename, duplicate or move edits, committed atomically. Target existing node IDs."}},"required":["canvas","baseVersion","edits"]}

Example

Show example input
{
 "canvas": "00000000-0000-4000-8000-000000000010",
 "baseVersion": 1,
 "edits": [
  {
   "kind": "set_text",
   "nodeId": "text_title",
   "text": "Today"
  }
 ]
}

Result

Returns a typed canvas.edit result from the Enhance API without transport-specific prose.

Recovery

  • BAD_REQUEST: correct the named fields and call again.
  • UNAUTHORIZED: restore Enhance authentication, then retry once.
  • FORBIDDEN or NOT_FOUND: check the supplied resource and selection; do not substitute unrelated content. Ask for corrected access or scope if needed.
  • CONFLICT: read the current resource, merge the intended change, and retry with its version.
  • INTERNAL: run Enhance diagnostics, report the failure, and stop repeating the call.

Continue with

  • Reuse the committed version for the next edit. Render the affected screen when the requested visual change is ready to review.

Compatibility: 3719ce802dc74b4fb8eb3a46e9b96ca19b4e159190a453e6f3e0e96bb56ba4ec.