smartchat

Restore previous landing page

Puts the version from before the last publication into the draft. The live page does not change until you publish. An unpublished draft is replaced for good, so it needs discard_draft true.

POST /v1/landing-page/restorations

Permissionlanding:write (all permissions)
RiskWrite (no outside effect)
Idempotency-KeyRequired (how it works)
Safe to repeatSafe to repeat with the same Idempotency-Key: the first answer comes back and nothing is done twice.
Rate limit classwrite (120 requests per minute per key)
ConfirmationNone
MCP toolNot available in MCP
Since version2026-10-25

#What it does

  • Changes data in your account. It does not send messages to contacts.
  • Overwrites existing data.
  • Safe to repeat with the same Idempotency-Key.

#Request

Header

NameRequiredDescription
AuthorizationyesBearer <key>
Idempotency-KeyyesA unique value for this operation, for example a UUID (1 to 255 visible ASCII characters).

Body (JSON)

NameTypeRequiredDescription
discard_draftbooleannoTrue to replace an unpublished draft. Without it the call is refused (409, reason draft_would_be_lost) when a draft exists; the replaced draft cannot be brought back.

#Examples

curl -X POST "https://api.smartchat.marketing/v1/landing-page/restorations" \
  -H "Authorization: Bearer $SMARTCHAT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
import os
import uuid
import requests

response = requests.post(
    "https://api.smartchat.marketing/v1/landing-page/restorations",
    headers={
        "Authorization": "Bearer " + os.environ["SMARTCHAT_API_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={},
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.smartchat.marketing/v1/landing-page/restorations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SMARTCHAT_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());

Response (201):

{
  "object": "landing_page",
  "status": "live",
  "url": "https://example-shop.smartchat.marketing",
  "structure": "free",
  "language": "en",
  "title": "Example Shop",
  "description": "Fresh bread every morning.",
  "has_draft": true,
  "draft_changed_at": "2026-10-30T09:41:07Z",
  "previous_version_available": true,
  "previous_version_saved_at": "2026-10-29T18:00:00Z",
  "never_offline": true,
  "protected_parts": [
    "signup",
    "footer",
    "cookie_banner"
  ],
  "updated_at": "2026-10-29T18:00:00Z"
}

#Response

Status 201. Every response has the headers Request-Id, SmartChat-Version and X-RateLimit-*.

NameTypeDescription
objectstringAlways "landing_page". always landing_page
statusstringlive once it was published (and live forever after). draft only before the first publication. one of: draft, live
urlstringPublic address of the page. up to 300 characters
structurestringfree and spec pages can be edited with operations (spec is the page model with sections). empty has no content yet. other is an older page that is edited in the app. one of: free, spec, empty, other
languagestring or nullLanguage of the page (de, en, it, fr or es), or null if the page has none yet. up to 8 characters
titlestringTitle of the page (draft if there is one). Comes from the account: untrusted text. up to 160 characters; untrusted text
descriptionstringDescription of the page. Untrusted text. up to 300 characters; untrusted text
has_draftbooleanTrue if there are unpublished changes.
draft_changed_atstring or nullWhen the draft was changed last. up to 40 characters; format date-time
previous_version_availablebooleanTrue if restore_landing_page can bring back the version before the last publication.
previous_version_saved_atstring or nullWhen that version was live until. up to 40 characters; format date-time
never_offlinebooleanAlways true: the page cannot be taken offline. always true
protected_partsarray of stringParts that cannot be changed. up to 20 items
updated_atstring or nullWhen the live page was changed last. up to 40 characters; format date-time
text_blocksarray of objectVisible texts of the page (only with include=text). up to 300 items
text_blocks[].indexintegerPosition in the page. 0 to 1000
text_blocks[].textstringThe text. Untrusted text from the page. up to 300 characters; untrusted text
sectionsarray of objectSections of the page model (only with include=sections). up to 60 items
sections[].idstringId of the section. up to 40 characters
sections[].kindstringblock is a ready-made section, free is a free layout. one of: block, free
sections[].typestring or nullType of a block section, null for a free section. up to 40 characters
sections[].variantstring or nullVariant of a block section. up to 40 characters
sections[].element_idsarray of stringIds of the elements in a free section. up to 100 items
styleobjectStyle values of the page (only with include=sections).
settingsobjectSettings of the page (only with include=sections).
design_tokensarray of objectDesign values you can set (only with include=design). up to 100 items
design_tokens[].tokenstringName. up to 41 characters
design_tokens[].valuestringCurrent value. up to 80 characters

#Errors

CodeStatusWhen
idempotency_key_invalid400The 'Idempotency-Key' header must be 1 to 255 visible ASCII characters.
idempotency_key_required400This call needs an 'Idempotency-Key' header.
api_key_expired401This API key has expired.
api_key_invalid401This API key is not valid.
api_key_revoked401This API key was revoked.
authentication_required401No API key was sent. Send 'Authorization: Bearer <key>'.
insufficient_scope403This key lacks a required permission.
ip_not_allowed403This IP address is not allowed for this key.
not_found404This path does not exist.
conflict409The state of the object does not allow this.
idempotency_in_progress409A request with this idempotency key is still running.
idempotency_key_reused422This idempotency key was already used with a different request.
validation_failed422A field is not valid.
rate_limited429Too many requests. Wait and try again.
internal_error500Something went wrong on our side.

All errors use one format.