Replace an app's spec
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.
/v1/apps/{project}AuthorizationBearer token · headerrequiredA team API key, sbk_..., from Settings, API keys.
x-api-keyAPI key · headerrequiredThe same key, in a header of its own.
projectstringrequiredThe app's name, unique within the team. 3 to 51 characters (or 1), lowercase letters, digits and dashes, not starting or ending with a dash.
application/jsonactivebooleanhostsstring[]The app's whole route list. Exclusive with hosts_patch.
hosts_patchHostsPatchShow propertiesHide properties
addstring[]removestring[]bindingsBinding[]Show propertiesHide properties
Bindingnamestringrequiredkindstringrequiredkvd1r2queuedoaeratelimitassetssecretserviceresource_idstring | nullrequiredconfigobjectrequiredBy kind: do {class_name} (the exported Durable Object class); ratelimit {limit, period}; queue
{queue, retry_delay?}; service {} with the callee in the spec's services; the others {}.
servicesobjectService bindings: binding name to the callee's app_id (from GET /v1/apps). Both apps must belong to the team and the callee cannot be the app itself. The runtime enables service bindings from compatibility date 2026-11-18 (CLI-enforced).
cronsstring[]queue_consumersQueueConsumer[]Show propertiesHide properties
QueueConsumerqueuestringrequiredmax_batch_sizeintegerrequiredmax_batch_timeout_msintegerrequiredmax_retriesintegerrequireddead_letter_queuestring | nullrequiredlimitsLimitsPer-app ceilings. A null or absent value means the platform default. The account's own ceilings (GET /v1/limits) cap what a team may ask for here: a value over one is refused with 403 quota-* (never clamped), and rate_rps: 0 (no limit) is refused too.
Show propertiesHide properties
memory_mbinteger | nullcpu_msinteger | nullwall_msinteger | nullstorage_mbinteger | nullrate_rpsinteger | nullrate_burstinteger | nullNeeds rate_rps.
ops_per_secinteger | nullegress_bytes_per_dayinteger | nullegress_policy_refstring | nullassets_manifest_refstring | nullassets/<sha256 of the uploaded manifest>. The manifest must be uploaded first.
moduleobjectrequiredThe module the app runs, or one your team's builds produced. Take module_sha256 from a build.
Show propertiesHide properties
sha256Sha256requiredsecretsobject | nullAbsent keeps the stored secrets, null clears them, an object replaces the set. Needs secret:write.
Show propertiesHide properties
objectnullsecrets_patchSecretsPatchShow propertiesHide properties
setobjectSecret name to value. The values are secrets: never returned by any route, keep them out of logs.
deletestring[]The spec was stored. Wait for apply as in Deploy flow, step 8.
app_idstringrequiredrecord_generationintegerrequiredWait for apply.applied_generation of the app to reach this.
The request is malformed. path names the field when one is at fault; some refusals (a digest mismatch, a body that is not JSON) carry a message only.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredinvaliderrorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerNo key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key lacks a grant (forbidden); a route is not the team's to use (host-not-yours); the module is not one the team may place (module-upload-disabled, the one error with no reason: read error); or the write is over a free alpha quota (quota-apps, quota-memory, quota-storage, quota-cpu, quota-wall, quota-rate, quota-ops).
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredforbiddenneedstringrequiredThe grant, as <resource>:<action>, for example app:write.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredhost-not-yourspathstringrequiredhostserrorstringrequiredmodule-upload-disabledmessagestringrequirederrorstringrequiredA message for people. Do not parse it.
reasonstringrequiredquota-appslimitintegerrequiredApps allowed.
usedintegerrequiredApps the team has.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredquota-memorylimitintegerrequiredThe ceiling, in MiB.
askedintegerrequiredWhat the spec asked for.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredquota-storagelimitintegerrequiredThe ceiling, in MiB.
askedintegerWhat limits.storage_mb asked for.
would_use_mbintegerThe static assets of the team's apps with this deploy, in MiB.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredquota-cpulimitintegerrequiredThe ceiling, in milliseconds of CPU per request.
askedintegerrequirederrorstringrequiredA message for people. Do not parse it.
reasonstringrequiredquota-walllimitintegerrequiredThe ceiling, in milliseconds of wall time per request.
askedintegerrequirederrorstringrequiredA message for people. Do not parse it.
reasonstringrequiredquota-ratelimitintegerrequiredThe ceiling.
askedintegerrequirederrorstringrequiredA message for people. Do not parse it.
reasonstringrequiredquota-opslimitintegerrequiredThe ceiling, in binding operations per second.
askedintegerrequiredAnother app holds one of the routes (reason: route-taken).
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredroute-takenpathstringrequiredhostsThe body is over the limit for this route (reason: too-large; some refusals carry a message only).
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredtoo-largeerrorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key is over its requests a minute (600, or 2,000 with app:write; reason: key-rate-limited, retry_after_s, Retry-After). Wait that long and retry.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredkey-rate-limitedretry_after_sintegerrequiredSeconds to wait; also the Retry-After header.