Publish a new version
update_appPublish a new version of an existing app. Read the app first and pass the base_version_id read_app returns: it names the version this edit builds on, and a base that has moved is refused rather than overwritten. By default the new version replaces the whole file set and goes live immediately unless the app is set to review before publishing. Send mode merge to publish only the files that changed and keep the rest of that version's files, with remove for paths to drop. Two merges in a row build on each other, staged versions included. Send validate true to check the call without publishing, or publish false to stage the version and make it live later with publish_app_version.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | replace, the default, publishes files as the whole file set: anything left out is gone. merge sends only the files that changed and carries every other file of the base version into the new version. | |
| files | Yes | The files to publish. Content is plain text written here in the chat, not base64: an HTML page, a Markdown document, or a JavaScript module that exports default { fetch }. A page app serves index.html at the app URL. A function that declares the db service carries its schema changes here too, as migrations/NNNN_name.sql, which run in order when the version goes live. | |
| app_id | Yes | The app id, as returned by search_apps or create_app. Starts with app_. | |
| remove | No | Paths from the base version to leave out of the new one. Merge only, and a path that is not in the base version is refused rather than ignored. A call that only removes files sends an empty files array. | |
| message | No | What changed in this version. | |
| publish | No | false stages the version instead of putting it on the link. It is built and readable at its own version URL, and publish_app_version makes it live. Defaults to true. | |
| manifest | No | How the version runs. Omit it on create_app for a static page, and omit it on update_app to keep the previous version's manifest. A manifest that is sent replaces the whole of it, so send every field the app still needs. services, secrets and env are read by a function only. The data plane in full, with its limits: https://reachpad.dev/SKILL.md | |
| validate | No | Check the call and write nothing. Answers with the file set the publish would contain, its total bytes, the entry and the kind, and on create_app the slug and the URL the app would take, where <tag> stands for the five random characters drawn when it is published. It checks the file set, its total size, that the entry file is one of the files, and on create_app that the slug is a usable link name. It does not check the org's app limit, so a create that would be refused for that is still refused when it is published. | |
| base_version_id | Yes | The base_version_id read_app returned, which is the version this edit was made against. Starts with ver_. |