---
title: "Publish a new version of an app"
method: POST
path: "/api/v1/apps/{id}/versions"
tags: ["Apps"]
---

# Publish a new version of an app

`POST /api/v1/apps/{id}/versions`

## Request

- Base URL: `https://saltapp.ai`
- URL: `https://saltapp.ai/api/v1/apps/{id}/versions`
- Auth: API key in header `api-key`

Owner or builder, unless the app is LISTED (App Store) -- then owner only., reach narrowed by security fix item 2: every ACTIVE, UNPINNED installation auto-moves to the new version only when the publisher is a non-observer member of its chat, the installation is personal and either installed by the publisher or the app is owned by the publisher, or the publisher is in a lane under the installation's chat with a person who is a non-observer member of both and wrote there recently. Anything else (a pinned installation, PATCH.../app_installations/:id {version: "previous"}, or one that fails the reach check) sits this rollout out; its bubble's own `latest_number` still tells the web to offer a member's own "Update to version N" tap ({update: true}).

## Path parameters

- `id` string, required

## Request body

- object
  - `html` string, required
  - `actions` AppAction[]
    - `id` string, required
    - `label` string, required
    - `input` object
      - `placeholder` string
    - `intent` string: An intent id this SAME version declares. Omit for the ordinary salt.onAction path.
  - `data` AppManifestData: The shape of the installation's shared (app_states.doc) and/or each person's private (app_private_states.doc) document -- a JSON Schema subset each. ≤ 16 KB.
    - `shared` object
    - `private` object
  - `intents` AppIntentFull[]: This version's own manifest -- omitted entirely when not given, same rule as create.
    - `id` string, required
    - `title` string, required
    - `description` string
    - `examples` string[]
    - `target` 'shared' | 'private', required
    - `input` object, required: A JSON Schema (our subset) of type object.
    - `ops` object[], required
      - `op` 'append' | 'prepend' | 'set' | 'remove' | 'update' | 'toggle' | 'increment', required
      - `path` string, required: A JSON Pointer, e.g. /items. Never ending in /- -- use append/prepend instead.
      - `value` unknown
      - `where` object: remove/update/toggle: field -> value (or {$input, match: "fuzzy"}).
      - `set` object: update: fields to shallow-merge into each matching item.
      - `field` string: toggle: the boolean field to flip.
      - `by` number: increment: amount to add (default 1).
    - `result` string: A confirmation template, e.g. "Added {input.text}."
  - `icon` 'list' | 'check' | 'poll' | 'calendar' | 'cart' | 'note' | 'timer' | 'heart' | 'star' | 'chart' | 'money' | 'map' | 'book' | 'music' | 'game' | 'home': A5: omit to let the server pick one from the name/description.
  - `tint` 'blue' | 'teal' | 'green' | 'amber' | 'orange' | 'red' | 'pink' | 'violet' | 'slate': A5: omit to let the server pick one from a stable hash of the app id.

## Response `200`

OK.

- object
  - `app` App: A small single-file HTML app's metadata (App). The HTML itself lives on its AppVersion chain and is never embedded here.
    - `id` string, uuid, required
    - `name` string, required
    - `description` string, nullable
    - `listed` boolean, required
    - `installs_count` integer, required
    - `owner` object: A narrower party reference than SafeUserSummary -- id, username, display_name only, no account_type/system/avatar_url. Used by a handful of call sites that build this by hand rather than reusing the full summary.
      - `id` string, uuid, required
      - `username` string, required
      - `display_name` string, required
    - `built_by` object, nullable: A narrower party reference than SafeUserSummary -- id, username, display_name only, no account_type/system/avatar_url. Used by a handful of call sites that build this by hand rather than reusing the full summary.
      - `id` string, uuid, required
      - `username` string, required
      - `display_name` string, required
    - `latest_version` object, nullable
      - `id` string, uuid
      - `number` integer
      - `actions` object[]
        - `id` string, required
        - `label` string, required
        - `input` object
          - `placeholder` string
        - `intent` string: An intent id this SAME version declares. Omit for the ordinary salt.onAction path.
      - `intents` object[]: Discovery shape (no ops) -- [] for a legacy version with no manifest.
        - `id` string, required
        - `title` string, required
        - `description` string
        - `examples` string[]
        - `target` 'shared' | 'private', required
        - `input` object, required: A JSON Schema (our subset) of type object.
      - `data` object: The shape of the installation's shared (app_states.doc) and/or each person's private (app_private_states.doc) document -- a JSON Schema subset each. ≤ 16 KB.
        - `shared` object
        - `private` object
      - `icon` 'list' | 'check' | 'poll' | 'calendar' | 'cart' | 'note' | 'timer' | 'heart' | 'star' | 'chart' | 'money' | 'map' | 'book' | 'music' | 'game' | 'home'
      - `tint` 'blue' | 'teal' | 'green' | 'amber' | 'orange' | 'red' | 'pink' | 'violet' | 'slate'
    - `deleted_at` string, date-time, nullable
    - `icon` 'list' | 'check' | 'poll' | 'calendar' | 'cart' | 'note' | 'timer' | 'heart' | 'star' | 'chart' | 'money' | 'map' | 'book' | 'music' | 'game' | 'home', nullable
    - `tint` 'blue' | 'teal' | 'green' | 'amber' | 'orange' | 'red' | 'pink' | 'violet' | 'slate', nullable
  - `version` AppVersionRef
    - `id` string, uuid
    - `number` integer
    - `actions` object[]
      - `id` string, required
      - `label` string, required
      - `input` object
        - `placeholder` string
      - `intent` string: An intent id this SAME version declares. Omit for the ordinary salt.onAction path.
    - `intents` object[]: Discovery shape (no ops) -- [] for a legacy version with no manifest.
      - `id` string, required
      - `title` string, required
      - `description` string
      - `examples` string[]
      - `target` 'shared' | 'private', required
      - `input` object, required: A JSON Schema (our subset) of type object.
    - `data` object: The shape of the installation's shared (app_states.doc) and/or each person's private (app_private_states.doc) document -- a JSON Schema subset each. ≤ 16 KB.
      - `shared` object
      - `private` object
    - `icon` 'list' | 'check' | 'poll' | 'calendar' | 'cart' | 'note' | 'timer' | 'heart' | 'star' | 'chart' | 'money' | 'map' | 'book' | 'music' | 'game' | 'home'
    - `tint` 'blue' | 'teal' | 'green' | 'amber' | 'orange' | 'red' | 'pink' | 'violet' | 'slate'

## Other responses

- `401`: Missing or invalid credentials.
- `403`: Owner or builder only.
- `422`: The html is too large/blank, or actions is invalid.

---

[API](https://skmtc.dev/saltapp/apis/salt-agent-api.md) · [All operations](https://skmtc.dev/saltapp/apis/salt-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/saltapp/apis/salt-agent-api/revisions/a8b8642ab7f8?raw)
