HTML body

Replace fields on an HTML surface body

Partial-update friendly. Any of html / css / js can be omitted to leave the column unchanged; pass empty string to clear. HTML is sanitized at write time (see UpdateHtmlSchema). Emits html.created on first write to a surface, html.updated on subsequent writes — both carry per-field byte counts so webhooks can fan out a meaningful signal. Requires editor role.

put/api/workspaces/{slug}/html

Request

  • Base URL
    https://trydock.ai
  • Auth
    HTTP bearer

Path parameters

slugstring required

Request body

surface_slugstring

Optional html surface slug. Omit to write to the primary html surface (lowest position).

htmlstring

Sanitized at write time. Caps: 50 KB per field. Omit to leave the column unchanged; pass empty string to clear. Sanitizer strips <script>, every on* event handler, javascript:/vbscript:/file:/data:text/html URIs, <iframe>, <object>, <embed>, <foreignobject>, <meta>, <base>, <link>, formaction smuggling. Allows inline <style>, ARIA attrs, form markup (rendered but inert), data:image/* URIs.

cssstring

CSS source. Cap: 100 KB. Stored verbatim. Omit to leave unchanged; pass empty string to clear.

jsstring

JS source. Cap: 100 KB. Stored but not executed at v1.

Response

Written.

htmlstring required

Sanitized HTML body. Empty string when the surface exists but no body has been written yet.

cssstring required

CSS source. Applied inside the sandboxed iframe.

jsstring required

JS source. Stored but NOT executed at v1 — the sandbox iframe is scripts-off. Interactive mode lands in a later PR.

updatedAtstring date-time nullable required
updatedBystring nullable required
updatedByPrincipalTypestring nullable required
surfaceSlugstring nullable required

Slug of the resolved html surface. Null when the workspace has no html surface yet.

Changes

No recorded changes to this operation across all 2 revisions of this API.