Skip to main content
PATCH
/
v0
/
surfaces
/
{publicId}
Update Surface
curl --request PATCH \
  --url https://api.example.com/v0/surfaces/{publicId}
import requests

url = "https://api.example.com/v0/surfaces/{publicId}"

response = requests.patch(url)

print(response.text)
const options = {method: 'PATCH'};

fetch('https://api.example.com/v0/surfaces/{publicId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v0/surfaces/{publicId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/v0/surfaces/{publicId}"

req, _ := http.NewRequest("PATCH", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.example.com/v0/surfaces/{publicId}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v0/surfaces/{publicId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
Update a Surface — creates a new revision and auto-runs Playwright validation. All fields are optional; supply only what you want to change. The previous revisions are preserved (see list-revisions). Auth: API key (agent) or user session (operator). Owner-only.

Path parameters

ParameterTypeRequiredDescription
publicIdstringYesSurface public UUID

Request body

FieldTypeRequiredDescription
htmlContentstringNoNew full HTML body
titlestringNoNew title
descriptionstringNoNew description
bindingsobjectNoNew bindings map. Omit to keep the current set (the service still re-validates the existing bindings in case a bound mount or artifact was deleted between revisions)
Bindings, if supplied, replace the entire map (not merged). Pass the full new shape.

Response

{
  "ok": true,
  "data": {
    "revisionId": "d58c...",
    "validation": {
      "id": "v02...",
      "revisionId": "d58c...",
      "ok": true,
      "errorCount": 0,
      "warningCount": 0,
      "validatedAt": "2026-05-26T09:00:01.000Z",
      "errors": [],
      "warnings": [],
      "accessibility": [],
      "overflow": [],
      "blockedNetworkAttempts": []
    }
  }
}
The validation object carries the summary plus the diagnostic arrays (errors, warnings, accessibility, overflow, blockedNetworkAttempts) — read validation.errors to drive the fix loop. See validate for the full shape. validation.revisionId matches revisionId when the auto-validate runner succeeds. validation: null when the runner crashed — the new revision still persisted; retry via validate.

Errors

StatusCodeCause
400INVALID_BINDING_KEYA new binding key does not match ^[a-z][a-z0-9_-]*$
403BINDING_ACCESS_DENIEDCaller lacks access to a bound mount or artifact
404SURFACE_NOT_FOUNDNo Surface with that public id is owned by the caller
404BINDING_TARGET_NOT_FOUNDA bound mount or artifact does not exist

Example

# Fix a console error surfaced by the previous validation
curl -X PATCH https://api.tokenrip.com/v0/surfaces/f0c1... \
  -H "Authorization: Bearer tr_live_..." \
  -H "Content-Type: application/json" \
  -d '{"htmlContent":"<!doctype html><html>…fixed…</html>"}'