{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tabfleet-com/json-schema/tabfleet-com-session-connection-schema.json",
  "title": "SessionConnection",
  "description": "Public session state plus a temporary connection only while the session is active.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tabfleet-com-openapi.json#/components/schemas/SessionConnection",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/Session"
    },
    {
      "type": "object",
      "properties": {
        "cdpUrl": {
          "type": "string",
          "format": "uri",
          "description": "Temporary signed WSS endpoint, present only while active. At most 300 seconds validity."
        },
        "connectionTokenTtlSeconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 300,
          "description": "Remaining signed connection lifetime in seconds."
        }
      }
    }
  ],
  "$defs": {
    "Session": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "status": {
          "type": "string",
          "enum": [
            "creating",
            "active",
            "closing",
            "closed",
            "failed"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "endedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "idleTimeoutSeconds": {
          "type": "integer"
        },
        "closeReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "allocatedSeconds": {
          "type": "integer"
        }
      },
      "required": [
        "id",
        "status",
        "createdAt",
        "expiresAt",
        "endedAt",
        "idleTimeoutSeconds",
        "closeReason",
        "allocatedSeconds"
      ]
    }
  }
}