---
title: "Create a new environment for app"
method: POST
path: "/apps/{appId}/environments"
tags: ["apps"]
---

# Create a new environment for app

`POST /apps/{appId}/environments`

## Request

- Base URL: `https://pmp-demo.privateplatform.mendix.com/deployservice/v1`
- URL: `https://pmp-demo.privateplatform.mendix.com/deployservice/v1/apps/{appId}/environments`
- Auth: one of:
  - HTTP basic
  - API key in header `Authorization`

Create a new environment with specified configuration and resources for specified app.

## Path parameters

- `appId` string, required

## Request body

- EnvironmentCreateRequest: Request to create a new environment.
  - `displayName` string, required: Display name of the environment
  - `clusterName` string, required: Cluster name where the environment will be deployed
  - `namespace` string, required: Namespace for the environment
  - `storagePlanName` string, required: Name of the storage plan for the environment
  - `databasePlanName` string, required: Name of the database plan for the environment
  - `deploymentPackageName` string, required: Name of the package for the deployment
  - `deploymentPurpose` 'Development' | 'Test' | 'Acceptance' | 'Production', required: Purpose for the deployment
  - `isExternalSecretStoreEnabled` 'Yes' | 'No': Indicate if External Secret Store is enabled for environment configuration, applicable only for Standalone mode cluster.
  - `coreResourcePlan` string: Core Resource Plan for environment creation, it's only for connected mode.
  - `coreResourceSize` 'Small' | 'Medium' | 'Large': Core Resource Size for environment, not support Custom Size for environment creation. If need, please use PATCH API to config Custom Size after environment created.

## Response `202`

Response for async  operations include create environment, deploy, apply config, start, stop and restart app.

- AsyncOperationResponse: Response for async operations include create environment, deploy, apply config, start, stop and restart app.
  - `environmentId` string: Environment id
  - `pipelineId` integer: Deploy pipeline id
  - `message` string: operations message

## Other responses

- `400`: Invalid input parameter or request body
- `401`: Authentication information is missing or invalid
- `403`: User has no permission for this operation
- `404`: Resource not found

---

[API](https://skmtc.dev/mendix/apis/deploy-service-v1.md) - [All operations](https://skmtc.dev/mendix/apis/deploy-service-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/mendix/apis/deploy-service-v1/revisions/375e6f7be385?raw)
