Skip to content

Deploy a web service or agent app from a Git repository

POST
/deployments
curl --request POST \
--url https://api.global.stillbox.example/v1/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "repository": "example", "branch": "example", "environment": "example", "dir": "example", "build": "example", "start": "example", "port": 1, "health_path": "example", "visibility": "private", "image": "example", "env": { "additionalProperty": "example" }, "vcpus": 1, "memory_mb": 1, "disk_mb": 1, "auto_sleep_seconds": 1 }'

Makes a sandbox for the service, clones the repository (or the environment’s), runs the build command, then keeps the start command running, restarting it if it stops. Its port opens at an HTTPS address. The sandbox sleeps when nothing uses it and wakes on the next request.

Media typeapplication/json
object
name
required

Unique in your organization; lowercase letters, digits and dashes

string
/^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$/
repository

An https link to a public Git repository, or one your organization allows. Or use an environment’s repositories.

string
branch

The branch to deploy; the repository’s default if not set

string
environment

An environment whose repositories, variables and secrets the service gets

string
dir

Where to build and run, inside the home folder. The repository’s folder if not set.

string
build

Shell command run before start, and on every redeploy (npm ci && npm run build)

string
start
required

Shell command that runs the service. It must listen on $PORT.

string
port
required
integer
>= 1024 <= 65535
health_path

Checked over HTTP until it answers; / if not set

string
visibility
string
default: public
Allowed values: private public
image

The sandbox template; stillbox/base if not set

string
env
object
key
additional properties
string
vcpus
number format: double
memory_mb
integer
disk_mb
integer
auto_sleep_seconds

Sleep after this long with no requests; 0 never sleeps

integer

The new deployment; it builds and starts in its sandbox

Media typeapplication/json
object
id
required
string
name
required
string
sandbox_id
required
string
repository
string
branch
string
environment_id
string
dir
string
build
string
start
required
string
port
required
integer
health_path
string
visibility
required
string
Allowed values: private public
url

The service’s HTTPS address

string
version
required

Goes up on every redeploy

integer
sandbox_state

Running, asleep, or on its way to one

string
created_at
required
string format: date-time
deployed_at
string format: date-time

Example

{
"visibility": "private"
}

The request is invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

The API key is missing or invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

Only an owner can do this (owner_only), or the invitation is for another address (not_invited)

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

The change would leave the organization without an owner (last_owner), its seats are full (member_limit), or the person is already a member (already_member)

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}