---
search:
  tags:
    - Apps
    - PUT
seo:
  description: >-
    Writes the whole spec of an app and bumps its record_generation. A team key…
    Reference for the PUT /v1/apps/{project} endpoint in the Sproutboat Cloud
    API.
sidebar:
  label: Replace an app's spec
  badge: PUT
title: Replace an app's spec
type: openapi-operation
---
Writes the whole spec of an app and bumps its `record_generation`. A team key cannot place a module directly:
`module.sha256` must be the module the app already runs, or one your own team's builds produced; anything else
is 403 `module-upload-disabled`. So this route changes **configuration** (bindings, crons, limits, routes,
assets) of an existing app, or moves it to an earlier module of yours. To create an app or ship new code, use
`POST /v1/apps/{project}/builds`.

**PUT replaces.** Omitted `hosts`, `bindings`, `services`, `crons`, `queue_consumers` and `limits` become empty
and `active` becomes true. Send everything you want to keep, or use `hosts_patch` and `secrets_patch` to leave
routes and secrets alone. Omitting `secrets` keeps the stored secrets; `secrets: null` clears them; an object
replaces the whole set. Setting any secret needs `secret:write` in addition to `app:write`.

Unknown keys are refused by name (400, `reason: invalid`, `path`). Every value of `limits` the team may set is checked
against the account's ceilings (`GET /v1/limits`): over one is 403 `quota-memory`, `quota-storage`, `quota-cpu`,
`quota-wall`, `quota-rate` or `quota-ops`, never clamped, and a new app over the app quota is 403 `quota-apps`. An app
already over a ceiling keeps its value and can be lowered or redeployed, not raised. Route keys: a team may add only
`<name>.<team slug>.sproutboat.app` (any path under it) or a hostname it has verified as a custom domain;
another route is 403 `host-not-yours`. A route another app holds is 409 `route-taken`.

`PUT /v1/apps/{project}`
