{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mentio-dev/json-schema/mentio-dev-group-schema.json",
  "title": "Group",
  "description": "The group the keyword belongs to.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mentio-dev-groups-api-openapi.yml#/components/schemas/Group",
  "allOf": [
    {
      "$ref": "#/$defs/GroupRef"
    },
    {
      "type": "object",
      "properties": {
        "context": {
          "type": [
            "string",
            "null"
          ],
          "description": "The group's own company description for the classifier, or null for the workspace profile."
        },
        "stats": {
          "type": "object",
          "properties": {
            "keywords": {
              "type": "integer",
              "minimum": 0,
              "description": "Keywords in the group, muted ones included."
            },
            "active": {
              "type": "integer",
              "minimum": 0,
              "description": "Keywords in the group that are tracking (not muted)."
            }
          },
          "required": [
            "keywords",
            "active"
          ],
          "description": "Computed over the group's keywords."
        },
        "createdAt": {
          "type": "string",
          "description": "ISO 8601 timestamp, UTC."
        },
        "updatedAt": {
          "type": "string",
          "description": "ISO 8601 timestamp, UTC."
        }
      },
      "required": [
        "context",
        "stats",
        "createdAt",
        "updatedAt"
      ]
    }
  ],
  "$defs": {
    "GroupRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Group id (grp_...)."
        },
        "name": {
          "type": "string",
          "description": "The group's name."
        },
        "externalId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Your own id for the group, or null."
        },
        "isDefault": {
          "type": "boolean",
          "description": "The workspace's default group, where a keyword lands when no group is named."
        }
      },
      "required": [
        "id",
        "name",
        "externalId",
        "isDefault"
      ],
      "description": "The group the keyword belongs to."
    }
  }
}