Create Environment

POST {{apiPath}}/environments

The sample shows the POST /environments operation to create a new environment associated with the organization encoded in the access token. In the request body, the name, region, and type attributes are required. The value of the name attribute must be unique within the organization. The billOfMaterials attribute allows you to specify the Ping products associated with this environment.

If you set the type attribute to PRODUCTION, you cannot delete the environment until you reset the value to SANDBOX. If you have a trial license, you cannot create PRODUCTION environments or promote SANDBOX environments to PRODUCTION.

Note: If a worker application creates a new environment, that worker application is given Identity Data Admin and Client Application Developer role assignments for that environment automatically. Only the worker application can perform Identity Data Admin operations in that environment. However, the worker application can give the same role assignment to another user or another worker application. Additionally, if the worker application doesn't have the Environment Admin role assigned for the Organization, the worker app is also assigned the Environment Admin role for the new environment. For more information about roles, see Roles.

Warning: Access to a worker application's client secret requires having a superset of the worker application's role assignments. Initially, the worker application is granted all of the role assignments of the admin (or worker app) that created it, which gives the admin (or any other admin with a superset of those role assignments) access to the worker application's secret.

However, if the worker application ever gains new role assignments (for example, by creating a new environment and being granted role assignments to cover the new environment), then this can mean that the admin who originally created the worker application can no longer access its secret. This can happen when the admin roles aren't a superset of the new role assignments for the worker application.

You can address this condition by ensuring that when an environment is created by a worker application, that worker application grants any newly received role assignments for that environment to any admins who need access to the worker application's secret. For example:

Assume there's an admin who always has full access to all environments in an Organization. This admin already has Organization Admin and Environment Admin role assignments at the Organization level. Assume as well, there's a worker application that occasionally may create new environments. To ensure this admin maintains full access to the new environments created by the worker app, as well as access to the worker application's client secret, an environment-creation script might look like this:

  1. The worker application creates a new environment (POST {{apiPath}}/environments).
  2. The worker application creates an Identity Data Admin role assignment for the admin, scoped to the newly created environment (POST {{apiPath}}/users/<AdminUserID>/roleAssignments).
  3. The worker application creates a Client Application Developer role assignment for the admin user (POST {{apiPath}}/users/<AdminUserID>/roleAssignments).

See the the Administrator Permissions and Role Assignments section in the PingOne Developer Guide for more information.

Prerequisites

For property descriptions, see Environments data model.

Caution: For the region property, if your environments use the AP region designation (api.pingone.asia domain) for Asia-Pacific countries, be aware that this region does not support the migration of PingID customers (or the PingID product) to the PingOne platform. To get PingID platform support for your Asia-Pacific environments, use the AU region designation (api.pingone.com.au domain) when creating your environments.

PropertyTypeRequired?
billOfMaterialsObjectOptional
billOfMaterials.products[0]ArrayOptional
billOfMaterials.products[0].idStringRequired
billOfMaterials.products[0].typeStringOptional
billOfMaterials.products[0].descriptionStringOptional
billOfMaterials.products[0].consoleStringOptional
billOfMaterials.products[0].softwareLicense.idStringOptional
billOfMaterials.products[0].deployment.idStringOptional
descriptionStringOptional
iconStringOptional
license.idStringRequired
nameStringRequired
organization.idStringOptional
regionStringRequired
typeStringRequired

Request Body

{"name"=>"New-Env_{{$timestamp}}", "description"=>"New environment description", "type"=>"SANDBOX", "region"=>"NA", "icon"=>"https://example.com/icons/environment.jpg", "billOfMaterials"=>{"products"=>[{"type"=>"PING_ONE_BASE", "description"=>"New environment product description", "console"=>{"href"=>"https://example.com"}}]}, "license"=>{"id"=>"{{licenseID}}"}}

RESPONSES

status: Created

{&quot;_links&quot;:{&quot;self&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6&quot;},&quot;organization&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda&quot;},&quot;license&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84&quot;},&quot;populations&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/populations&quot;},&quot;users&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users&quot;},&quot;applications&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/applications&quot;},&quot;activities&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/activities&quot;},&quot;branding&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/branding&quot;},&quot;resources&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/resources&quot;},&quot;passwordPolicies&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/passwordPolicies&quot;},&quot;userActivities&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/userActivities&quot;},&quot;signOnPolicies&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/signOnPolicies&quot;},&quot;keys&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/keys&quot;},&quot;templates&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/templates&quot;},&quot;notificationsSettings&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/notificationsSettings&quot;},&quot;schemas&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/schemas&quot;},&quot;gateways&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/gateways&quot;},&quot;capabilities&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/capabilities&quot;},&quot;activeIdentityCounts&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/activeIdentityCounts&quot;},&quot;propagation/plans&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/propagation/plans&quot;},&quot;propagation/stores&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/propagation/stores&quot;},&quot;propagation/revisions/id:latest&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/propagation/revisions/id:latest&quot;},&quot;billOfMaterials&quot;:{&quot;href&quot;:&quot;https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/billOfMaterials&quot;}},&quot;id&quot;:&quot;abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6&quot;,&quot;name&quot;:&quot;New-Env_1705684982&quot;,&quot;description&quot;:&quot;New environment description&quot;,&quot;organization&quot;:{&quot;id&quot;:&quot;bed432e6-676a-4ebe-b5a5-6b3b54e46bda&quot;},&quot;type&quot;:&quot;SANDBOX&quot;,&quot;region&quot;:&quot;NA&quot;,&quot;createdAt&quot;:&quot;2024-01-19T17:23:01.796Z&quot;,&quot;updatedAt&quot;:&quot;2024-01-19T17:23:01.796Z&quot;,&quot;license&quot;:{&quot;id&quot;:&quot;3f06970a-3235-46cb-b46f-xxxxxxxxxxxx&quot;},&quot;billOfMaterials&quot;:{&quot;products&quot;:[{&quot;id&quot;:&quot;cb7a53e5-b413-4134-8216-d846abe891b8&quot;,&quot;type&quot;:&quot;PING_ONE_BASE&quot;,&quot;description&quot;:&quot;New environment product description&quot;,&quot;console&quot;:{&quot;href&quot;:&quot;https://example.com&quot;}}],&quot;createdAt&quot;:&quot;2024-01-19T17:23:01.808Z&quot;,&quot;updatedAt&quot;:&quot;2024-01-19T17:23:01.808Z&quot;},&quot;icon&quot;:&quot;https://example.com/icons/environment.jpg&quot;}