> ## Documentation Index
> Fetch the complete documentation index at: https://docs.causeloop.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Forecast

> Risk forecast time-series: observed historical buckets + projected band +
alert threshold + TODAY divider + first projected breach.
Replaces the static 14-point SVG in ForecastChart.



## OpenAPI

````yaml /openapi.json get /v1/predictions/forecast
openapi: 3.1.0
info:
  description: Causeloop Platform Backend
  title: Causeloop API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/predictions/forecast:
    get:
      tags:
        - predictions
      summary: Get Forecast
      description: >-
        Risk forecast time-series: observed historical buckets + projected band
        +

        alert threshold + TODAY divider + first projected breach.

        Replaces the static 14-point SVG in ForecastChart.
      operationId: get_forecast_v1_predictions_forecast_get
      parameters:
        - in: query
          name: window
          required: false
          schema:
            default: 30d
            title: Window
            type: string
        - in: query
          name: pattern_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Pattern Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionsForecastResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    PredictionsForecastResponse:
      properties:
        alert_threshold:
          $ref: '#/components/schemas/AlertThresholdInfo'
        axis:
          $ref: '#/components/schemas/ForecastAxis'
        breach:
          anyOf:
            - $ref: '#/components/schemas/ForecastBreach'
            - type: 'null'
        generated_at:
          title: Generated At
          type: string
        pattern_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Pattern Id
        points:
          items:
            $ref: '#/components/schemas/RichForecastPoint'
          title: Points
          type: array
        today_index:
          minimum: 0
          title: Today Index
          type: integer
        window:
          title: Window
          type: string
      required:
        - window
        - points
        - today_index
        - axis
        - alert_threshold
        - generated_at
      title: PredictionsForecastResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AlertThresholdInfo:
      properties:
        label:
          default: ALERT 70
          title: Label
          type: string
        probability:
          default: 0.7
          title: Probability
          type: number
      title: AlertThresholdInfo
      type: object
    ForecastAxis:
      properties:
        x_tick_indices:
          default: []
          items:
            type: integer
          title: X Tick Indices
          type: array
        y_ticks:
          default:
            - 0
            - 25
            - 50
            - 75
            - 100
          items:
            type: number
          title: Y Ticks
          type: array
      title: ForecastAxis
      type: object
    ForecastBreach:
      properties:
        bucket_ts:
          title: Bucket Ts
          type: string
        pattern_id:
          title: Pattern Id
          type: string
        pattern_label:
          title: Pattern Label
          type: string
        point_index:
          title: Point Index
          type: integer
        probability:
          title: Probability
          type: number
      required:
        - bucket_ts
        - point_index
        - pattern_id
        - pattern_label
        - probability
      title: ForecastBreach
      type: object
    RichForecastPoint:
      properties:
        bucket_ts:
          title: Bucket Ts
          type: string
        kind:
          title: Kind
          type: string
        lower:
          title: Lower
          type: number
        trigger:
          anyOf:
            - type: string
            - type: 'null'
          title: Trigger
        upper:
          title: Upper
          type: number
        value:
          title: Value
          type: number
      required:
        - bucket_ts
        - value
        - lower
        - upper
        - kind
      title: RichForecastPoint
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````