Skip to main content

Hosted Apps

A hosted app is a small web app that shows one board and its sub-boards: a gallery, a portfolio, a catalogue, a lookbook. You, or your AI assistant, write it as plain static files. Playbook hosts it at its own address and decides who can open it. All data stays in Playbook: the app has no database, and reads the board through the same REST API documented here.

Prerequisites​

  • write scope and permission to edit the board the app shows.

App capabilities​

Its own addressOpen to the board's people after they sign in to Playbook, to anyone with a password, or to anyone with the link. Or your own domain.
Reads its boardEvery asset on the board and its sub-boards, with previews, colors, tags, statuses, custom fields and uploader names. Nothing outside the board.
SearchesKeyword search and AI search inside the board.
Takes uploadsVisitors' files go into the board, when the board allows uploads (below).
Watermarks and downloadsFollows the board's share link: its watermark is on every image the app shows, and when the link allows downloads, visitors download original files, with the link's password when it has one (below).
Changes the boardIn an app for the board's people: titles, descriptions, statuses, fields and tags, approvals and comments, as the signed-in visitor (below).
Shows commentsIn an app for the board's people: the comments on an asset, as the signed-in visitor sees them in Playbook (below).
Runs a backendAn optional worker.js for anything the browser cannot do, such as rendering a printable sheet.
Remembers per visitorFavorites and settings in the browser's localStorage.

Everything on the board is visible to whoever can open the app, unapproved assets included. Confirm the board with its owner before deploying: a public app on a board publishes that board.

Who can open an app​

An app's access is one of:

accessWho gets in
publicAnyone with the link, with no sign-in. The default for a new app.
passwordAnyone who types the app's password (at least 8 characters; on plans with share-link passwords). People who can view the board may sign in instead.
membersPeople who can view the board in Playbook: workspace members and guests invited to the board. They sign in to Playbook once.
  • Playbook checks access before the page loads, on every path of the app, playbook/api/ included. The page needs no code for it.
  • The board's own share settings (its share link, password or expiry) do not protect the app. Only access does. The link's watermark and downloads do apply (below).
  • A change of access, or of the password, takes effect within about a minute, with no redeploy. Someone removed from the board is out within an hour.
  • When a visitor's sign-in ends, requests under playbook/ answer 401. Reload the page then: it takes the visitor back through sign-in.

Coming soon: an option to show approved assets only.

Your own domain​

An app can live on your own domain, such as gallery.example.com: write to [email protected]. Its old address then forwards there, url becomes the domain, and worker.js gets no cookies. Use a dedicated subdomain: the app's page can read and set cookies of its parent domain.

The files​

An app is a set of text files with no build step.

  • index.html is required.
  • Allowed types: .html .css .js .mjs .json .svg .txt .webmanifest.
  • At most 50 files and 1 MB in total. Images, video and fonts are not part of an app: images come from Playbook, fonts from a CDN.
  • Paths are plain names joined by / and ., with no leading slash: app.js, lib/grid.js.
  • A top-level worker.js is the app's optional backend (below). It is not served as a file.
  • How many apps a workspace can have depends on its plan. Replacing the files of an existing app always works, even above the count.

How the page gets its data​

The page reads the board through its own address, with relative URLs and no key. Playbook answers two paths on every app:

  • GET playbook/app returns { "board": "<token of the app's board>" }.
  • GET playbook/api/<path> returns the REST API's answer to GET /v1/{org}/<path>, with the same query string. Playbook adds the credential, limited to the app's board and its sub-boards.

These are the calls it allows:

RequestReturns
playbook/api/boards/{board}The board: title, description, asset_count.
playbook/api/boards?depth=all&displayable_assets=falseThe board and every sub-board under it, each with token, title, parent_id and sort. Without displayable_assets=false each board also carries three preview assets, which makes the answer large and slow. playbook/api/boards/{token}/children returns one level.
playbook/api/assets?nested_assets=true&per_page=100&page=1The assets of the board and its sub-boards. Leave nested_assets out for the board alone.
playbook/api/assets/{token}One asset.
playbook/api/assets/{token}/childrenThe members of a group (is_group: true), newest first.
playbook/api/search?query=…Keyword search across the board and its sub-boards.
playbook/api/ai_search?query=…AI search across the board and its sub-boards, best match first.

Any other read answers 403 board_scoped_token. Anything that is not a GET, batch_show included, answers 405; in an app for members, anything but the changes it may make answers 400. The list rows above already carry everything batch_show would add.

A page holds at most 100 items. Answers are cached for up to five minutes, so a change to the board can take that long to show. Each visitor may make 300 requests a minute to an app and cause 30 uncached reads, and an app may make 120 uncached reads a minute; more answer 429 with Retry-After. Once the workspace's API allowance is spent, reads answer 402.

What an asset row carries​

Field
token, title
descriptionRich text: often wrapped in <p>…</p>, sometimes plain. Turn it into text before you show or parse it (below), and never insert it with innerHTML.
media_typeimage/jpeg, video/mp4, …
display_urlThe full-size render; for a video, its poster.
thumbnailsSmaller renders, url, width and height each, from about 250 px up. Pick the smallest that fills its spot.
primary_width, primary_heightThe original's size in pixels.
average_color, colorsOne hex colour, and the dominant palette, most dominant first.
tagsTags, including the ones Playbook's AI adds.
status, approved, fieldsThe built-in status, approval, and custom field values keyed by field name.
collection_tokenThe board or sub-board the asset sits in. Match it against the tokens from boards?depth=all to group assets by sub-board.
created_at, uploaded_byUpload time, and { token, name } of who uploaded it.
comment_countHow many comments and replies the asset has, internal ones included; on a group, its members' comments too, which you read from each member. Good for a badge and for skipping assets with none, but it can be higher than what a visitor's comment read returns.
stream_urlVideo only: a signed HLS manifest. Safari plays it in a <video>; elsewhere load hls.js from a CDN. null until the video has been encoded.
is_grouptrue for a stack of variants. The listing returns the group as one row with no file of its own; read its members with assets/{token}/children.
// "<p>1760–70 · French · silk</p>" → "1760–70 · French · silk"
const plain = (html) => new DOMParser().parseFromString(html || '', 'text/html').body.textContent.trim()

Lists come in pages. Each answer carries pagy: { current_page, page_items, total_pages, total_count }. Ask for page=2, page=3, … until current_page reaches total_pages. The MCP tools show the same object as pagination; the page itself always gets pagy.

Sets and pairs​

An app that shows sets — a burst of photos, a before/after pair, a camera original and its grade, the looks of one collection — can read them two ways:

  • Groups. The listing returns each group as one row; one assets/{token}/children call per group returns its members. Good for a few sets of variants.
  • Sub-boards. Read the tree once with boards?depth=all&displayable_assets=false, read the assets once with nested_assets=true, and sort them into sets by collection_token: two calls for any number of sets. Sub-board titles make good labels, and sort gives their order on the board.

Uploads from visitors​

An app takes uploads while the board's share link allows them: Allow uploads or Enable upload-only page in the board's Share tab (Pro). With the link off, expired, password-protected or collecting emails, uploads answer 403 uploads_not_allowed; ask the owner to change it. In an app that is not public, a visitor signed in to Playbook who may upload to the board (Can edit, or a workspace member) can upload whatever the link says; their files are theirs and approved.

An upload takes two calls on the app's own address, with the bytes sent straight to storage in between. The uploader in playbook-sdk does the transfer:

<div id="uploader"></div>
<script src="https://unpkg.com/[email protected]/dist/playbook-uploader.min.js"
integrity="sha384-tkEA9VmnmJPR7V95yVMxMN90uvEwohURzbXLb8+xpv84ywEHwFJj0A/LaeCFr7sI" crossorigin="anonymous"></script>
<script>
async function post(path, body) {
const response = await fetch(path, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
const answer = await response.json().catch(() => ({}))
if (!response.ok) throw new Error(answer.errors?.[0]?.message || answer.error || 'Upload failed')
return answer.data
}
PlaybookUploader.init({
containerId: 'uploader',
getUploadTarget: (file) => post('playbook/upload', { title: file.name, size: file.size, media_type: file.type || undefined }),
finishUpload: (target) => post('playbook/upload/complete', { signed_gcs_id: target.signed_gcs_id, multipart_upload_id: target.multipart_upload_id || undefined }),
})
</script>
  • POST playbook/upload takes title, size, media_type and, in an app for members, a description for the new asset; it returns where to send the bytes. POST playbook/upload/complete takes signed_gcs_id and multipart_upload_id from that answer, and returns the new asset. Each upload completes once.
  • Files from an anonymous visitor arrive with no uploader, in the app's board. If the board hides new uploads they arrive unapproved, but the app still shows them to every visitor. Reads are cached, so a new file can take five minutes to appear in the app.
  • At most 100 MB a file, and no larger than the size the upload started with. 20 uploads a minute per visitor, about 60 a minute and 500 a day per app; more answer 413 or 429. The workspace's storage and file-type limits apply.

Watermark and downloads​

An app shows its board the way the board's share link would, with the link's settings from the board's Share tab (Pro), or from share_board / POST /v1/{workspace}/boards/{token}/share:

  • Watermark. When the link has a watermark, every display_url and thumbnails[].url the app reads carries it, and permalink, source_url and thumbnails[].uuid are null or left out. It stays while the link is switched off. Video streams are not watermarked. Reads are cached, so a change shows within five minutes.
  • Downloads. When the link is on and allows downloads, a visitor can download the original files. If the link has a password, the visitor types it in the app, like a PIN. The owner is notified of downloads as from the share page.
  • A PIN per sub-board. A board under the app's board can have its own share link with a password. Its files then take that password instead of the app board's, and follow that link's download settings. A sub-board link without a password, or one that is off or expired, changes nothing: those files follow the next password-protected link up, and finally the app board's. The app board's link must stay on: switching it off, or letting it expire, stops every download. An event gallery gives each event its own PIN this way. Switch downloads off on the app board's link too: its password opens every event on its share page, so with downloads on there, it would download every event's files. The watermark always comes from the app board's link.
async function download(tokens, password) {
const response = await fetch('playbook/download', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ assets: tokens, password }),
})
const answer = await response.json()
if (!response.ok) throw Object.assign(new Error(answer.errors?.[0]?.message || answer.error), { status: response.status })
// answer.data: [{ token, url, filename, size }]; answer.skipped: tokens it may not hand out
for (const file of answer.data) {
// The files are on another origin: a hidden frame per file downloads each one, where link clicks cancel each other.
const frame = Object.assign(document.createElement('iframe'), { src: file.url, hidden: true })
document.body.append(frame)
setTimeout(() => frame.remove(), 120000)
await new Promise((resolve) => setTimeout(resolve, 400))
}
}
  • POST playbook/download takes up to 100 asset tokens and the password. Each url is the original file, served as an attachment, and works for about an hour.
  • Files outside the board, unapproved files the link hides, links and notes come back in skipped.
  • When the link turns Download all off, ask for one file per request.
  • Ask for one sub-board's files at a time when sub-boards have their own passwords: files that follow different share links in one request answer 422 mixed_share_links, and the app board's link counts as one of them.
  • The browser may ask the visitor once to allow several downloads.
  • 401 wrong_password: the password is missing or wrong. 403 downloads_not_allowed: the link is off, expired, collects emails or does not allow downloads, the board is licensed, or several files were asked for while Download all is off.
  • 10 requests a minute per visitor and 100 a minute per app; more answer 429. 1,000 wrong passwords a day per app.

Changes from signed-in visitors​

In an app whose access is members, the page can change assets on its board. Each change is made as the visitor, with their own permissions in Playbook: someone who can only view the board gets 403. Comments, approvals and date, person and link fields record the visitor, as the same changes through the REST API do. Public apps and apps with a password stay read-only, apart from uploads.

RequestBodyChanges
PATCH playbook/api/assets/{token}{ "asset": { "title", "description", "status", "fields", "tags" } }, any of themThe asset. status takes a status that already exists; tags replaces the asset's own tags (an empty list changes nothing: remove tags with change_tags); fields below.
POST playbook/api/assets/{token}/update_status{ "status": "Done" }The built-in status.
POST playbook/api/assets/{token}/change_tags{ "add_tags": [], "remove_tags": [] }Tags. A new tag joins the workspace's list.
POST playbook/api/assets/set_approval{ "tokens": [], "approved": true }Approval, when the visitor may approve.
POST playbook/api/comments{ "asset_token": "…", "comment": { "description": "…" } }A comment on an asset.
const response = await fetch(`playbook/api/assets/${token}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ asset: { fields: { 'Bug bash status': 'Done' } } }),
})
const { data: asset } = await response.json() // the asset as it is now
  • fields maps a field's name to its new value; fields left out keep theirs. A select takes one of its options, a multi-select a list of them ({ "Platforms": ["Web", "iOS"] }) and then holds exactly those, a date field YYYY-MM-DD, a person field a member's token, a link field an http(s) URL, a text field one line of at most 500 characters. "" (or []) clears a field. An unknown field or option, the built-in Status (set it with status), or a list for anything but a multi-select answers 422; the app can't create fields or options.
  • GET playbook/api/custom_fields lists the workspace's fields, each with its name, field_type (select, multi_select, date, person, url, text) and options, read as the visitor and never cached. Only in an app for members, for a signed-in visitor; elsewhere it answers 403. In an asset row a multi-select reads as its options joined by ", ".
  • Only these. Deleting, moving, copying or grouping assets, versions, and anything on boards answer 400, and so does a field not in the table.
  • Only assets on the app's board and its sub-boards: any other answers 404.
  • An asset change answers with the asset as it is now, an approval with the approved assets, a comment with the comment. Reads stay cached for up to five minutes, so show the answer rather than reading the board again; other visitors see the change within five minutes.
  • Visitors who can no longer open the app, and apps whose access changed, are refused from the next change: 403, or 401 when the sign-in has to start again.
  • 60 changes a minute per visitor. They count toward the workspace's API allowance. A 503 means Playbook could not take changes right now; wait Retry-After seconds.

Comments on an asset​

In an app for members, GET playbook/api/assets/{token}/comments lists an asset's comments, oldest first, with replies nested under each comment in the order they were written. They are read as the visitor and never cached, so each visitor sees what Playbook shows them on that asset, internal comments included when they may see them.

const response = await fetch(`playbook/api/assets/${token}/comments`)
const { data: comments, pagy } = await response.json()
// [{ token, description, user_token, user_name, internal, created_at, resolved_at, replies: [...] }]
  • description is rich text, like an asset's: often HTML, with mentions as <span> elements. Turn it into text with the plain helper above, and never insert it with innerHTML.
  • resolved_at is empty while a comment is open. user_name is who wrote it. internal is true for a team-only comment: mark it, as Playbook does, so nobody mistakes it for something the client can see.
  • page and per_page (up to 100) page through the threads; each thread arrives with all its replies. The rest of the query is dropped.
  • Only assets on the app's board and its sub-boards, and not in the trash: any other answers 404. Comments on a board itself are not available.
  • In a public app or an app with a password it answers 403. A visitor whose sign-in has ended gets 401, as on every playbook/ path: reload the page to sign in again.
  • Read comments when a visitor opens an asset, not for the whole grid. Each read is uncached and counts toward the visitor's 30 uncached reads a minute, shared by everyone behind the same address, and toward the workspace's API allowance; a grid that reads every asset's comments runs into 429. Use comment_count from the listing for badges, and skip assets where it is 0.
  • A new comment answers with itself, so add it to the list rather than reading the comments again.

Rules that keep an app working​

  1. Every URL is relative. Write playbook/api/assets, app.js, styles.css, never /playbook/api/assets or /app.js. An app does not always sit at the root of its address, and a leading slash points outside it.
  2. Navigate with the hash. A path that matches no file is a 404, so keep views in location.hash (#/item/abc), not in the path.
  3. Never call api.playbook.com from the page, and never put a token in a file. The page has no key, and every file of the app is public.
  4. Do not keep image URLs. display_url and thumbnail URLs are signed and expire. Read the board again instead of storing them.
  5. Key browser storage by the app's path, for example `favorites:${location.pathname}`. Apps can share an origin.
  6. Mind the API allowance. Reads that miss the cache count against the workspace's API quota. Load a page of assets once, and poll rarely if at all.
  7. Retry busy and cold reads. The first uncached read of a board can take up to half a minute and answer 503. Retry a 5xx or 429 a couple of times, waiting Retry-After seconds when it is given, before showing an error. The starter below does this.

A starter​

Two files are a complete app.

index.html:

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gallery</title>
<style>
body { margin: 0; padding: 24px; font: 16px/1.5 system-ui, sans-serif; }
#grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
img { display: block; width: 100%; height: auto; }
</style>
</head>
<body>
<h1 id="title"></h1>
<p id="notice" hidden>The board did not load. Reload the page to try again.</p>
<main id="grid"></main>
<script type="module" src="app.js"></script>
</body>
</html>

app.js:

// Relative: no leading slash. Playbook adds the credential.
// A busy or cold answer (429, 5xx) is retried twice before giving up.
async function api(path, tries = 3) {
const response = await fetch(`playbook/api/${path}`).catch(() => null)
if (response?.ok) return response.json()
const status = response?.status ?? 0
if (tries > 1 && (status === 0 || status === 429 || status >= 500)) {
const wait = Number(response?.headers.get('Retry-After')) || 2
await new Promise((resolve) => setTimeout(resolve, wait * 1000))
return api(path, tries - 1)
}
throw new Error(`Playbook answered ${status}`)
}

try {
const app = await (await fetch('playbook/app')).json()
const { data: assets } = await api('assets?nested_assets=true&per_page=100')
const { data: board } = await api(`boards/${app.board}`)
document.title = board.title
document.querySelector('#title').textContent = board.title

const images = assets.filter(
(asset) => asset.media_type?.startsWith('image/') && asset.thumbnails?.length
)
document.querySelector('#grid').append(
...images.map((asset) => {
// The smallest thumbnail that still fills a column.
const thumbs = [...asset.thumbnails].sort((a, b) => a.width - b.width)
const thumb = thumbs.find((t) => t.width >= 440) || thumbs.at(-1)
const image = document.createElement('img')
image.src = thumb.url
image.alt = asset.title
image.width = asset.primary_width
image.height = asset.primary_height
image.loading = 'lazy'
return image
})
)
} catch {
document.querySelector('#notice').hidden = false
}

Deploy​

Over MCP, call deploy_app with the board's token, a slug, a name, and files: the contents of every file as text, keyed by path. Add access (and password for password) unless the default, public, is what the user wants. See Connect AI Assistants via MCP.

Over the API:

curl -X POST "https://api.playbook.com/v1/my-org/hosted_apps" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hosted_app": {
"slug": "acme-lookbook",
"name": "Acme Lookbook",
"board_token": "BOARD_TOKEN",
"access": "public",
"files": {
"index.html": "<!doctype html>...",
"app.js": "let session..."
}
}
}'
{
"data": {
"slug": "acme-lookbook",
"name": "Acme Lookbook",
"url": "<the app's address>",
"access": "public",
"board_token": "BOARD_TOKEN",
"enabled": true,
"head_version_number": 1,
"created_at": "2026-10-12T10:00:00Z",
"updated_at": "2026-10-12T10:00:00Z"
}
}

Use the address from the response; do not build it from the slug. A new address can take a minute or two to start answering: until then it answers 404 Not found, which does not mean the deploy failed. A redeploy of an existing slug can serve the previous files for about a minute.

The slug is the app's address: lowercase letters, digits and hyphens, at most 63 characters, starting with a letter or a digit. It is unique across all of Playbook, so make it specific.

To update an app, deploy again with the same slug. A deploy replaces the whole file set, so send every file each time; it keeps the app's access unless access is given. To change a few files without resending the rest, use PATCH …/source.

Every deploy, even of the same files, is saved as a new numbered version, and head_version_number is the one that is live. The app reads the board as whoever deployed it last; when that person changes, signed-in visitors have to reload the page before their next change. Two optional fields guard a redeploy: expected_version, the head_version_number you last read, refuses the deploy if someone changed the app since (409 stale_app); comment is a note stored with the new version.

List, change access, switch off, delete​

RequestWhat it does
GET /v1/{org}/hosted_appsThe workspace's apps. MCP: list_apps.
GET /v1/{org}/hosted_apps/{slug}One app. Needs permission to edit the board it shows.
PATCH /v1/{org}/hosted_apps/{slug} with {"hosted_app": {"access": "password", "password": "..."}}Changes who can open the app, without a redeploy.
PATCH /v1/{org}/hosted_apps/{slug} with {"hosted_app": {"enabled": false}}Switches the app off: its address answers 404 and it can no longer read the board. true switches it back on.
DELETE /v1/{org}/hosted_apps/{slug}Takes the app offline and deletes it. The slug becomes free. MCP: delete_app.

Versions: read, edit and roll back​

Playbook keeps the files of an app's last 50 versions; past that, each new version drops the oldest. Read them, change some of them, or put an older version back live. Over MCP: get_app_source, list_app_versions, edit_app_source and revert_app, which take the same arguments as the requests below. The AI agent in Playbook can open and edit an app's files too.

RequestWhat it does
GET /v1/{org}/hosted_apps/{slug}/sourceThe live version's version_number and its files, each with path and bytes. Add version=N for an older version.
GET /v1/{org}/hosted_apps/{slug}/source?path=app.jsAlso returns that file's content, in slices: 12,000 characters by default, limit up to 50,000. Pass offset= the next_offset of the answer until it is null.
GET /v1/{org}/hosted_apps/{slug}/versionsEvery kept version, newest first: number, created_at, created_by, file_count, bytes, comment and, for a rollback, reverted_from_number; plus head_version_number.
PATCH /v1/{org}/hosted_apps/{slug}/sourceReplaces and deletes only the files named, keeps the rest, and deploys the result as a new version.
POST /v1/{org}/hosted_apps/{slug}/revertDeploys an older version's files again as a new version, so the version you leave stays in the history and the rollback can itself be undone.
# Change one file and remove another, on top of version 4.
curl -X PATCH "https://api.playbook.com/v1/my-org/hosted_apps/acme-lookbook/source" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "hosted_app": { "expected_version": 4, "files": { "app.js": "..." }, "delete_files": ["old.js"], "comment": "Bigger thumbnails" } }'

# Put version 2 back live.
curl -X POST "https://api.playbook.com/v1/my-org/hosted_apps/acme-lookbook/revert" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "hosted_app": { "version": 2, "expected_version": 5 } }'
  • expected_version is required for an edit and a rollback: the head_version_number you read. If the app changed since, the answer is 409 stale_app, with the live number in extensions.current_version; read the files again and redo the change.
  • A file cannot be both in files and in delete_files. A path in delete_files that the app does not have is ignored, so take paths from the source file list. The result must still be a valid app: an index.html, at most 50 files and 1 MB.
  • Each answer is the app as it is now, with its new head_version_number. Like any deploy, the new files can take about a minute to be served, and the app then reads the board as you.
  • A version or path that is not kept answers 404.
  • An app not deployed since Playbook began keeping versions has no stored files until it is deployed once more: reading and editing answer 409 source_unavailable, and a rollback answers 404.

An optional backend​

Most apps need none. Add a top-level worker.js only for something the page cannot do in the browser, such as rendering a printable sheet as one finished document.

worker.js is a JavaScript module that exports a fetch handler. It runs for every request that matches no file and is not under playbook/, and sees paths relative to the app, such as /sheet.

  • It can call only the Playbook API, and only to read: GET requests under https://api.playbook.com/v1/{org}/. Playbook adds the credential and limits it to the app's board; send no Authorization header. Any other request answers 403.
  • Limits per request: 50 ms of CPU time and 20 outgoing requests. Its reads are not cached and count toward the app's 120 a minute. No environment variables, no storage.
const API = 'https://api.playbook.com/v1/my-org'

export default {
async fetch(request) {
const { pathname } = new URL(request.url)
if (request.method !== 'GET' || pathname !== '/count') {
return new Response('Not found', { status: 404 })
}
const answer = await fetch(`${API}/assets?nested_assets=true&per_page=1`)
const { pagy } = await answer.json()
return Response.json({ assets: pagy.total_count })
},
}

Errors​

ResponseMeaning
403 or 404 on the boardThe token's owner cannot edit that board, or the board token is wrong.
422The message says what to fix: a missing index.html, a file type or path that is not allowed (nothing may sit under playbook/), too many or too large files, a slug that is malformed or taken by another workspace, the plan's limit on apps, or a password that is missing, too short or not on the plan.
429 from the appToo many requests from one visitor, or too many uncached reads by the app. Wait Retry-After seconds.
503 from playbook/api/A cold read took too long. Send it again.
403 board_scoped_token from playbook/api/The read is not one an app may make (see the table of calls).
405 from playbook/api/A change in an app that is not for members: those can only read.
400 from playbook/api/A change an app may not make, or a missing or wrong field (see the table of changes).
403 on a changeThe visitor may not make it in Playbook, or may no longer open the app.
422 on a changeA status or option that does not exist; the message names it.
401 from playbook/The visitor's sign-in ended or was revoked. Reload the page.
403 uploads_not_allowed from playbook/uploadThe board's share link takes no uploads, and the visitor is not signed in as someone who may upload.
422 upload_unknown from playbook/upload/completeThe upload was already completed, or was not started on this app.
401 wrong_password from playbook/downloadThe share link the files follow has a password, and the visitor did not give it: a sub-board whose own link has a password takes that password.
422 mixed_share_links from playbook/downloadThe files follow different share links: sub-boards with their own passwords, or one of them and the app board. Ask for each board's files apart.
403 downloads_not_allowed from playbook/downloadThe board's share link is off, expired, collects emails or does not allow downloads; the board is licensed; or several files were asked for while Download all is off.
404 Not found right after the first deployThe new address is not live yet. Wait a minute or two.
402 from playbook/api/The workspace's API allowance is spent.
502The app could not be changed right now. Send the same request again.
409 stale_appThe app changed after the head_version_number you sent as expected_version. Read it again; the live number is in extensions.current_version.
409 app_busyAnother change to the same app is under way. Try again in a moment.
409 source_unavailableThe app has no stored files yet. Deploy its files once to start its version history. A rollback of such an app answers 404 instead.