{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cogram-com/json-schema/cogram-com-project-template-v1-schema.json",
  "title": "ProjectTemplateV1",
  "description": "Project template with its group bindings.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cogram-com-project-templates-api-openapi.yml#/components/schemas/ProjectTemplateV1",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "groups": {
      "items": {
        "$ref": "#/$defs/ProjectTemplateGroupV1"
      },
      "type": "array",
      "title": "Groups"
    },
    "project_type_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Project Type Id"
    },
    "email_filing_enabled_default": {
      "type": "boolean",
      "title": "Email Filing Enabled Default"
    },
    "is_public_default": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Public Default"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updated At",
      "description": "Null if never updated."
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "description",
    "groups",
    "project_type_id",
    "email_filing_enabled_default",
    "is_public_default",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "ProjectTemplateGroupV1": {
      "properties": {
        "group_id": {
          "type": "string",
          "title": "Group Id"
        },
        "group_name": {
          "type": "string",
          "title": "Group Name"
        },
        "role": {
          "type": "string",
          "enum": [
            "LEAD",
            "MEMBER",
            "VIEWER"
          ],
          "title": "ProjectGroupRole",
          "description": "Roles a group can hold on a project. OWNER stays direct-only by design;\nLEAD may be granted via a group (gated behind the project-lead-role flag at\nthe assignment routes, like a direct LEAD)."
        },
        "member_count": {
          "type": "integer",
          "title": "Member Count"
        }
      },
      "type": "object",
      "required": [
        "group_id",
        "group_name",
        "role",
        "member_count"
      ],
      "title": "ProjectTemplateGroupV1",
      "description": "A group bound to a template."
    }
  }
}