Groundfloor Docs

Environments API

List and manage workspace environments used as promote and deploy targets.

Environments (typically dev, staging, prod) are created with a workspace and used by promotion and deploy flows.

See also: Environment Promotion · Workspaces

List / create (workspace)

MethodPathPermissionNotes
GET/v1/workspaces/{workspace_id}/environmentsread
POSTsamewriteBody: { "name": "qa" }
PATCH…/environments/{environment_id}writename?, status? (active|suspended), site_label?, site_access?, site_access_roles?. The site_* fields need ddl too; see Site settings
DELETE…/environments/{environment_id}delete409 while it would open apps to more people; see Site settings

Environment names start with a lowercase letter, then use lowercase letters, digits and hyphens, and end with a letter or digit (up to 63 characters, for example qa-1). Names are trimmed and lowercased; anything else is 422. Creating a name that already exists in the workspace is 409.

Each environment has id, workspace_id, name, status, created_at and the site fields below.

Site settings

Each environment can have its own Shell site; see A Shell site for each environment. Rolling out: until it's on for your region, site_host is null and site_access can't be changed from inherit (409).

FieldMeaning
site_labelThe environment's name in its site address: {site}.{site_label}.app.groundfloor.cloud, where {site} is the workspace's subdomain, else its slug. prod is the plain {site}.app.groundfloor.cloud. Set from the name when the environment is created, unique in the workspace, and unchanged by a rename. null = no site of its own
site_accessWho can open the site: inherit (default; the same people as prod), roles (only site users holding one of site_access_roles) or public (no sign-in)
site_access_rolesThe roles allowed with roles. Up to 50; Groundfloor's own system roles aren't allowed
site_hostRead-only: the environment's site address, without a custom domain. null when sites per environment are off for your region, the environment is suspended, or its label has no site. With them on (shell_env_sites_enabled) and an active prod environment in the workspace, null means this environment's apps are on no Shell site

PATCH body, for example:

{ "site_access": "roles", "site_access_roles": ["staff"] }
  • Send "site_label": null to remove the label. A label used by another environment of the workspace is 409. Labels are one DNS label: lowercase letters, digits and -, up to 63 characters. Only dev, staging and prod get a site.
  • roles needs at least one role (422). site_access_roles with any other value is 422; leaving roles clears the list.
  • public is accepted only while the workspace's sign-in mode is none (422 otherwise). If sign-in is turned on later, a stored public counts as inherit.
  • inherit, and apps with no environment, follow the prod environment's rule. A stored roles rule is applied even where sites per environment aren't on yet.
  • Changing any site_* field needs ddl on the workspace (Admin or Owner); site users get 403. Changes are recorded in the audit log with the values before and after.
  • DELETE of an environment with site_access: "roles" is 409 while it has live apps. For the prod environment, removing or changing its prod label is also 409 while live apps follow its rule. Set site_access to inherit, or archive or move the apps, first.

GET /v1/me/capabilities also returns shell_env_sites_enabled (whether sites per environment are on for your region; site_access can be changed only then) and env_site_labels (the labels that get a site, for example ["dev", "staging", "prod"]).

Get by id

GET /v1/environments/{environment_id}

Permission: read on the environment

Promote channels

Promotion is not a single environments endpoint — use the resource APIs:

ChannelCompare / promote
Secrets/v1/workspaces/{id}/secrets/compare|promote
FlagsFlags API
AppsApps API
CoderunnersCoderunners API