Restore a kept version of an issue
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
Puts a kept version's subject, preheader, layout and blocks back on a draft or scheduled issue. The issue as it is now is kept first, so a restore can be undone too. Sends nothing. Returns restored_version, the issue, what_changed and kept. Requires write:marketing; refused for a key restricted to particular events. Also at POST /v1/marketing/newsletter/issues/{issueId}/versions/{versionId}/restore.
Request example
curl --request POST \ --url 'https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/newsletter/issues/{issueId}/versions/{versionId}/restore' \ --header 'x-access-token: <api-token>' \ --header 'Content-Type: application/json' \ --data '{}'const response = await fetch('https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/newsletter/issues/{issueId}/versions/{versionId}/restore', { method: 'POST', headers: { "x-access-token": "<api-token>", "Content-Type": "application/json" }, body: JSON.stringify({}),});
const data = await response.json();console.log(data);import requests
response = requests.request( "POST", "https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/newsletter/issues/{issueId}/versions/{versionId}/restore", headers={ "x-access-token": "<api-token>", "Content-Type": "application/json" }, json={},)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/newsletter/issues/{issueId}/versions/{versionId}/restore", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{}', 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}/marketing/newsletter/issues/{issueId}/versions/{versionId}/restore", strings.NewReader(`{}`)) 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}/marketing/newsletter/issues/{issueId}/versions/{versionId}/restore")) .header("x-access-token", "<api-token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{}")) .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.issueIdstringpathrequiredThe issue
versionIdstringpathrequiredkept.version_idfrom an edit, or an id from the versions list
Request body
bodyobject
{}Responses
200application/json
Restored.
payloadobjectReturned by every edit to an existing Marketing asset (event pages, Sites, lifecycle email proposals, newsletter issues, campaign drafts): what changed, how to undo it, and whether anything reaches people.
Show child attributes
restored_versionintegerissueobjectwhat_changedWhatChangedWhat one edit changed, in plain words.
summaryis one sentence per change ("Changed Hero heading on the home page: “Old” → “New”"); the lists carry the same changes as data. Text is plain (HTML removed) and clipped to 200 characters; a block lists at most 8 changed fields and says how many more there were.Show child attributes
has_changesbooleansummarystring[]addedobject[]Show child attributes
wherestring | null- Example
"on the home page"
whatstring | null- Example
"FAQ"
block_idstring | nullkindstring | nulltextstring | null
changedobject[]Show child attributes
wherestring | nullwhatstring | nullblock_idstring | nullkindstring | nullfieldsobject[]Show child attributes
fieldstringlabelstringbeforestring | nullafterstring | null
more_fieldsinteger
removedobject[]Show child attributes
wherestring | nullwhatstring | nullblock_idstring | nullkindstring | nulltextstring | null
movedobject[]Show child attributes
wherestring | nullwhatstring | nullblock_idstring | nullfromintegertointeger
keptEditKeptHow to get back to what was there before this edit.
Show child attributes
keptbooleanversion_idstring | nullversioninteger | nullhowstringOne sentence saying where the earlier version is and how to restore it.
restoreobject | nullThe call that undoes this edit.
Show child attributes
toolstring- Example
"restore_site_version"
argsobject
reaches_peoplestring
400
The issue was sent; it can no longer change.
403
SCOPE_REQUIRED— the token lacksread:marketing(reads) orwrite:marketing(writes).ORG_WIDE_TOKEN_REQUIRED— the token is restricted to particular events; this operation reads the whole organization.FORBIDDEN— the organization's plan does not include Marketing, or the token's user cannot change goals (writes need an organization admin or the organization settings permission).
404
The issue or the version is not in your organization.
Response examples
{ "payload": { "restored_version": 123, "issue": {}, "what_changed": { "has_changes": true, "summary": [ "<string>" ], "added": [ { "where": "on the home page", "what": "FAQ", "block_id": "<string>", "kind": "<string>", "text": "<string>" } ], "changed": [ { "where": "<string>", "what": "<string>", "block_id": "<string>", "kind": "<string>", "fields": [ { "field": "<string>", "label": "<string>", "before": "<string>", "after": "<string>" } ], "more_fields": 123 } ], "removed": [ { "where": "<string>", "what": "<string>", "block_id": "<string>", "kind": "<string>", "text": "<string>" } ], "moved": [ { "where": "<string>", "what": "<string>", "block_id": "<string>", "from": 123, "to": 123 } ] }, "kept": { "kept": true, "version_id": "<string>", "version": 123, "how": "<string>", "restore": { "tool": "restore_site_version", "args": {} } }, "reaches_people": "<string>" }}