Projects

Add an environment to a project.

This endpoint adds the provided environment to the specified project, with optional support for enabling and disabling change requests for the environment and project.

post/api/admin/projects/{projectId}/environments

Path parameters

projectIdstring required

Request body

environmentstring required

The environment to add to the project

changeRequestsEnabledboolean

Whether change requests should be enabled or for this environment on the project or not

Example request

{
  "environment": "development",
  "changeRequestsEnabled": true,
  "defaultStrategy": {
    "name": "flexibleRollout",
    "title": "Gradual Rollout 25-Prod",
    "sortOrder": 9999,
    "constraints": [
      {
        "values": [
          "1",
          "2"
        ],
        "inverted": false,
        "operator": "IN",
        "contextName": "appName",
        "caseInsensitive": false
      }
    ],
    "variants": [
      {
        "name": "blue_group",
        "weightType": "fix",
        "stickiness": "custom.context.field",
        "payload": {
          "type": "json",
          "value": "{\"color\": \"red\"}"
        }
      }
    ],
    "segments": [
      1,
      2
    ]
  }
}

Response

This response has no body.

Changes

Changed in 2 of the 7 revisions of this API.13

  • b2c3116e633e12See the full diff
    • the /// request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • added the new SEMVER_GTE enum value to the request property ///

      request-property-enum-value-added

    • added the new SEMVER_LTE enum value to the request property ///

      request-property-enum-value-added

    • added the new REGEX enum value to the request property ///

      request-property-enum-value-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog