patch https://api.split.io/internal/api/v2/environments/ws//
Updates an environment.
Access requirements
The Authorization Bearer (Admin API Key authorizing the request) must have one of the following roles and scopes:
Admin API Key roles accepted
- API_ALL_GRANTED
- API_ADMIN
- API_WORKSPACE_ADMIN
Admin API Key scopes accepted
- GLOBAL
- WORKSPACE
To learn more about Admin API Key roles and scopes, see API keys overview.
With Skip Approvals
Skipping approvals requires passing the approvalSkippableBy attribute in the payload. However, it’s only allowed if the approvers are required or approvers are restricted. Also, as for this current version, Administrators must be the only group that can skip the approvals. Modifying the name might cause issues in the user interface.
curl --location --request PATCH 'https://app.split.io/internal/api/v2/environments/ws/<ws_id>/<env_id>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <api_key>' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"op": "replace",
"path": "/changePermissions",
"value": {
"areApprovalsRequired": true,
"areApproversRestricted": false,
"approvers": [],
"areEditorsRestricted": true,
"editors": [],
"approvalSkippableBy": [
{
"id": "dd40c2f0-30f1-11e7-ba78-12395d4a9634",
"name": "Administrators",
"type": "group"
}
]
}
}
]'
{
"id": "<env_id>",
"type": "environment",
"name": "<env_name>",
"environmentType": "pre_production",
"changePermissions": {
"areApprovalsRequired": true,
"approvalSkippableBy": [
{
"id": "<admin_group_id>",
"name": "Administrators",
"type": "group"
}
]
},
"dataExportPermissions": {
"type": "data_export_permission"
},
"orgId": "dd3c0800-30f1-11e7-ba78-12395d4a9634",
"creationTime": 1657223400852,
"production": false,
"status": "ACTIVE",
"workspaceIds": [
"<ws_id>"
],
"permissioningEnabled": false
}
{
"code": 400,
"message": "Only Administrators group can skip approval. {id} is not an Administrators group.",
"details": "",
"transactionId": "5e85123605b9d50a6dde68b73144d34c"
}