Rename or change a role
PATCH /api/organizations/roles/{key}. Rename or change a role. Headless LMS Roles API reference.
Requires roles:write. A rename needs nothing else. Changing permissions, levels or the team flag needs every permission the role holds before and after the change (403 names the missing ones). Owner and Member can only be renamed (409). Names are unique in the organization (409).
Path Parameters
key*string
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/api/organizations/roles/string" \ -H "Content-Type: application/json" \ -d '{}'{ "key": "string", "name": "string", "description": "string", "base": "string", "levels": [ "org" ], "team": true, "permissions": [ "organizations:read" ], "system": true, "added": true, "customized": true, "holders": -9007199254740991, "givable": true}{ "error": "string", "message": "string", "requestId": "string", "issues": [ { "path": "string", "message": "string" } ]}{ "error": "string", "message": "string", "requestId": "string"}{ "error": "string", "message": "string", "requestId": "string"}{ "error": "string", "message": "string", "requestId": "string"}{ "error": "string", "message": "string", "requestId": "string"}{ "error": "string", "message": "string", "requestId": "string"}