{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudinary/json-schema/cloudinary-create-role-schema.json",
  "title": "CreateRole",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudinary-provisioning-openapi.yml#/components/schemas/CreateRole",
  "allOf": [
    {
      "type": "object",
      "required": [
        "permission_type",
        "scope_type"
      ],
      "properties": {
        "id": {
          "description": "The unique identifier for the role.\n\n* **When creating a new role**: If not provided, the system will auto-generate the ID.\n* **When updating a role**: Specify the ID of the role you want to update.\n",
          "type": "string"
        },
        "permission_type": {
          "description": "Specifies whether the permission applies globally across all contexts within the scope (i.e., security settings for the account, or all folders in a product environment), or specifically to designated content instances (i.e., folder with external ID `\"fg3841spr\"`). **Note:** This attrubute is immutable.\n- global\n- content\n",
          "type": "string"
        },
        "scope_type": {
          "$ref": "#/$defs/ScopeTypeEnum"
        }
      }
    },
    {
      "$ref": "#/$defs/Role"
    }
  ],
  "$defs": {
    "Role": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the role.",
          "type": "string"
        },
        "description": {
          "description": "A short description of the role.",
          "type": [
            "string",
            "null"
          ]
        },
        "system_policy_ids": {
          "description": "A list of system permission policy IDs to be included in the role.\n\n**Tip:** Get the list of all available predefined policies using the [Get system policies](#tag/policies/get/policies) method.\n",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ScopeTypeEnum": {
      "type": "string",
      "description": "Specifies where the role/policy is applied, either at the account level or within product environments.",
      "enum": [
        "account",
        "prodenv"
      ]
    }
  }
}