---
title: "Create a new role"
method: POST
path: "/api/v1/roles"
tags: ["Roles"]
---

# Create a new role

`POST /api/v1/roles`

Required scope - write_role

## Request body

- PostRoleReq
  - `name` string, required
  - `note` string

## Response `201`

- 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 `201`
  - the response property `role/deletedAt` became required for the status `201`
  - the response property `role/id` became required for the status `201`
  - the response property `role/name` became required for the status `201`
  - …2 more
- **2024-08-11** `11e2773b3a1e` — 6 breaking
  - the response property `role/createdAt` became optional for the status `201`
  - the response property `role/deletedAt` became optional for the status `201`
  - the response property `role/id` became optional for the status `201`
  - the response property `role/name` became optional for the status `201`
  - …2 more

[Change history](https://skmtc.dev/valuemelody/apis/melody-auth-s2s-api/changes/api/v1/roles/post.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)
