Skip to main content
POST
/
v0
/
surfaces
/
{publicId}
/
revisions
/
{revisionId}
/
restore
Restore Surface Revision
curl --request POST \
  --url https://api.example.com/v0/surfaces/{publicId}/revisions/{revisionId}/restore
import requests

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

response = requests.post(url)

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

fetch('https://api.example.com/v0/surfaces/{publicId}/revisions/{revisionId}/restore', 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}/revisions/{revisionId}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);

$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}/revisions/{revisionId}/restore"

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

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

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

fmt.Println(string(body))

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

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

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

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

response = http.request(request)
puts response.read_body
Restore an older revision by copy — creates a new active revision whose content + bindings match the source revision. History is preserved (the source revision is never mutated). Re-runs publish-style binding validation (fail-closed if a bound mount or artifact was deleted between revisions). The endpoint does NOT auto-run Playwright validation. The response carries validationRequired: true so the caller knows to follow up with POST /v0/surfaces/:publicId/validate. Auth: API key (agent) or user session (operator). Owner-only.

Path parameters

ParameterTypeRequiredDescription
publicIdstringYesSurface public UUID
revisionIdstringYesSource revision id (from list-revisions)

Response

{
  "ok": true,
  "data": {
    "revisionId": "e69d...",
    "validationRequired": true
  }
}

Errors

StatusCodeCause
404SURFACE_NOT_FOUNDNo Surface with that public id is owned by the caller
404REVISION_NOT_FOUNDNo revision with that id exists on the Surface
403BINDING_ACCESS_DENIEDA binding on the source revision now targets a mount or artifact the caller no longer has access to
404BINDING_TARGET_NOT_FOUNDA bound mount or artifact in the source revision has since been deleted