---
title: "Update an existing role by ID"
method: PUT
path: "/api/v1/roles/{id}"
tags: ["Roles"]
---

# Update an existing role by ID

`PUT /api/v1/roles/{id}`

Required scope - write_role

## Path parameters

- `id` number, required

## Request body

- PutRoleReq
  - `name` string
  - `note` string

## Response `200`

- object
  - `role` Role
    - `id` number, required
    - `name` string, required
    - `note` string, required
    - `createdAt` string, required
    - `updatedAt` string, required
    - `deletedAt` string, nullable, required

## Changes

- **2024-10-03** `795cad873b47` — 6 info
  - the response property `role/createdAt` became required for the status `200`
  - the response property `role/deletedAt` became required for the status `200`
  - the response property `role/id` became required for the status `200`
  - the response property `role/name` became required for the status `200`
  - …2 more
- **2024-08-11** `11e2773b3a1e` — 6 breaking
  - the response property `role/createdAt` became optional for the status `200`
  - the response property `role/deletedAt` became optional for the status `200`
  - the response property `role/id` became optional for the status `200`
  - the response property `role/name` became optional for the status `200`
  - …2 more

[Change history](https://skmtc.dev/valuemelody/apis/melody-auth-s2s-api/changes/api/v1/roles/:id/put.md)

---

[API](https://skmtc.dev/valuemelody/apis/melody-auth-s2s-api.md) · [All operations](https://skmtc.dev/valuemelody/apis/melody-auth-s2s-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/valuemelody/melody-auth-s2s-api/revisions/2e1471620fd7/schema)
