Publish a Site
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
The draft goes live. Only after the person has seen the diff (and a preview) and said OK: send confirmed: true and the revision of the diff they approved; an edit made after their OK answers 409. Called by an AI assistant, it answers 202 with status: needs_approval and a link: a person approves it in Sessionboard, and it runs as them. Every publish is a version you can restore. Also at POST /v1/sites/{siteId}/publish.
Request example
curl --request POST \ --url 'https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/publish' \ --header 'x-access-token: <api-token>' \ --header 'Content-Type: application/json' \ --data '{ "revision": "<string>", "confirmed": true}'const response = await fetch('https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/publish', { method: 'POST', headers: { "x-access-token": "<api-token>", "Content-Type": "application/json" }, body: JSON.stringify({ "revision": "<string>", "confirmed": true }),});
const data = await response.json();console.log(data);import requests
response = requests.request( "POST", "https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/publish", headers={ "x-access-token": "<api-token>", "Content-Type": "application/json" }, json={ "revision": "<string>", "confirmed": True },)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/publish", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{ "revision": "<string>", "confirmed": true}', 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}/publish", strings.NewReader(`{ "revision": "<string>", "confirmed": true}`)) 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}/publish")) .header("x-access-token", "<api-token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{\n \"revision\": \"<string>\",\n \"confirmed\": true\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.
Request body
revisionstringrequiredThe
revisionof the diff the person approved.- Max length
64
confirmedbooleanrequiredtrueonly after the person said OK.
{ "revision": "<string>", "confirmed": true}Responses
200application/json
Published.
payloadobjectShow child attributes
publishedbooleanversioninteger | nullrevisionstringurlstring | null
202
Waiting for a person: status: needs_approval, approval_id and url to approve it in Sessionboard.
400
confirmed is not true.
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.
409
The draft changed after the approved revision (code: SITE_DRAFT_STALE).
Response examples
{ "payload": { "published": true, "version": 123, "revision": "<string>", "url": "<string>" }}