Skip to main content
GET
/
projects
/
{projectId}
/
environments
Get list of project environments
curl --request GET \
  --url {schemes}://api.upsun.com/projects/{projectId}/environments \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "machine_name": "<string>",
    "title": "<string>",
    "attributes": {},
    "type": "development",
    "parent": "<string>",
    "default_domain": "<string>",
    "has_domains": true,
    "clone_parent_on_create": true,
    "deployment_target": "<string>",
    "is_pr": true,
    "has_remote": true,
    "status": "active",
    "http_access": {
      "is_enabled": true,
      "addresses": [
        {
          "permission": "allow",
          "address": "<string>"
        }
      ],
      "basic_auth": {}
    },
    "enable_smtp": true,
    "restrict_robots": true,
    "edge_hostname": "<string>",
    "deployment_state": {
      "last_deployment_successful": true,
      "last_deployment_at": "2023-11-07T05:31:56Z",
      "last_autoscale_up_at": "2023-11-07T05:31:56Z",
      "last_autoscale_down_at": "2023-11-07T05:31:56Z",
      "crons": {
        "enabled": true,
        "status": "paused"
      }
    },
    "sizing": {
      "services": {},
      "webapps": {},
      "workers": {}
    },
    "resources_overrides": {},
    "max_instance_count": 123,
    "last_active_at": "2023-11-07T05:31:56Z",
    "last_backup_at": "2023-11-07T05:31:56Z",
    "project": "<string>",
    "is_main": true,
    "is_dirty": true,
    "has_staged_activities": true,
    "can_rolling_deploy": true,
    "supports_rolling_deployments": true,
    "has_code": true,
    "head_commit": "<string>",
    "merge_info": {
      "commits_ahead": 123,
      "commits_behind": 123,
      "parent_ref": "<string>"
    },
    "has_deployment": true,
    "supports_restrict_robots": true
  }
]

Authorizations

Authorization
string
header
required

Path Parameters

projectId
string
required

Response

default - application/json
id
string
required

The identifier of Environment

created_at
string<date-time> | null
required

The creation date

updated_at
string<date-time> | null
required

The update date

name
string
required

The name of the environment

machine_name
string
required

The machine name for the environment

title
string
required

The title of the environment

attributes
Arbitrary attributes · object
required

Arbitrary attributes attached to this resource

type
enum<string>
required

The type of environment (production, staging or development), if not provided, a default will be calculated

Available options:
development,
production,
staging
parent
string | null
required

The name of the parent environment

default_domain
string | null
required

The default domain

has_domains
boolean
required

Whether the environment has domains

clone_parent_on_create
boolean
required

Clone data when creating that environment

deployment_target
string | null
required

Deployment target of the environment

is_pr
boolean
required

Is this environment a pull request / merge request

has_remote
boolean
required

Does this environment have a remote repository

status
enum<string>
required

The status of the environment

Available options:
active,
deleting,
dirty,
inactive,
paused
http_access
HTTP access permissions · object
required

The HTTP access permissions for this environment

enable_smtp
boolean
required

Whether to configure SMTP for this environment

restrict_robots
boolean
required

Whether to restrict robots for this environment

edge_hostname
string
required

The hostname to use as the CNAME

deployment_state
Deployment state · object
required

The environment deployment state

sizing
Sizing · object
required

The environment sizing configuration

resources_overrides
Resources overrides · object
required

Resources overrides

max_instance_count
integer | null
required

Max number of instances for this environment

last_active_at
string<date-time> | null
required

Last activity date

last_backup_at
string<date-time> | null
required

Last backup date

project
string
required

The project the environment belongs to

is_main
boolean
required

Is this environment the main environment

is_dirty
boolean
required

Is there any pending activity on this environment

has_staged_activities
boolean
required

Is there any staged activity on this environment

can_rolling_deploy
boolean
required

If the environment has rolling deployments ready for use

supports_rolling_deployments
boolean
required

If the environment supports rolling deployments

has_code
boolean
required

Does this environment have code

head_commit
string | null
required

The SHA of the head commit for this environment

merge_info
Merge info · object
required

The commit distance info between parent and child environments

has_deployment
boolean
required

Whether this environment had a successful deployment

supports_restrict_robots
boolean
required

Does this environment support configuring restrict_robots