---
title: "CreateProjectPolicy"
method: POST
path: "/gitpod.v1.ProjectService/CreateProjectPolicy"
tags: ["gitpod.v1.ProjectService"]
---

# CreateProjectPolicy

`POST /gitpod.v1.ProjectService/CreateProjectPolicy`

Creates a new policy for a project.

 Use this method to:
 - Set up access controls
 - Define group permissions
 - Configure role-based access

 ### Examples

 - Create admin policy:

   Grants admin access to a group.

   ```yaml
   projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
   groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
   role: PROJECT_ROLE_ADMIN
   ```

## Request body

- GitpodV1CreateProjectPolicyRequest — CreateProjectPolicyRequest creates a Project Policy.
  - `groupId` string, uuid — group_id specifies the group_id identifier
  - `projectId` string, uuid — project_id specifies the project identifier
  - `role` 'PROJECT_ROLE_UNSPECIFIED' | 'PROJECT_ROLE_ADMIN' | 'PROJECT_ROLE_USER' | 'PROJECT_ROLE_EDITOR'

## Response `200`

Success

- GitpodV1CreateProjectPolicyResponse
  - `policy` GitpodV1ProjectPolicy
    - `groupId` string, uuid
    - `role` 'PROJECT_ROLE_UNSPECIFIED' | 'PROJECT_ROLE_ADMIN' | 'PROJECT_ROLE_USER' | 'PROJECT_ROLE_EDITOR'

## Other responses

- `default` — Error

---

[API](https://skmtc.net/gitpod-io/apis/gitpod-v1.md) · [All operations](https://skmtc.net/gitpod-io/apis/gitpod-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitpod-io/gitpod-v1/revisions/44d50c2ac284/schema)
