GET /api/v3/envs/ID

Retrieves properties of an environment and enables verification of the requesting user’s permissions to the environment

Request Path

GET /api/v3/envs/{envID}?permission={permission_value}

Request Payload

None

Parameters

{envID} The environment’s ID. To retrieve environment IDs, use GET /api/v3/envs.
permission Optional. Specifies a type of permission to access the environment. Returns an error (status code 500) if the requesting user does not have the specified permission level. Otherwise, returns the environment properties.

{permission value} can be:

  • view. Returns error if the requesting user is not allowed to view the environment.
  • edit. Returns error if the requesting user is not allowed to edit the environment.
  • owner. Returns error if the requesting user is not the owner of the environment.

Response Example

When environment properties are returned:


    {
        "projectId": "PRjTcEu83MXmpDAHTf47b-QQ2",
        "policyId": "POO2IC9GqXpX-hw58ph1Wwcg2",
        "description": "Jump up and down",
        "ownerEmail": "johndoe@cloudshare.com",
        "regionId": "REKolD1-ab84YIxODeMGob9A2",
        "name": "John Doe Environment No. 5",
        "id": "ENTpOuRlNpoZge7NmnR6K6QA2",
        "status":"Ready",
        "teamId":null
    }

When permission is specified as view and the user is not allowed to view the environment:

{
    "message": "You're not allowed to view this environment",
    "code": "0x5006B"
}

When permission is specified as edit and the user is not allowed to edit the environment:

{
    "message": "You're not allowed to edit this environment",
    "code": "0x5006A"
}

When permission is specified as owner and the user is not the owner of the environment:

{
    "message": "You're not the owner of this environment",
    "code": "0x5006C"
}