Preview a Site as a role on a device
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
A short-lived link to the draft as one role sees it on one device, plus a structured description of what that role sees (pages and blocks), for clients that cannot open the link. Roles depend on the product: visitor and invited (Marketing), visitor and learner (Learning), visitor, submitter, evaluator and, on event portals, speaker (Awards). Also at GET /v1/sites/{siteId}/preview.
Request example
curl --request GET \ --url 'https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/preview' \ --header 'x-access-token: <api-token>'const response = await fetch('https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/preview', { method: 'GET', headers: { "x-access-token": "<api-token>" },});
const data = await response.json();console.log(data);import requests
response = requests.request( "GET", "https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/preview", headers={ "x-access-token": "<api-token>" },)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/preview", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "x-access-token: <api-token>", ],]);
$response = curl_exec($curl);curl_close($curl);
echo $response;package main
import ( "fmt" "io" "net/http")
func main() { req, _ := http.NewRequest("GET", "https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/preview", nil) req.Header.Add("x-access-token", "<api-token>")
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}/preview")) .header("x-access-token", "<api-token>") .method("GET", HttpRequest.BodyPublishers.noBody()) .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.
Query parameters
rolestringqueryOne of the Site's
roles(defaultvisitor).devicestringquery- Allowed values
"desktop", "tablet", "mobile"
pagestringqueryhome, a page id, slug or exact title (defaulthome).
Responses
200application/json
OK
payloadSitePreviewShow child attributes
rolestringdevicestringviewportobjectShow child attributes
widthintegerheightinteger
pageobjectShow child attributes
refstringtitlestringpathstring
preview_urlstring | nullOpens the draft as this role; expires at
expires_at.expires_atstring<date-time>seesobjectWhat this role sees, for clients that cannot open the link.
Show child attributes
pagesobject[]blocksobject[]
notestring | null
400
A role this Site does not have.
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.
Response examples
{ "payload": { "role": "<string>", "device": "<string>", "viewport": { "width": 123, "height": 123 }, "page": { "ref": "<string>", "title": "<string>", "path": "<string>" }, "preview_url": "<string>", "expires_at": "2026-01-15T09:30:00Z", "sees": { "pages": [ {} ], "blocks": [ {} ] }, "note": "<string>" }}