---
title: "Get an environment"
method: GET
path: "/projects/{projectId}/environments/{environmentId}"
tags: ["Environment"]
---

# Get an environment

`GET /projects/{projectId}/environments/{environmentId}`

Retrieve the details of a single existing environment.

## Path parameters

- `projectId` string, required
- `environmentId` string, required

## Response `default`

- Environment
  - `id` string, required — The identifier of Environment
  - `created_at` string, date-time, nullable, required — The creation date
  - `updated_at` string, date-time, nullable, 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` object, required — Arbitrary attributes attached to this resource
  - `type` 'development' | 'production' | 'staging', required — The type of environment (`production`, `staging` or `development`), if not provided, a default will be calculated
  - `parent` string, nullable, required — The name of the parent environment
  - `default_domain` string, nullable, 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, nullable, 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` 'active' | 'deleting' | 'dirty' | 'inactive' | 'paused', required — The status of the environment
  - `http_access` object, required — The HTTP access permissions for this environment
    - `is_enabled` boolean, required — Whether http_access control is enabled
    - `addresses` object[], required
      - `permission` 'allow' | 'deny', required
      - `address` string, required — IP address or CIDR
    - `basic_auth` object, required
  - `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` object, nullable, required — The environment deployment state
    - `last_deployment_successful` boolean, required — Whether the last deployment was successful
    - `last_deployment_at` string, date-time, nullable, required — Datetime of the last deployment
    - `last_autoscale_up_at` string, date-time, nullable, required — Datetime of the last autoscale up deployment
    - `last_autoscale_down_at` string, date-time, nullable, required — Datetime of the last autoscale down deployment
    - `crons` object, required — The crons deployment state
      - `enabled` boolean, required — Enabled or disabled
      - `status` 'paused' | 'running' | 'sleeping', required — The status of the crons
  - `sizing` object, nullable, required — The environment sizing configuration
    - `services` object, required
    - `webapps` object, required
    - `workers` object, required
  - `resources_overrides` object, required — Resources overrides
  - `max_instance_count` integer, nullable, required — Max number of instances for this environment
  - `last_active_at` string, date-time, nullable, required — Last activity date
  - `last_backup_at` string, date-time, nullable, 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, nullable, required — The SHA of the head commit for this environment
  - `merge_info` object, required — The commit distance info between parent and child environments
    - `commits_ahead` integer, nullable, required — The amount of commits that are in the environment but not in the parent
    - `commits_behind` integer, nullable, required — The amount of commits that are in the parent but not in the environment
    - `parent_ref` string, nullable, required — The reference in Git for the parent environment
  - `has_deployment` boolean, required — Whether this environment had a successful deployment
  - `supports_restrict_robots` boolean, required — Does this environment support configuring restrict_robots

---

[API](https://skmtc.net/upsun/apis/upsun-com-rest-api.md) · [All operations](https://skmtc.net/upsun/apis/upsun-com-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/upsun/upsun-com-rest-api/revisions/6cc88fde6435/schema)
