Coview high-level agent API Agents: use the Coview Agent API. Do not write directly to document sync endpoints. Base URL: https://coview.dev/api/agents Use POST https://coview.dev/api/agents/{method} with JSON bodies. The live machine-readable catalog is: GET https://coview.dev/api/agents Generic presentation example: GET https://coview.dev/api/agents/examples/presentation Document id: If the page URL is https://coview.dev/d/my-document-id, use documentId "my-document-id". write_html also accepts documentUrl, so agents can pass the canvas link directly. Use create_document only when you need a fresh document. Do not use raw operation batches in agent or MCP calls. The app's document change-store API under /api/v1/documents/... remains available for the Coview UI/runtime, but it is not the agent-facing edit API. Fast edit flow: 1. Call get_basic_info. 2. Use get_tree_summary to choose targets. 3. Inspect specific nodes with get_node. 4. Create or replace larger sections with write_html. 5. Refine with update_styles, set_text_content, rename_nodes, duplicate_nodes, move_nodes, or delete_nodes. 6. Use get_screenshot to visually check layout, clipping, contrast, and spacing. It defaults to fast SVG rendering without Browser Rendering. For creating or replacing a presentation, use write_html with full HTML frames. Send multiple 1280x720 section elements and pass targetNodeId "root" when replacing the canvas directly. Use mode "insert-children" to append top-level objects to root or append inside an existing frame/flex-frame. Layout guidance: - Coview supports frame, flex-frame, rectangle, text, and image nodes. - Prefer flex-frame or normal document flow for padded groups, cards, rows, columns, navs, and repeated content. - Use display:flex, flex-direction, gap, padding, align-items, and justify-content for those layouts. - Use position:absolute only for independent artboard placement. - Absolute left/top/right/bottom values are measured from the positioned parent's outer box, not from the parent's padding/content box. - Parent padding does not automatically offset absolute children. High-level methods: get_guide Return fast workflow and layout guidance. get_basic_info Return document metadata, canvas summary, endpoint URLs, fonts, and guidance. create_document Create a blank document. Returns: {"documentId":"doc-id","path":"/d/doc-id","url":"https://coview.dev/d/doc-id"} request_access_token Create a short-lived bearer token for one private document from an authenticated context. Body: {"documentId":"my-document-id","role":"editor"} request_user_validation Create a pending user consent request. The response includes consentUrl plus a bearer token that only becomes active after the user approves the consent screen. Body: {"documentId":"my-document-id","role":"editor"} Returns: {"requestId":"acr_...","consentUrl":"https://coview.dev/agent/consent?request=acr_...","authorization":"Bearer coview_user_agent_...","status":"pending"} update_document_metadata Update title and other document metadata. Body: {"documentId":"my-document-id","metadata":{"title":"Poster draft"}} get_selection Return the current selected node. get_node Return geometry, style, text, parent, and children for one node or root. Body: {"documentId":"my-document-id","nodeId":"root"} Optional filters: includeStyle, includeText, includeChildIds. Each defaults to true. get_children List direct children for root or a node. get_tree_summary Return a compact hierarchy for picking edit targets. Body: {"documentId":"my-document-id","nodeId":"root","depth":3} The optional depth value defaults to 3. get_screenshot Return an image for visual verification. It defaults to fast SVG rendering without Browser Rendering; pass "renderer":"browser" only when you need final PNG browser fidelity. Body: {"documentId":"my-document-id","nodeId":"root","scale":1} Optional: renderer can be "fast" or "browser". Omit it for fast SVG. Returns: {"documentId":"my-document-id","nodeId":"root","format":"svg","mimeType":"image/svg+xml","renderer":"fast","width":1200,"height":800,"scale":1,"data":"base64..."} get_jsx Return inline-style JSX for a node. get_computed_styles Return inline style objects for one or more nodes. get_font_family_info Check available font families and weights before styling text. create_artboard Create a top-level frame or flex-frame. If x/y are omitted, Coview places it in the next open canvas slot. Body: {"documentId":"my-document-id","name":"Poster","styles":{"width":390,"height":844,"background":"#ffffff"}} Returns: {"version":1,"artboard":{"id":"frame-id","rootId":"root-id","name":"Poster","type":"frame","x":120,"y":120,"width":390,"height":844}} write_html Parse normal HTML using one conversion path. By default, write_html replaces the selected node or root canvas content; pass targetNodeId to replace a specific node, or pass targetNodeId "root" to force root canvas replacement even when another node is selected. Replace mode accepts one or more root HTML elements. Use mode "insert-children" to append top-level objects to root or add nodes inside an existing frame/flex-frame. Coview preserves normalized CSS intent: property names become camelCase, authored CSS values stay CSS strings, mixed direct text is preserved in flow order, and data-coview-name sets the Coview layer name. Rendering computes browser-like text flow and intrinsic sizes; write_html does not write inferred text width/height or expand clipped text into node data. The response includes inserted node geometry, warnings, and a recommended get_screenshot call. Body: {"documentUrl":"https://coview.dev/d/my-document-id","mode":"replace","targetNodeId":"root","html":"

Project plan

A clear generic presentation frame written from HTML.

"} Returns: {"version":2,"targetNodeId":"root","mode":"replace","insertedIds":["slide-title"],"inserted":[{"nodeId":"slide-title","x":0,"y":0,"width":1280,"height":720,"visible":true}],"warnings":[],"recommendedNextCall":{"method":"get_screenshot","params":{"documentId":"my-document-id","nodeId":"root"}}} insert_nodes Insert structured Coview nodes into a parent or as top-level canvas nodes. update_styles Merge style properties into nodes. Numeric width, height, x, and y also update top-level artboard geometry. Body: {"documentId":"my-document-id","updates":[{"nodeIds":["frame-id"],"styles":{"background":"#f8fafc","padding":32}}]} Returns: {"version":4,"updatedIds":["frame-id"]} set_text_content Set text content for text nodes and convert targets to text when needed. rename_nodes Rename nodes for clearer layer inspection. duplicate_nodes Duplicate nodes with fresh ids. move_nodes Move, reparent, or reorder nodes without resizing them. Use {x,y} for canvas moves, {parentId,x,y,index} for parent-local moves/reparenting, or {beforeNodeId}/{afterNodeId} for sibling ordering. Use it for layer order, reparent/group, and computed alignment. Examples: {"documentId":"doc_123","nodeIds":["card"],"placement":{"x":120,"y":80}} {"documentId":"doc_123","nodeIds":["badge"],"placement":{"parentId":"card-frame","x":24,"y":32}} {"documentId":"doc_123","nodeIds":["cta"],"placement":{"parentId":"hero-frame","index":1}} {"documentId":"doc_123","nodeIds":["eyebrow"],"placement":{"beforeNodeId":"headline"}} delete_nodes Delete nodes by id. Create or replace a presentation from HTML: curl -s https://coview.dev/api/agents/write_html \ -H "content-type: application/json" \ -d '{"documentUrl":"https://coview.dev/d/my-document-id","targetNodeId":"root","html":"

Project plan

A clear opening frame.

Agenda

Context, approach, and next steps.

"}' Remote MCP: https://coview.dev/mcp MCP exposes the same high-level tool names above. Initialize, call tools/list, use get_guide or get_basic_info, edit with high-level tools, then verify with get_screenshot.