{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/2x/json-schema/2x-stream-detail-response-schema.json",
  "title": "StreamDetailResponse",
  "description": "Detailed stream response with insights from Cortex analytics.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/2x-clients-api-openapi.yml#/components/schemas/StreamDetailResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "customerId": {
      "type": "string",
      "title": "Customerid"
    },
    "parentClientId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parentclientid"
    },
    "parentClientName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parentclientname"
    },
    "score": {
      "type": "number",
      "title": "Score"
    },
    "streamState": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Streamstate",
      "description": "Stream status: pending, active, or inactive"
    },
    "goals": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Goals",
      "description": "Stream goals/objectives"
    },
    "hasInsufficientData": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hasinsufficientdata"
    },
    "historicalData": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Historicaldata"
    },
    "scoreChanges": {
      "anyOf": [
        {
          "$ref": "#/$defs/ScoreChanges"
        },
        {
          "type": "null"
        }
      ],
      "description": "Score changes over time"
    },
    "spotlight": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Spotlight",
      "description": "Executive summary from Cortex stream insights"
    },
    "insights": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Insights",
      "description": "Weekly insights"
    },
    "contextualClues": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Contextualclues",
      "description": "Active fires, budget issues, growth opportunities, etc."
    },
    "growthRecommendations": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Growthrecommendations",
      "description": "Growth strategy recommendations"
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "customerId",
    "score"
  ],
  "$defs": {
    "ScoreChange": {
      "properties": {
        "change": {
          "type": "number",
          "title": "Change",
          "description": "Absolute change in score"
        },
        "percentage": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Percentage",
          "description": "Percentage change"
        },
        "previousScore": {
          "type": "number",
          "title": "Previousscore",
          "description": "Score at start of period"
        }
      },
      "type": "object",
      "required": [
        "change",
        "previousScore"
      ],
      "title": "ScoreChange",
      "description": "Score change over a time period."
    },
    "ScoreChanges": {
      "properties": {
        "7day": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScoreChange"
            },
            {
              "type": "null"
            }
          ],
          "description": "7-day change"
        },
        "30day": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScoreChange"
            },
            {
              "type": "null"
            }
          ],
          "description": "30-day change"
        }
      },
      "type": "object",
      "title": "ScoreChanges",
      "description": "Score changes over different time periods."
    }
  }
}