{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zeblink-io/json-schema/zeblink-io-collection-with-count-response-schema.json",
  "title": "CollectionWithCountResponse",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/zeblink-io-v1-openapi.json#/components/schemas/CollectionWithCountResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"
    },
    "spaceId": {
      "type": "string",
      "pattern": "^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "manual",
        "smart"
      ],
      "description": "Collection kind: `manual` (hand-picked membership) or `smart` (membership computed live from saved rules). The API creates both."
    },
    "rules": {
      "type": [
        "array",
        "null"
      ],
      "items": {},
      "description": "A smart collection's COMPILED rules: an opaque read-only mirror of the `filter` it was created with, not a shape to author or round-trip. `null` for manual collections."
    },
    "createdBy": {
      "type": "string",
      "pattern": "^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"
    },
    "createdVia": {
      "type": "string",
      "enum": [
        "web",
        "import",
        "api",
        "chat",
        "mcp"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "linkCount": {
      "type": "integer",
      "minimum": 0
    },
    "uniqueDomains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Distinct destination sites among member links (root domains; subdomains of one site collapse), capped at a short display list."
    },
    "clicks": {
      "type": "integer",
      "minimum": 0,
      "description": "Total clicks across the collection's current members."
    },
    "summedUniqueClicks": {
      "type": "integer",
      "minimum": 0,
      "description": "Per-link unique visitors, summed. A visitor who clicked several member links counts once per link, so this can exceed the collection's true deduplicated unique count."
    }
  },
  "required": [
    "id",
    "spaceId",
    "name",
    "description",
    "type",
    "rules",
    "createdBy",
    "createdVia",
    "createdAt",
    "updatedAt",
    "linkCount",
    "uniqueDomains",
    "clicks",
    "summedUniqueClicks"
  ]
}