{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/patternfetch-com/json-schema/patternfetch-com-watch-subscription-schema.json",
  "title": "WatchSubscription",
  "description": "A watchlist subscription. The signing secret is NOT part of this projection — it is returned exactly once, by the create call.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/patternfetch-com-api-openapi.json#/components/schemas/WatchSubscription",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "ticker": {
      "type": "string"
    },
    "timeframe": {
      "type": "string"
    },
    "market": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "crypto",
        "stock",
        null
      ],
      "description": "Asset-class hint, or null to infer from the symbol."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "HTTPS callback target."
    },
    "intervalSec": {
      "type": "integer",
      "description": "Poll interval actually in force (>= the timeframe floor)."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "lastPollAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "lastDeliveryAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Last time a callback was actually SENT (a poll that finds no change sends nothing)."
    },
    "nextPollAt": {
      "type": "string",
      "format": "date-time"
    },
    "failCount": {
      "type": "integer",
      "description": "Consecutive delivery failures; drives exponential backoff."
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "disabled"
      ],
      "description": "'paused' recovers by itself (insufficient_credit resumes after a top-up); 'disabled' needs a new subscription."
    },
    "statusReason": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}