{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudbrowser-tv/json-schema/cloudbrowser-tv-viewer-session-schema.json",
  "title": "ViewerSession",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudbrowser-tv-openapi.json#/components/schemas/ViewerSession",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "grantId",
    "browserId",
    "permission",
    "autoRenew",
    "accessExpiresAt",
    "idleExpiresAt",
    "ended",
    "authorizationExpiresAt",
    "accountId"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "grantId": {
      "type": "string"
    },
    "browserId": {
      "type": "string"
    },
    "permission": {
      "type": "string",
      "enum": [
        "view",
        "control"
      ],
      "default": "view",
      "description": "view is read-only: stream only, no mouse, keyboard, touch, clipboard writes, uploads, navigation commands or browser control. control allows browser interaction but no workspace, lifecycle or CDP administration. Enforced by the gateway, not just UI."
    },
    "autoRenew": {
      "type": "boolean"
    },
    "accessExpiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "idleExpiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "ended": {
      "type": "boolean"
    },
    "authorizationExpiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "default": null,
      "description": "Absolute link authorization deadline, measured from issuance/update; null means no expiration. Applies to new visits AND all existing sessions. Automatic refresh never moves this deadline."
    },
    "accountId": {
      "type": "string",
      "description": "Recipient account binding; never infer identity from browserId alone."
    }
  }
}