Protect an environment for a project
Protects a specified environment for a project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The name of the environment
[DEPRECATED] The number of approvals required to deploy to this environment
Array of access levels allowed to deploy, with each described by a hash. One of user_id, group_id or access_level. They take the form of {user_id: integer}, {group_id: integer} or {access_level: integer} respectively.
object
The ID of a user with access to the project
The ID of a group with access to the project
Specify whether to take inherited group membership into account. Use 0 for direct group membership or 1 for all inherited groups. Default is 0
The access levels allowed to deploy
Array of access levels allowed to approve, with each described by a hash. One of user_id, group_id or access_level. They take the form of {user_id: integer}, {group_id: integer} or {access_level: integer} respectively. You can also specify the number of required approvals from the specified entity with required_approvals field.
object
The ID of a user with access to the project
The ID of a group with access to the project
Specify whether to take inherited group membership into account. Use 0 for direct group membership or 1 for all inherited groups. Default is 0
The ID of the approval rule to update
Deletes the object when true
The access levels allowed to approve
The number of approvals required for this rule
Responses
Section titled “Responses”Created
object
object
object
Example
{ "name": "production", "deploy_access_levels": { "id": 1, "access_level": 40, "access_level_description": "Maintainers", "deploy_key_id": 1, "user_id": 1, "group_id": 1, "member_role_id": 42, "member_role_name": "Lead Developer", "group_inheritance_type": 0 }, "required_approval_count": 2}Bad Request
Not found
Conflict
Unprocessable entity