---
title: "Update a custom role"
method: PUT
path: "/v1/roles/{roleId}"
tags: ["Roles"]
---

# Update a custom role

`PUT /v1/roles/{roleId}`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/roles/{roleId}`
- Auth: none declared

Updates an existing custom role. System roles cannot be updated.

## Path parameters

- `roleId` string, required

## Request body

- UpdateRole
  - `description` string, required: Description of the role
  - `name` string, required: The name of the role
  - `permissionIds` string[], required: Permission IDs to assign to this role

## Response `200`

Role updated successfully

- Role
  - `builtin` boolean: Whether this is a built-in role
  - `createdAt` string, date-time: When the role was created (null for system roles)
  - `createdBy` string: Who created the role (null for system roles)
  - `description` string, required: Description of the role
  - `effect` string: The effect of this role's permissions: 'allow' or 'deny'. Defaults to 'allow' for standard roles.
  - `id` string, required: The id of the role.
  - `name` string, required: The user-facing name of the role.
  - `permissionIds` string[], required: Permission IDs assigned to this role (empty for system roles)

## Other responses

- `400`: Invalid request data or system role
- `403`: Insufficient permissions
- `404`: Role not found
- `409`: Role name already exists

---

[API](https://skmtc.dev/grepr/apis/grepr-api.md) - [All operations](https://skmtc.dev/grepr/apis/grepr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grepr/apis/grepr-api/revisions/2a5ce03a0bf0?raw)
