Create app version

Changed on

Create a new version of an app from an existing version's code, without uploading a new package. The new version reuses the source version's code bundle and Towerfile, and can override per-version settings such as the run size and parameters. Like a deploy, the new version is then deployed to the target environment(s).

post/apps/{name}/versions

Request

Path parameters

namestring required

The name of the app to create a version for.

Query parameters

environmentstring

The environment to deploy the new version to.

all_environmentsboolean

Whether to deploy the new version to all environments for this app. If true, the 'environment' query parameter is ignored.

Headers

X-Tower-Idempotency-Keystring

Optional opaque key that makes this request safe to retry: if a version of this app already has the key and the same code bundle, run size and parameters, that version is reused (and deployed to the target environments). Reusing a key with different code or settings returns 409 Conflict. When omitted, the server derives a key from the code bundle, run size and parameters, so repeating an identical request also reuses the existing version.

X-Tower-Request-Numberinteger

Optional account-scoped monotonic sequence token used to reject out-of-order writes. See the fence documentation for the acceptance window and retry behavior.

Request body

$schemastring uri

A URL to the JSON Schema for this object.

run_sizestring

The resource profile for the new version. Omit to keep the source version's run size; an empty string means undeclared (runs use basic.medium).

source_versionstring

The version whose code the new version reuses, e.g. 'v3'. Defaults to the version currently deployed to the target environment ('default' when deploying to all environments).

Example request

{
  "$schema": "https://api.tower.dev/v1/schemas/CreateAppVersionBody.json",
  "run_size": "basic.large",
  "source_version": "v3"
}

Response

Created

$schemastring uri

A URL to the JSON Schema for this object.

Example response

{
  "$schema": "https://api.tower.dev/v1/schemas/CreateAppVersionResponse.json"
}

Changes