{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mindcloud/json-schema/mindcloud-role-schema.json",
  "title": "Role",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mindcloud-roles-api-openapi.yml#/components/schemas/Role",
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Unique id of the role."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The role's name."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "The role's description. Empty when nobody wrote one."
    },
    "isAdmin": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "True if the role grants admin rights."
    },
    "isGlobal": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "True for roles MindCloud provides to every company. Global roles are read-only: writing one answers 404."
    },
    "createdOn": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the role was created."
    },
    "permissions": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The permission key, such as workflow:run."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The permission's display name."
          }
        }
      },
      "description": "Everything the role allows, as { key, name } pairs."
    }
  },
  "required": [
    "id",
    "name",
    "description",
    "isAdmin",
    "isGlobal",
    "createdOn",
    "permissions"
  ]
}