{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/slimlytics-com/json-schema/slimlytics-com-site-schema.json",
  "title": "Site",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/slimlytics-com-openapi.json#/components/schemas/Site",
  "type": "object",
  "required": [
    "id",
    "name",
    "domain",
    "timezone",
    "allowedOrigins",
    "retentionDays",
    "writeKey",
    "serverWriteKey",
    "proxyKey",
    "antiAdblockServer",
    "antiAdblockJsPath",
    "antiAdblockBeaconPath",
    "iconMode",
    "iconBackground",
    "iconBackgroundEnd",
    "iconForeground",
    "iconUpdatedAt",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "allowedOrigins": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "retentionDays": {
      "type": "integer"
    },
    "writeKey": {
      "type": "string",
      "format": "uuid",
      "description": "Collection-only key; not an account credential"
    },
    "serverWriteKey": {
      "type": "string",
      "format": "uuid",
      "description": "Rotatable collection-only secret for trusted server request batches"
    },
    "proxyKey": {
      "type": "string",
      "format": "uuid",
      "description": "Server-side secret sent by the site's first-party proxy as X-Slimlytics-Proxy-Key with X-Slimlytics-Client-IP so locations and visitor IDs use the real visitor IP. Keep it out of public repositories; rotate with POST /api/sites/{siteId}/rotate-proxy-key if exposed"
    },
    "antiAdblockServer": {
      "type": "string",
      "enum": [
        "caddy",
        "nginx",
        "apache"
      ]
    },
    "antiAdblockJsPath": {
      "type": "string"
    },
    "antiAdblockBeaconPath": {
      "type": "string"
    },
    "iconMode": {
      "type": "string",
      "enum": [
        "initials",
        "favicon"
      ],
      "description": "Dashboard avatar: initials on a colored tile, or the website's favicon"
    },
    "iconBackground": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^#[0-9a-f]{6}$",
      "description": "Tile gradient start; null uses an automatic per-domain hue"
    },
    "iconBackgroundEnd": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^#[0-9a-f]{6}$",
      "description": "Tile gradient end; null keeps the background solid"
    },
    "iconForeground": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^#[0-9a-f]{6}$",
      "description": "Initials color; null uses white"
    },
    "iconUpdatedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the stored favicon last changed; add it to the GET /api/sites/{siteId}/icon URL to bust caches"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}