Skip to main content

When to use

Re-publish a presentation. The shareId (and therefore every share URL) stays the same. The HTML in storage is overwritten. The version counter increments. View counts are preserved. To create a new presentation, use POST /uploadSharedPresentation.

Endpoint

POST https://europe-west1-slideless-ai.cloudfunctions.net/updateSharedPresentation

Auth

HeaderValue
X-Process-Manager-Keycko_… (or cka_…) — must belong to the presentation’s owner
Content-Typeapplication/json
Recommended scope: presentations:write.

Request body

FieldTypeRequiredDescription
shareIdstringyesThe shareId of the existing presentation
htmlstringyesThe new HTML, ≤ 10 MB
titlestringnoNew display title; omit to keep the existing one
Example:
{
  "shareId": "0192f1c3-...",
  "html": "<!doctype html>... new content ...",
  "title": "Q4 review (v2)"
}

Response (200)

FieldTypeDescription
shareIdstringSame as the request
versionnumberThe new version (auto-incremented from the previous)
shareUrlstringAn active share URL (uses the first non-revoked token)
Example:
{
  "shareId": "0192f1c3-...",
  "version": 3,
  "shareUrl": "https://app.slideless.ai/share/0192f1c3-...?token=AbCdEf..."
}

What stays the same

  • shareId and every share token (every existing URL still works)
  • totalViews and per-token accessCount
  • Owner, organization, apiKeyId

What changes

  • The HTML in storage (atomically overwritten)
  • version (auto-bumps by 1)
  • updatedAt
  • title (only if you pass a new one)

Examples

curl

SHARE_ID="0192f1c3-..."

curl -sS -X POST \
  -H "X-Process-Manager-Key: $SLIDELESS_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @<(jq -Rs --arg id "$SHARE_ID" '{shareId: $id, html: .}' < ./deck-v2.html) \
  https://europe-west1-slideless-ai.cloudfunctions.net/updateSharedPresentation

Node.js

import { readFile } from 'node:fs/promises';

const html = await readFile('./deck-v2.html', 'utf-8');

const res = await fetch(
  'https://europe-west1-slideless-ai.cloudfunctions.net/updateSharedPresentation',
  {
    method: 'POST',
    headers: {
      'X-Process-Manager-Key': process.env.SLIDELESS_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ shareId: '0192f1c3-...', html })
  }
);

const { version } = await res.json();
console.log('Now at version', version);

Errors

StatusCodeCauseFix
400invalid-argumentshareId or html missing or wrong typeSend both as strings
401unauthenticatedMissing or invalid API keySet a valid X-Process-Manager-Key
403permission-deniedKey’s user is not the presentation’s ownerUse a key from the owner’s account
404not-foundNo presentation with that shareIdVerify the ID — list with listMyPresentationsPublic
405method-not-allowedUsed GET/PUT/etc.Use POST
410archivedPresentation has been archivedCannot be updated; create a new one with uploadSharedPresentation
413payload-too-largeHTML > 10 MBSlim down the deck
500internalBackend errorRetry with exponential backoff

Atomicity

GCS object writes are atomic from the viewer’s perspective: a viewer either gets the old HTML or the new HTML, never a partial mix. There is no read-during-write window where the file is corrupt.

Next