Change Requests

Create/Add change to a change request

Enterprise feature

Given a change request exists, this endpoint will attempt to add a change to

an existing change request for the user. If a change request does not exist,

it will attempt to create one.

post/api/admin/projects/{projectId}/environments/{environment}/change-requests

Path parameters

projectIdstring required
environmentstring required

Request body

OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR

Example request

{
  "payload": {
    "name": "beta-users",
    "description": "Users willing to help us test and build new features.",
    "project": "red-vista",
    "constraints": [
      {
        "contextName": "appName",
        "operator": "IN",
        "values": [
          "my-app",
          "my-other-app"
        ],
        "value": "my-app"
      }
    ]
  }
}

Response

changeRequestSchema

OR

Example response

{
  "id": 3,
  "title": "Increasing gradual rollout",
  "environment": "development",
  "minApprovals": 2,
  "project": "unleash-project",
  "features": [
    {
      "name": "my-feature",
      "conflict": "Feature has been archived",
      "changes": [
        {
          "id": 33,
          "action": "updateStrategy",
          "conflict": "Strategy has been deleted",
          "payload": [
            {
              "id": "9c40958a-daac-400e-98fb-3bb438567008",
              "sortOrder": 1
            }
          ],
          "createdAt": "2023-07-31T13:22:03+02:00"
        }
      ],
      "defaultChange": {
        "action": "addStrategy",
        "payload": {
          "name": "flexibleRollout",
          "title": "",
          "disabled": false,
          "segments": [],
          "parameters": {
            "groupId": "my-feature",
            "rollout": "100",
            "stickiness": "default"
          },
          "constraints": [
            {
              "values": [
                "ux"
              ],
              "inverted": false,
              "operator": "STR_CONTAINS",
              "contextName": "userId",
              "caseInsensitive": false
            }
          ]
        }
      }
    }
  ],
  "segments": [
    {
      "id": 33,
      "action": "updateStrategy",
      "conflict": "Strategy has been deleted",
      "payload": [
        {
          "id": "9c40958a-daac-400e-98fb-3bb438567008",
          "sortOrder": 1
        }
      ],
      "createdAt": "2023-07-31T13:22:03+02:00",
      "name": "beta-users"
    }
  ],
  "approvals": [
    {
      "createdBy": {
        "id": 33,
        "username": "unleash-user"
      },
      "createdAt": "2022-12-12T12:13:24.218Z"
    }
  ],
  "rejections": [
    {
      "createdBy": {
        "id": 33,
        "username": "unleash-user"
      },
      "createdAt": "2022-12-12T12:13:24.218Z"
    }
  ],
  "comments": [
    {
      "id": 33,
      "text": "This is a comment",
      "createdBy": {
        "username": "unleash-user"
      },
      "createdAt": "2022-12-12T12:13:24.218Z"
    }
  ],
  "createdBy": {
    "username": "Hunter"
  },
  "createdAt": "2023-07-31T13:33:02Z",
  "stateTimestamps": {
    "Draft": "2023-07-31T13:33:02Z",
    "In review": "2023-08-01T10:15:30Z",
    "Approved": "2023-08-02T09:01:00Z"
  }
}

Changes

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

  • b2c3116e633e11See the full diff
    • removed subschema #4 subschema #23 from the request body oneOf list

      request-body-one-of-removed

    • added subschema #4 subschema #23 to the request body oneOf list

      request-body-one-of-added

  • 774670258f0422See the full diff
    • removed subschema #4 subschema #18 subschema #19 subschema #20 from the request body oneOf list

      request-body-one-of-removed

    • added subschema #1 subschema #2 to the response body oneOf list for the response status

      response-body-one-of-added

    • added subschema #4 subschema #5 subschema #19 subschema #20 subschema #21 subschema #22 subschema #23 to the request body oneOf list

      request-body-one-of-added

    • removed subschema #1 subschema #2 from the response body oneOf list for the response status

      response-body-one-of-removed

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