{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tradingstrategies-work/json-schema/tradingstrategies-work-live-subscription-schema.json",
  "title": "LiveSubscription",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tradingstrategies-work-openapi.yml#/components/schemas/LiveSubscription",
  "type": "object",
  "required": [
    "id",
    "api_key_id",
    "subscription_type",
    "config",
    "delivery_method",
    "active",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "api_key_id": {
      "type": "string",
      "format": "uuid"
    },
    "subscription_type": {
      "type": "string",
      "enum": [
        "signal_alert",
        "cycle_band",
        "pulse_score",
        "bullmarket_stage"
      ]
    },
    "config": {
      "type": "object",
      "additionalProperties": true
    },
    "delivery_method": {
      "type": "string",
      "enum": [
        "polling",
        "webhook"
      ]
    },
    "webhook_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "active": {
      "type": "boolean"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "last_triggered_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_state": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true
    }
  }
}