---
title: "Create Role"
method: POST
path: "/access/api/v1/projects/{projectKey}/roles"
tags: ["Roles"]
---

# Create Role

`POST /access/api/v1/projects/{projectKey}/roles`

Adds a new role to the project.

**Security:** Requires Platform Admin or Project Admin with Manage
Members privilege.

## Path parameters

- `projectKey` string, required

## Request body

- ProjectRoleCreate
  - `name` string, required — Role name
  - `description` string — Role description
  - `type` string, required — Role type
  - `environments` string[]
  - `actions` string[]

## Response `201`

Role created

- ProjectRole
  - `name` string — Role name
  - `description` string — Role description
  - `type` 'PREDEFINED' | 'CUSTOM' | 'CUSTOM_GLOBAL' — Role type. `PREDEFINED` = built-in role, `CUSTOM` = project-scoped custom role, `CUSTOM_GLOBAL` = global custom role.
  - `environments` string[] — Environments for the role
  - `actions` string[] — Actions permitted by this role

## Other responses

- `400` — Bad Request - Invalid input
- `401` — Bad Credentials - Invalid credentials
- `403` — Permission Denied - Insufficient permissions
- `404` — Not Found - Project not found

---

[API](https://skmtc.dev/jfrog/apis/jfrog-platform-projects-api.md) · [All operations](https://skmtc.dev/jfrog/apis/jfrog-platform-projects-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/jfrog/jfrog-platform-projects-api/revisions/1c6bb09154a9/schema)
