Pull the latest code, build and restart
POST
/deployments/{deployment_id}/redeploy
const url = 'https://api.global.stillbox.example/v1/deployments/example/redeploy';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"build":"example","start":"example","port":1,"health_path":"example","pull":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.global.stillbox.example/v1/deployments/example/redeploy \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "build": "example", "start": "example", "port": 1, "health_path": "example", "pull": true }'Fields sent replace the deployment’s. The running service keeps serving until the new build succeeds; if it fails, the old one stays and the status says why.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”deployment_id
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
build
string
start
string
port
integer
health_path
string
pull
Pull the branch’s latest commits first
boolean
Responses
Section titled “Responses”The redeploy started; the status follows it
Media typeapplication/json
object
state
required
string
version
required
integer
commit
string
restarts
required
integer
started_at
string format: date-time
error
string
building
A redeploy is building while the previous version keeps serving
boolean
Example
{ "state": "waiting"}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"}No such sandbox in your organization (or no such file)
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}The sandbox isn’t running, or its server is unreachable right now
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}