Skip to content

Restore a kept version of an issue

POST/v1/organization/{orgId}/marketing/newsletter/issues/{issueId}/versions/{versionId}/restore

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

Terminal window
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 '{}'

Try it

Authorization

Your token stays in this page. It is sent only to the region above and is never saved; it is gone when you leave or reload the page.

Path parameters
Body application/json
POST

Authorizations

  • x-access-tokenstringheader

    Organization API token. Generate from Organization Settings → API Tokens.

  • AuthorizationBearer <token>headeror

    OAuth 2.1 access token. Obtained via the OAuth PKCE flow at /oauth/token.

Send one of these. See Authentication.

Path parameters

  • orgIdstringpathrequired

    Your organization ID. Any other organization returns 404.

  • issueIdstringpathrequired

    The issue

  • versionIdstringpathrequired

    kept.version_id from an edit, or an id from the versions list

Request body

application/json

  • bodyobject

Responses

200application/json

Restored.

  • payloadobject

    Returned 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_versioninteger
    • issueobject
    • what_changedWhatChanged

      What one edit changed, in plain words. summary is 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_changesboolean
      • summarystring[]
      • addedobject[]
        Show child attributes
        • wherestring | null
          Example
          "on the home page"
        • whatstring | null
          Example
          "FAQ"
        • block_idstring | null
        • kindstring | null
        • textstring | null
      • changedobject[]
        Show child attributes
        • wherestring | null
        • whatstring | null
        • block_idstring | null
        • kindstring | null
        • fieldsobject[]
          Show child attributes
          • fieldstring
          • labelstring
          • beforestring | null
          • afterstring | null
        • more_fieldsinteger
      • removedobject[]
        Show child attributes
        • wherestring | null
        • whatstring | null
        • block_idstring | null
        • kindstring | null
        • textstring | null
      • movedobject[]
        Show child attributes
        • wherestring | null
        • whatstring | null
        • block_idstring | null
        • frominteger
        • tointeger
    • keptEditKept

      How to get back to what was there before this edit.

      Show child attributes
      • keptboolean
      • version_idstring | null
      • versioninteger | null
      • howstring

        One sentence saying where the earlier version is and how to restore it.

      • restoreobject | null

        The 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 lacks read:marketing (reads) or write: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>"
}
}