Restore a version into the draft
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
Copies a version into the draft so the person can look it over; nothing goes live until it is published. Also at POST /v1/sites/{siteId}/versions/{versionId}/restore.
Request example
curl --request POST \ --url 'https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/versions/{versionId}/restore' \ --header 'x-access-token: <api-token>' \ --header 'Content-Type: application/json' \ --data '{ "baseRevision": "<string>"}'const response = await fetch('https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/versions/{versionId}/restore', { method: 'POST', headers: { "x-access-token": "<api-token>", "Content-Type": "application/json" }, body: JSON.stringify({ "baseRevision": "<string>" }),});
const data = await response.json();console.log(data);import requests
response = requests.request( "POST", "https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/versions/{versionId}/restore", headers={ "x-access-token": "<api-token>", "Content-Type": "application/json" }, json={ "baseRevision": "<string>" },)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/versions/{versionId}/restore", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{ "baseRevision": "<string>"}', CURLOPT_HTTPHEADER => [ "x-access-token: <api-token>", "Content-Type: application/json", ],]);
$response = curl_exec($curl);curl_close($curl);
echo $response;package main
import ( "fmt" "io" "net/http" "strings")
func main() { req, _ := http.NewRequest("POST", "https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/versions/{versionId}/restore", strings.NewReader(`{ "baseRevision": "<string>"}`)) req.Header.Add("x-access-token", "<api-token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/versions/{versionId}/restore")) .header("x-access-token", "<api-token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{\n \"baseRevision\": \"<string>\"\n}")) .build();
HttpResponse<String> response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Try it
Response headers
Authorizations
x-access-tokenstringheaderOrganization API token. Generate from Organization Settings → API Tokens.
AuthorizationBearer <token>headerorOAuth 2.1 access token. Obtained via the OAuth PKCE flow at
/oauth/token.
Send one of these. See Authentication.
Path parameters
orgIdstringpathrequiredYour organization ID. Any other organization returns
404.siteIdstring<uuid>pathrequiredThe Site's
idfrom List Sites.versionIdstring<uuid>pathrequiredThe version's
idfrom List a Site's versions.
Request body
baseRevisionstring- Max length
64
{ "baseRevision": "<string>"}Responses
200application/json
Restored into the draft; the new revision, the version number and the diff against live.
payloadobjectShow child attributes
revisionstringrestored_versionintegerdiffSiteDiffShow child attributes
changedbooleanpagesobject[]blocksobject[]settingsobject[]Show child attributes
keystringlabelstring
summarystring[]One plain sentence per change, for the person to read.
403
SCOPE_REQUIRED— the token lacksread:sites(orread:marketing,read:learning,read:awards) for reads, or the matchingwrite:scope for writes.FORBIDDEN— the token's user cannot edit this Site.
404
No such version on this Site.
409
The Site changed since baseRevision (code: SITE_DRAFT_STALE).
Response examples
{ "payload": { "revision": "<string>", "restored_version": 123, "diff": { "changed": true, "pages": [ {} ], "blocks": [ {} ], "settings": [ { "key": "<string>", "label": "<string>" } ], "summary": [ "<string>" ] } }}