API

AppEnvironment

A hosted app's environments: list, create, read, change, pause, resume, archive or remove one.

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/hosting/apps/{app_id}/environments/{id}/archive create Updated app environment
POST /api/v1/hosting/apps/{app_id}/environments/{id}/pause create Updated app environment
POST /api/v1/hosting/apps/{app_id}/environments/{id}/resume create Updated app environment
POST /api/v1/hosting/apps/{app_id}/environments create App environment created
GET /api/v1/hosting/apps/{app_id}/environments/{id} load Success
GET /api/v1/hosting/apps/{app_id}/environments load Success
PATCH /api/v1/hosting/apps/{app_id}/environments/{id} patch Updated app environment
DELETE /api/v1/hosting/apps/{app_id}/environments/{id} remove Success
PUT /api/v1/hosting/apps/{app_id}/environments/{id} update Updated app environment

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

app_environment, err := client.AppEnvironment(nil).Load(map[string]any{"app_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(app_environment)
created, err := client.AppEnvironment(nil).Create(map[string]any{"app_id": "example", "auto_deploy": true, "kind": "example", "location_id": "example", "name": "example", "slug": "example", "status": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
updated, err := client.AppEnvironment(nil).Update(map[string]any{"id": "example_id", "app_id": "example", "auto_deploy": true}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)
patched, err := client.AppEnvironment(nil).Patch(map[string]any{"id": "example_id", "app_id": "example", "auto_deploy": true}, nil)
if err != nil {
    panic(err)
}
fmt.Println(patched)
removed, err := client.AppEnvironment(nil).Remove(map[string]any{"app_id": "example", "id": "example_id"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(removed)

Lua

Construct client as shown in the Lua setup, then call the operations:

local app_environment, err = client:AppEnvironment():load({ app_id = "example" })
local created, err = client:AppEnvironment():create({ app_id = "example", auto_deploy = true, kind = "example", location_id = "example", name = "example", slug = "example", status = "example" })
local updated, err = client:AppEnvironment():update({ id = "example_id", app_id = "example", auto_deploy = true })
local patched, err = client:AppEnvironment():patch({ id = "example_id", app_id = "example", auto_deploy = true })
local removed, err = client:AppEnvironment():remove({ app_id = "example", id = "example_id" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$app_environment = $client->AppEnvironment()->load(["app_id" => "example"]);
$created = $client->AppEnvironment()->create(["app_id" => "example", "auto_deploy" => true, "kind" => "example", "location_id" => "example", "name" => "example", "slug" => "example", "status" => "example"]);
$updated = $client->AppEnvironment()->update(["id" => "example_id", "app_id" => "example", "auto_deploy" => true]);
$patched = $client->AppEnvironment()->patch(["id" => "example_id", "app_id" => "example", "auto_deploy" => true]);
$client->AppEnvironment()->remove(["app_id" => "example", "id" => "example_id"]);

Python

Construct client as shown in the Python setup, then call the operations:

app_environment = client.AppEnvironment().load({"app_id": "example"})
created = client.AppEnvironment().create({ "app_id": "example", "auto_deploy": True, "kind": "example", "location_id": "example", "name": "example", "slug": "example", "status": "example" })
updated = client.AppEnvironment().update({"id": "example_id", "app_id": "example", "auto_deploy": True})
patched = client.AppEnvironment().patch({"id": "example_id", "app_id": "example", "auto_deploy": True})
client.AppEnvironment().remove({"app_id": "example", "id": "example_id"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

app_environment = client.AppEnvironment.load({ "app_id" => "example" })
created = client.AppEnvironment.create({ "app_id" => "example", "auto_deploy" => true, "kind" => "example", "location_id" => "example", "name" => "example", "slug" => "example", "status" => "example" })
updated = client.AppEnvironment.update({ "id" => "example_id", "app_id" => "example", "auto_deploy" => true })
patched = client.AppEnvironment.patch({ "id" => "example_id", "app_id" => "example", "auto_deploy" => true })
client.AppEnvironment.remove({ "app_id" => "example", "id" => "example_id" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const app_environment = await client.AppEnvironment().load({ app_id: "example" })
const created = await client.AppEnvironment().create({ app_id: "example", auto_deploy: true, kind: "example", location_id: "example", name: "example", slug: "example", status: "example" })
const updated = await client.AppEnvironment().update({ id: "example_id", app_id: "example", auto_deploy: true })
const patched = await client.AppEnvironment().patch({ id: "example_id", app_id: "example", auto_deploy: true })
await client.AppEnvironment().remove({ app_id: "example", id: "example_id" })

Fields

Field Type Required Description
auto_deploy boolean Yes Auto Deploy
base_domain one,string,null Yes Base Domain
branch_pattern one,string,null Yes Branch Pattern
created_at string Yes Created At
created_at_label one,string,null Yes Created At Label
hosted_app_id string Yes Hosted App Id
id string Yes Id
kind string Yes Kind
location any Yes Location
location_id string Yes Location Id
name string Yes Name
slug string Yes Slug
status string Yes Status
updated_at string Yes Updated At
updated_at_label one,string,null Yes Updated At Label

create

POST /api/v1/hosting/apps/{app_id}/environments/{id}/archive

Operation ID: archive_api_v1_app_environment.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
id path string Yes

Request body

application/json

The request body is object.

Responses

200: Updated app environment

application/json

Property Type Required Description
environment object Yes
environment.auto_deploy boolean Yes
environment.base_domain string Yes
environment.branch_pattern string Yes
environment.created_at string (date-time) Yes
environment.created_at_label string Yes
environment.hosted_app_id string Yes
environment.id string Yes
environment.kind enum: production, staging, development, preview, ephemeral, custom Yes
environment.location object or null Yes
environment.location_id string Yes
environment.name string Yes
environment.slug string Yes
environment.status enum: active, paused, archived Yes
environment.updated_at string (date-time) Yes
environment.updated_at_label string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/hosting/apps/{app_id}/environments/{id}/pause

Operation ID: pause_api_v1_app_environment.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
id path string Yes

Request body

application/json

The request body is object.

Responses

200: Updated app environment

application/json

Property Type Required Description
environment object Yes
environment.auto_deploy boolean Yes
environment.base_domain string Yes
environment.branch_pattern string Yes
environment.created_at string (date-time) Yes
environment.created_at_label string Yes
environment.hosted_app_id string Yes
environment.id string Yes
environment.kind enum: production, staging, development, preview, ephemeral, custom Yes
environment.location object or null Yes
environment.location_id string Yes
environment.name string Yes
environment.slug string Yes
environment.status enum: active, paused, archived Yes
environment.updated_at string (date-time) Yes
environment.updated_at_label string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/hosting/apps/{app_id}/environments/{id}/resume

Operation ID: resume_api_v1_app_environment.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
id path string Yes

Request body

application/json

The request body is object.

Responses

200: Updated app environment

application/json

Property Type Required Description
environment object Yes
environment.auto_deploy boolean Yes
environment.base_domain string Yes
environment.branch_pattern string Yes
environment.created_at string (date-time) Yes
environment.created_at_label string Yes
environment.hosted_app_id string Yes
environment.id string Yes
environment.kind enum: production, staging, development, preview, ephemeral, custom Yes
environment.location object or null Yes
environment.location_id string Yes
environment.name string Yes
environment.slug string Yes
environment.status enum: active, paused, archived Yes
environment.updated_at string (date-time) Yes
environment.updated_at_label string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/hosting/apps/{app_id}/environments

Operation ID: post_api_v1_hosting_apps_app_id_environments.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes

Request body

application/json

Property Type Required Description
auto_deploy boolean Yes
base_domain string No
branch_pattern string No
kind enum: production, staging, development, preview, ephemeral, custom Yes
location_id string Yes
name string Yes
slug string Yes
status enum: active, paused, archived Yes

Responses

200: App environment created

application/json

Property Type Required Description
environment object Yes
environment.auto_deploy boolean Yes
environment.base_domain string Yes
environment.branch_pattern string Yes
environment.created_at string (date-time) Yes
environment.created_at_label string Yes
environment.hosted_app_id string Yes
environment.id string Yes
environment.kind enum: production, staging, development, preview, ephemeral, custom Yes
environment.location object or null Yes
environment.location_id string Yes
environment.name string Yes
environment.slug string Yes
environment.status enum: active, paused, archived Yes
environment.updated_at string (date-time) Yes
environment.updated_at_label string Yes
201: App environment created

application/json

Property Type Required Description
environment object Yes
environment.auto_deploy boolean Yes
environment.base_domain string Yes
environment.branch_pattern string Yes
environment.created_at string (date-time) Yes
environment.created_at_label string Yes
environment.hosted_app_id string Yes
environment.id string Yes
environment.kind enum: production, staging, development, preview, ephemeral, custom Yes
environment.location object or null Yes
environment.location_id string Yes
environment.name string Yes
environment.slug string Yes
environment.status enum: active, paused, archived Yes
environment.updated_at string (date-time) Yes
environment.updated_at_label string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Deployment request failed validation

application/json

Property Type Required Description
details array of string No
error string Yes
502: Bad gateway

load

GET /api/v1/hosting/apps/{app_id}/environments/{id}

Operation ID: api_v1_app_environment.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
id path string Yes

Responses

200: Success

application/json

The response is object.

401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

GET /api/v1/hosting/apps/{app_id}/environments

Operation ID: api_v1_app_environments.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes

Responses

200: Success

application/json

The response is object.

401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

patch

PATCH /api/v1/hosting/apps/{app_id}/environments/{id}

Operation ID: patch_api_v1_hosting_apps_app_id_environments_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
id path string Yes

Request body

application/json

Property Type Required Description
auto_deploy boolean No
base_domain string No
branch_pattern string No
kind enum: production, staging, development, preview, ephemeral, custom No
location_id string No
name string No
slug string No
status enum: active, paused, archived No

Responses

200: Updated app environment

application/json

Property Type Required Description
environment object Yes
environment.auto_deploy boolean Yes
environment.base_domain string Yes
environment.branch_pattern string Yes
environment.created_at string (date-time) Yes
environment.created_at_label string Yes
environment.hosted_app_id string Yes
environment.id string Yes
environment.kind enum: production, staging, development, preview, ephemeral, custom Yes
environment.location object or null Yes
environment.location_id string Yes
environment.name string Yes
environment.slug string Yes
environment.status enum: active, paused, archived Yes
environment.updated_at string (date-time) Yes
environment.updated_at_label string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Deployment request failed validation

application/json

Property Type Required Description
details array of string No
error string Yes
502: Bad gateway

remove

DELETE /api/v1/hosting/apps/{app_id}/environments/{id}

Operation ID: delete_api_v1_hosting_apps_app_id_environments_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
id path string Yes

Responses

200: Success

application/json

The response is object.

401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

update

PUT /api/v1/hosting/apps/{app_id}/environments/{id}

Operation ID: put_api_v1_hosting_apps_app_id_environments_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
id path string Yes

Request body

application/json

Property Type Required Description
auto_deploy boolean No
base_domain string No
branch_pattern string No
kind enum: production, staging, development, preview, ephemeral, custom No
location_id string No
name string No
slug string No
status enum: active, paused, archived No

Responses

200: Updated app environment

application/json

Property Type Required Description
environment object Yes
environment.auto_deploy boolean Yes
environment.base_domain string Yes
environment.branch_pattern string Yes
environment.created_at string (date-time) Yes
environment.created_at_label string Yes
environment.hosted_app_id string Yes
environment.id string Yes
environment.kind enum: production, staging, development, preview, ephemeral, custom Yes
environment.location object or null Yes
environment.location_id string Yes
environment.name string Yes
environment.slug string Yes
environment.status enum: active, paused, archived Yes
environment.updated_at string (date-time) Yes
environment.updated_at_label string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Deployment request failed validation

application/json

Property Type Required Description
details array of string No
error string Yes
502: Bad gateway