Skip to content

Edit a Site's draft

PUT/v1/organization/{orgId}/sites/{siteId}/draft

US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com

Applies up to 60 edits, in order, to the draft. Visitors see nothing until you publish. Send the revision you last read as baseRevision: if the Site changed since, the call answers 409 with code: SITE_DRAFT_STALE and writes nothing; read it again and retry. All edits apply or none do; a block that fails its schema answers 400 naming the block. Also at PUT /v1/sites/{siteId}/draft.

Request example

Terminal window
curl --request PUT \
--url 'https://public-api.sessionboard.com/v1/organization/{orgId}/sites/{siteId}/draft' \
--header 'x-access-token: <api-token>' \
--header 'Content-Type: application/json' \
--data '{
"baseRevision": "1794034466000.1793990000000.1794034466000",
"ops": [
{
"op": "theme.set",
"theme": {
"mode": "dark",
"accent": "#E11D48"
}
},
{
"op": "site.update",
"name": "Northwind Summit 2027"
}
]
}'

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
PUT

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.

  • siteIdstring<uuid>pathrequired

    The Site's id from List Sites.

Request body

application/jsonrequired

  • baseRevisionstring

    The revision from your last read (three timestamps joined by dots; send it back as is).

    Max length
    64
  • opsSiteOp[]
    Max items
    60
    Show child attributes
    • opstringrequired
      Allowed values
      "page.add", "page.update", "page.move", "page.remove", "block.add", "block.update", "block.move", "block.remove", "nav.set", "nav.reset", "theme.set", "site.update"
  • brandKitIdstring<uuid> | null

    The Brand Kit the Site follows, applied when it is published.

{
"baseRevision": "1794034466000.1793990000000.1794034466000",
"ops": [
{
"op": "theme.set",
"theme": {
"mode": "dark",
"accent": "#E11D48"
}
},
{
"op": "site.update",
"name": "Northwind Summit 2027"
}
]
}

Responses

200application/json

Saved. The new revision, what changed, and the Site's pages and diff. what_changed describes this edit (before → after, in plain words); kept says how to undo it. When an API or assistant edit replaces unpublished work by someone else (or its own from more than 10 minutes ago), that draft is first kept as a version with source: checkpoint, restorable with the versions restore route.

  • payloadobject
    Show child attributes
    • revisionstring
    • changesobject[]
      Show child attributes
      • opstring
      • pagestring
      • blockstring | null
    • siteSiteSummary
      Show child attributes
      • idstring<uuid>
      • typestring

        event_page (Marketing), learning, or awards / event_portal / internal (Awards).

      • productstring
        Allowed values
        "marketing", "learning", "awards"
      • namestring
      • slugstring
      • event_idinteger | null
      • urlstring | null

        The live address.

      • revisionstring

        Send back as baseRevision on your next write.

      • has_unpublished_changesboolean
      • published_atstring<date-time> | null
    • pagesSitePage[]
      Show child attributes
      • refstring

        home, or how to refer to the page in an edit.

      • idstring | null

        null for a page that is new in the draft.

      • titlestring
      • slugstring
      • pathstring
      • urlstring | null
      • is_homeboolean
      • hiddenboolean
      • visibilitystring
        Allowed values
        "public", "reviewers", "submitters"
      • is_newboolean
      • blocksSiteBlock[]
        Show child attributes
        • idstring
        • kindstring

          A kind from the Site's block_catalog.

        • hiddenboolean
        • configobject

          The block's settings, as its schema in block_catalog describes.

    • diffSiteDiff
      Show child attributes
      • changedboolean
      • pagesobject[]
      • blocksobject[]
      • settingsobject[]
        Show child attributes
        • keystring
        • labelstring
      • summarystring[]

        One plain sentence per change, for the person to read.

    • 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

      Nothing in a draft is live; publishing needs a person.

400

An edit could not apply (the message names it), or a block failed its schema (details per block).

403

  • SCOPE_REQUIRED — the token lacks read:sites (or read:marketing, read:learning, read:awards) for reads, or the matching write: scope for writes.
  • FORBIDDEN — the token's user cannot edit this Site.

409

The Site changed since baseRevision (code: SITE_DRAFT_STALE).

Response examples

{
"payload": {
"revision": "<string>",
"changes": [
{
"op": "<string>",
"page": "<string>",
"block": "<string>"
}
],
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"product": "marketing",
"name": "<string>",
"slug": "<string>",
"event_id": 123,
"url": "<string>",
"revision": "<string>",
"has_unpublished_changes": true,
"published_at": "2026-01-15T09:30:00Z"
},
"pages": [
{
"ref": "<string>",
"id": "<string>",
"title": "<string>",
"slug": "<string>",
"path": "<string>",
"url": "<string>",
"is_home": true,
"hidden": true,
"visibility": "public",
"is_new": true,
"blocks": [
{
"id": "<string>",
"kind": "<string>",
"hidden": true,
"config": {}
}
]
}
],
"diff": {
"changed": true,
"pages": [
{}
],
"blocks": [
{}
],
"settings": [
{
"key": "<string>",
"label": "<string>"
}
],
"summary": [
"<string>"
]
},
"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>"
}
}