{
"$defs": {
"SpaceLevel": {
"description": "A person's level in an App-governed Space (K2's sync sets it), and an App's\n`max_level`. `moderator` and `admin` are the Space's managed roles; `member` is\n`@everyone`.",
"oneOf": [
{
"const": "member",
"description": "`@everyone` only.",
"type": "string"
},
{
"const": "moderator",
"description": "The managed Moderator role.",
"type": "string"
},
{
"const": "admin",
"description": "The managed Admin role (the Moderator bits plus MENTION_EVERYONE).",
"type": "string"
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "A space role.",
"properties": {
"color": {
"description": "Color as `0xRRGGBB`.",
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"hoist": {
"default": false,
"description": "Whether members with this role are listed separately. Old payloads read as false.",
"type": "boolean"
},
"id": {
"description": "The role id; `@everyone`'s equals the space id.",
"pattern": "^[1-9][0-9]{0,18}$",
"type": "string"
},
"is_everyone": {
"description": "Whether this is the `@everyone` role.",
"type": "boolean"
},
"managed": {
"anyOf": [
{
"$ref": "#/$defs/SpaceLevel"
},
{
"type": "null"
}
],
"description": "The level of a managed role (`moderator` or `admin`), created by the switch to\nApp governance and kept by the App's sync; absent for every other role."
},
"mentionable": {
"description": "Whether anyone may `@mention` it.",
"type": "boolean"
},
"name": {
"description": "The name.",
"type": "string"
},
"perms": {
"description": "Bits the role grants.",
"pattern": "^(0|[1-9][0-9]{0,19})$",
"type": "string"
},
"position": {
"description": "Ladder position; `@everyone` is 0.",
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"space_id": {
"description": "Its space.",
"pattern": "^[1-9][0-9]{0,18}$",
"type": "string"
}
},
"required": [
"id",
"space_id",
"name",
"position",
"perms",
"mentionable",
"is_everyone"
],
"title": "Role",
"type": "object"
}