---
title: "Read an HTML surface body"
method: GET
path: "/api/workspaces/{slug}/html"
tags: ["HTML body"]
---

# Read an HTML surface body

`GET /api/workspaces/{slug}/html`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/workspaces/{slug}/html`
- Auth: HTTP bearer

Returns the resolved html surface's body (html, css, js). Empty fields when the surface exists but no body has been written yet. 404 when `?surface_slug=` doesn't match a live html surface.

## Path parameters

- `slug` string, required

## Query parameters

- `surface_slug` string: Surface slug for multi-html workspaces. Omit for the primary html surface (lowest position).
- `surface` string: Legacy alias for `surface_slug`. Same semantics. Prefer `surface_slug` in new code.

## Response `200`

Resolved html body.

- object
  - `html` string, required: Sanitized HTML body. Empty string when the surface exists but no body has been written yet.
  - `css` string, required: CSS source. Applied inside the sandboxed iframe.
  - `js` string, required: JS source. Stored but NOT executed at v1 — the sandbox iframe is scripts-off. Interactive mode lands in a later PR.
  - `updatedAt` string, date-time, nullable, required
  - `updatedBy` string, nullable, required
  - `updatedByPrincipalType` string, nullable, required
  - `surfaceSlug` string, nullable, required: Slug of the resolved html surface. Null when the workspace has no html surface yet.

## Other responses

- `404`: `surface_slug` didn't match any live html surface in this workspace.

---

[API](https://skmtc.dev/trydock/apis/dock-rest-api.md) - [All operations](https://skmtc.dev/trydock/apis/dock-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trydock/apis/dock-rest-api/revisions/dd96ae96a412?raw)
