{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dream-sports/json-schema/dream-sports-journey-request-schema.json",
  "title": "JourneyRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dream-sports-journeys-api-openapi.yml#/components/schemas/JourneyRequest",
  "type": "object",
  "required": [
    "name",
    "team",
    "rule"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "description": {
      "type": "string"
    },
    "team": {
      "type": "string"
    },
    "startTime": {
      "type": "integer",
      "format": "int64",
      "description": "Future epoch timestamp in milliseconds"
    },
    "endTime": {
      "type": "integer",
      "format": "int64",
      "description": "Future epoch timestamp in milliseconds"
    },
    "rule": {
      "$ref": "#/$defs/RuleRequest"
    }
  },
  "$defs": {
    "RuleRequest": {
      "type": "object",
      "required": [
        "cohortEligibility",
        "stateToAction",
        "stateTransition",
        "priority",
        "stateMachineTTL",
        "actions",
        "frequency"
      ],
      "properties": {
        "cohortEligibility": {
          "type": "object",
          "properties": {
            "includes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "excludes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "stateToAction": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "resetStates": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "contextParams": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "stateTransition": {
          "type": "object"
        },
        "groupByConfig": {
          "type": "object"
        },
        "priority": {
          "type": "integer"
        },
        "stateMachineTTL": {
          "type": "integer",
          "format": "int64",
          "description": "Future epoch timestamp in milliseconds"
        },
        "actions": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "frequency": {
          "type": "object",
          "properties": {
            "session": {
              "type": "object",
              "properties": {
                "limit": {
                  "type": "integer"
                }
              }
            },
            "window": {
              "type": "object",
              "properties": {
                "limit": {
                  "type": "integer"
                },
                "unit": {
                  "type": "string"
                },
                "value": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    }
  }
}