Creates a Community role, or changes one. Without a key it creates a role; with one it replaces that role's name and permissions. The key moderator changes what the built-in moderator role may do, and keeps its name. Only an administrator may define roles. Recorded in the moderation log.
Input
application/jsoncommunity
stringat-uri
Required
An AT Protocol URI (e.g., at://did:plc:xyz/app.bsky.feed.post/abc).
key
string
Optional
The role to change. Absent creates a role.
maxLength: 64 bytesname
string
Optional
Required for a role the Community defined. Ignored for moderator.
maxLength: 320 bytesmaxGraphemes: 32 graphemespermissions
array
Required
No description available.
maxLength: 16 itemsOutput
application/jsonrole
refcom.getorbyt.community.defs#roleView
Required
No description available.
Errors
AuthenticationRequired
CommunityNotFound
InsufficientRole
InvalidRequest
RoleNotFound
No role with this key exists in the Community. TooManyRoles
The Community already defines the most roles it may. Try It
Requests are sent directly from your browser. Some servers may block requests due to CORS.
View raw schema
{
"description": "Creates a Community role, or changes one. Without a key it creates a role; with one it replaces that role's name and permissions. The key moderator changes what the built-in moderator role may do, and keeps its name. Only an administrator may define roles. Recorded in the moderation log.",
"errors": [
{
"name": "AuthenticationRequired"
},
{
"name": "CommunityNotFound"
},
{
"name": "InsufficientRole"
},
{
"name": "InvalidRequest"
},
{
"description": "No role with this key exists in the Community.",
"name": "RoleNotFound"
},
{
"description": "The Community already defines the most roles it may.",
"name": "TooManyRoles"
}
],
"input": {
"encoding": "application/json",
"schema": {
"properties": {
"community": {
"format": "at-uri",
"type": "string"
},
"key": {
"description": "The role to change. Absent creates a role.",
"maxLength": 64,
"type": "string"
},
"name": {
"description": "Required for a role the Community defined. Ignored for moderator.",
"maxGraphemes": 32,
"maxLength": 320,
"type": "string"
},
"permissions": {
"items": {
"knownValues": [
"manage-posts",
"manage-reports",
"manage-members",
"manage-roles",
"manage-settings",
"manage-mail",
"view-log"
],
"type": "string"
},
"maxLength": 16,
"type": "array"
}
},
"required": [
"community",
"permissions"
],
"type": "object"
}
},
"output": {
"encoding": "application/json",
"schema": {
"properties": {
"role": {
"ref": "com.getorbyt.community.defs#roleView",
"type": "ref"
}
},
"required": [
"role"
],
"type": "object"
}
},
"type": "procedure"
}