## UpdateProjectPolicy `projects.policies.update(PolicyUpdateParams**kwargs) -> PolicyUpdateResponse` **post** `/gitpod.v1.ProjectService/UpdateProjectPolicy` Updates an existing project policy. Use this method to: - Modify access levels - Change group roles - Update permissions ### Examples - Update policy role: Changes a group's access level. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" role: PROJECT_ROLE_EDITOR ``` ### Parameters - `group_id: Optional[str]` group_id specifies the group_id identifier - `project_id: Optional[str]` project_id specifies the project identifier - `role: Optional[ProjectRole]` - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Returns - `class PolicyUpdateResponse: …` - `policy: Optional[ProjectPolicy]` - `group_id: Optional[str]` - `role: Optional[ProjectRole]` role is the role assigned to the group - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Example ```python import os from gitpod import Gitpod client = Gitpod( bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted ) policy = client.projects.policies.update( group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_EDITOR", ) print(policy.policy) ``` #### Response ```json { "policy": { "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "role": "PROJECT_ROLE_UNSPECIFIED" } } ```