PostHog alerts API

The alerts API from PostHog — 6 operation(s) for alerts.

OpenAPI Specification

posthog-alerts-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: PostHog actions alerts API
  version: 1.0.0
  description: ''
tags:
- name: alerts
paths:
  /api/environments/{environment_id}/alerts/:
    get:
      operationId: environments_alerts_list
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      tags:
      - alerts
      security:
      - PersonalAPIKeyAuth:
        - alert:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAlertList'
          description: ''
      deprecated: true
      x-explicit-tags: []
    post:
      operationId: environments_alerts_create
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      tags:
      - alerts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Alert'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Alert'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Alert'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - alert:write
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
          description: ''
      deprecated: true
      x-explicit-tags: []
  /api/environments/{environment_id}/alerts/{id}/:
    get:
      operationId: environments_alerts_retrieve
      parameters:
      - in: query
        name: checks_date_from
        schema:
          type: string
        description: Relative date string for the start of the check history window (e.g. '-24h', '-7d', '-14d'). Returns checks created after this time. Max retention is 14 days.
      - in: query
        name: checks_date_to
        schema:
          type: string
        description: Relative date string for the end of the check history window (e.g. '-1h', '-1d'). Defaults to now if not specified.
      - in: query
        name: checks_limit
        schema:
          type: integer
        description: Maximum number of check results to return (default 5, max 500). Applied after date filtering.
      - in: query
        name: checks_offset
        schema:
          type: integer
        description: Number of newest checks to skip (0-based). Use with checks_limit for pagination. Default 0.
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this alert configuration.
        required: true
      tags:
      - alerts
      security:
      - PersonalAPIKeyAuth:
        - alert:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
          description: ''
      deprecated: true
      x-explicit-tags: []
    put:
      operationId: environments_alerts_update
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this alert configuration.
        required: true
      tags:
      - alerts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Alert'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Alert'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Alert'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - alert:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
          description: ''
      deprecated: true
      x-explicit-tags: []
    patch:
      operationId: environments_alerts_partial_update
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this alert configuration.
        required: true
      tags:
      - alerts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedAlert'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedAlert'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedAlert'
      security:
      - PersonalAPIKeyAuth:
        - alert:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
          description: ''
      deprecated: true
      x-explicit-tags: []
    delete:
      operationId: environments_alerts_destroy
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this alert configuration.
        required: true
      tags:
      - alerts
      security:
      - PersonalAPIKeyAuth:
        - alert:write
      responses:
        '204':
          description: No response body
      deprecated: true
      x-explicit-tags: []
  /api/environments/{environment_id}/alerts/simulate/:
    post:
      operationId: environments_alerts_simulate_create
      description: Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created.
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      tags:
      - alerts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertSimulate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AlertSimulate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AlertSimulate'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - alert:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertSimulateResponse'
          description: ''
      deprecated: true
      x-explicit-tags: []
  /api/projects/{project_id}/alerts/:
    get:
      operationId: alerts_list
      parameters:
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - alerts
      security:
      - PersonalAPIKeyAuth:
        - alert:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAlertList'
          description: ''
      x-explicit-tags: []
    post:
      operationId: alerts_create
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - alerts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Alert'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Alert'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Alert'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - alert:write
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
          description: ''
      x-explicit-tags: []
  /api/projects/{project_id}/alerts/{id}/:
    get:
      operationId: alerts_retrieve
      parameters:
      - in: query
        name: checks_date_from
        schema:
          type: string
        description: Relative date string for the start of the check history window (e.g. '-24h', '-7d', '-14d'). Returns checks created after this time. Max retention is 14 days.
      - in: query
        name: checks_date_to
        schema:
          type: string
        description: Relative date string for the end of the check history window (e.g. '-1h', '-1d'). Defaults to now if not specified.
      - in: query
        name: checks_limit
        schema:
          type: integer
        description: Maximum number of check results to return (default 5, max 500). Applied after date filtering.
      - in: query
        name: checks_offset
        schema:
          type: integer
        description: Number of newest checks to skip (0-based). Use with checks_limit for pagination. Default 0.
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this alert configuration.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - alerts
      security:
      - PersonalAPIKeyAuth:
        - alert:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
          description: ''
      x-explicit-tags: []
    put:
      operationId: alerts_update
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this alert configuration.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - alerts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Alert'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Alert'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Alert'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - alert:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
          description: ''
      x-explicit-tags: []
    patch:
      operationId: alerts_partial_update
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this alert configuration.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - alerts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedAlert'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedAlert'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedAlert'
      security:
      - PersonalAPIKeyAuth:
        - alert:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
          description: ''
      x-explicit-tags: []
    delete:
      operationId: alerts_destroy
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this alert configuration.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - alerts
      security:
      - PersonalAPIKeyAuth:
        - alert:write
      responses:
        '204':
          description: No response body
      x-explicit-tags: []
  /api/projects/{project_id}/alerts/simulate/:
    post:
      operationId: alerts_simulate_create
      description: Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created.
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - alerts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertSimulate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AlertSimulate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AlertSimulate'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - alert:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertSimulateResponse'
          description: ''
      x-explicit-tags: []
components:
  schemas:
    AlertCondition:
      additionalProperties: false
      properties:
        type:
          $ref: '#/components/schemas/AlertConditionType'
      required:
      - type
      title: AlertCondition
      type: object
    CalculationIntervalEnum:
      enum:
      - hourly
      - daily
      - weekly
      - monthly
      type: string
      description: '* `hourly` - hourly

        * `daily` - daily

        * `weekly` - weekly

        * `monthly` - monthly'
    IQRDetectorConfig:
      additionalProperties: false
      properties:
        multiplier:
          default: null
          description: 'IQR multiplier for fence calculation (default: 1.5, use 3.0 for far outliers)'
          title: Multiplier
          type: number
          nullable: true
        preprocessing:
          default: null
          description: Preprocessing transforms applied before detection
          allOf:
          - $ref: '#/components/schemas/PreprocessingConfig'
          nullable: true
        type:
          default: iqr
          title: Type
          type: string
          enum:
          - iqr
        window:
          default: null
          description: 'Rolling window size for calculating quartiles (default: 30)'
          title: Window
          type: integer
          nullable: true
      title: IQRDetectorConfig
      type: object
    InvestigationInconclusiveActionEnum:
      enum:
      - notify
      - suppress
      type: string
      description: '* `notify` - Notify

        * `suppress` - Suppress'
    AlertCheckStateEnum:
      enum:
      - Firing
      - Not firing
      - Errored
      - Snoozed
      type: string
      description: '* `Firing` - Firing

        * `Not firing` - Not firing

        * `Errored` - Errored

        * `Snoozed` - Snoozed'
    InsightsThresholdBounds:
      additionalProperties: false
      properties:
        lower:
          default: null
          description: Alert fires when the value drops below this number.
          title: Lower
          type: number
          nullable: true
        upper:
          default: null
          description: Alert fires when the value exceeds this number.
          title: Upper
          type: number
          nullable: true
      title: InsightsThresholdBounds
      type: object
    EnsembleOperator:
      enum:
      - and
      - or
      title: EnsembleOperator
      type: string
    InvestigationStatusEnum:
      enum:
      - pending
      - running
      - done
      - failed
      - skipped
      type: string
      description: '* `pending` - pending

        * `running` - running

        * `done` - done

        * `failed` - failed

        * `skipped` - skipped'
    RoleAtOrganizationEnum:
      enum:
      - engineering
      - data
      - product
      - founder
      - leadership
      - marketing
      - sales
      - other
      type: string
      description: '* `engineering` - Engineering

        * `data` - Data

        * `product` - Product Management

        * `founder` - Founder

        * `leadership` - Leadership

        * `marketing` - Marketing

        * `sales` - Sales / Success

        * `other` - Other'
    Alert:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        created_by:
          allOf:
          - $ref: '#/components/schemas/UserBasic'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        insight:
          type: integer
          description: 'Insight ID monitored by this alert. Note: Response returns full InsightBasicSerializer object.'
        name:
          type: string
          description: Human-readable name for the alert.
        subscribed_users:
          type: array
          items:
            type: integer
          description: 'User IDs to subscribe to this alert. Note: Response returns full UserBasicSerializer object.'
        threshold:
          allOf:
          - $ref: '#/components/schemas/Threshold'
          description: Threshold configuration with bounds and type for evaluating the alert.
        condition:
          allOf:
          - $ref: '#/components/schemas/AlertCondition'
          nullable: true
          description: 'Alert condition type. Determines how the value is evaluated: absolute_value, relative_increase, or relative_decrease.'
        state:
          type: string
          readOnly: true
          description: 'Current alert state: Firing, Not firing, Errored, or Snoozed.'
        enabled:
          type: boolean
          description: Whether the alert is actively being evaluated.
        last_notified_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_checked_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        next_check_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        checks:
          type: array
          items:
            $ref: '#/components/schemas/AlertCheck'
          readOnly: true
          description: Alert check results. By default returns the last 5. Use checks_date_from and checks_date_to (e.g. '-24h', '-7d') to get checks within a time window, checks_limit to cap how many are returned (default 5, max 500), and checks_offset to skip the newest N checks for pagination (0-based). Newest checks first. Only populated on retrieve.
        checks_total:
          type: integer
          nullable: true
          readOnly: true
          description: Total alert checks matching the retrieve filters (date window). Only set on alert retrieve; omitted otherwise.
        config:
          allOf:
          - $ref: '#/components/schemas/TrendsAlertConfig'
          nullable: true
          description: Trends-specific alert configuration. Includes series_index (which series to monitor) and check_ongoing_interval (whether to check the current incomplete interval).
        detector_config:
          allOf:
          - $ref: '#/components/schemas/DetectorConfig'
          nullable: true
        calculation_interval:
          allOf:
          - $ref: '#/components/schemas/CalculationIntervalEnum'
          description: 'How often the alert is checked: hourly, daily, weekly, or monthly.


            * `hourly` - hourly

            * `daily` - daily

            * `weekly` - weekly

            * `monthly` - monthly'
        snoozed_until:
          type: string
          nullable: true
          description: Snooze the alert until this time. Pass a relative date string (e.g. '2h', '1d') or null to unsnooze.
        skip_weekend:
          type: boolean
          nullable: true
          description: Skip alert evaluation on weekends (Saturday and Sunday, local to project timezone).
        schedule_restriction:
          allOf:
          - $ref: '#/components/schemas/AlertScheduleRestriction'
          nullable: true
          description: 'Blocked local time windows (HH:MM in the project timezone). Interval is half-open [start, end): start inclusive, end exclusive. Use blocked_windows array of {start, end}. Null disables.'
        last_value:
          type: number
          format: double
          readOnly: true
          nullable: true
          description: The last calculated value from the most recent alert check.
        investigation_agent_enabled:
          type: boolean
          description: When enabled, an investigation agent runs on the state transition to firing and writes findings to a Notebook linked from the alert check. Only effective for detector-based (anomaly) alerts.
        investigation_gates_notifications:
          type: boolean
          description: When enabled (and investigation_agent_enabled is on), notification dispatch is held until the investigation agent produces a verdict. Notifications are suppressed when the verdict is false_positive (and optionally when inconclusive). A safety-net task force-fires after a few minutes if the investigation stalls.
        investigation_inconclusive_action:
          allOf:
          - $ref: '#/components/schemas/InvestigationInconclusiveActionEnum'
          description: 'How to handle an ''inconclusive'' verdict when notifications are gated. ''notify'' is the safe default — an agent that can''t be sure is itself useful signal.


            * `notify` - Notify

            * `suppress` - Suppress'
      required:
      - checks
      - checks_total
      - created_at
      - created_by
      - id
      - insight
      - last_checked_at
      - last_notified_at
      - last_value
      - next_check_at
      - state
      - subscribed_users
      - threshold
    LOFDetectorConfig:
      additionalProperties: false
      properties:
        n_neighbors:
          default: null
          description: 'Number of neighbors for LOF (default: 20)'
          title: N Neighbors
          type: integer
          nullable: true
        preprocessing:
          default: null
          description: Preprocessing transforms applied before detection
          allOf:
          - $ref: '#/components/schemas/PreprocessingConfig'
          nullable: true
        threshold:
          default: null
          description: 'Anomaly probability threshold (default: 0.9)'
          title: Threshold
          type: number
          nullable: true
        type:
          default: lof
          title: Type
          type: string
          enum:
          - lof
        window:
          default: null
          description: 'Rolling window size — how many historical data points to train on (default: based on calculation interval)'
          title: Window
          type: integer
          nullable: true
      title: LOFDetectorConfig
      type: object
    PaginatedAlertList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/Alert'
    COPODDetectorConfig:
      additionalProperties: false
      properties:
        preprocessing:
          default: null
          description: Preprocessing transforms applied before detection
          allOf:
          - $ref: '#/components/schemas/PreprocessingConfig'
          nullable: true
        threshold:
          default: null
          description: 'Anomaly probability threshold (default: 0.9)'
          title: Threshold
          type: number
          nullable: true
        type:
          default: copod
          title: Type
          type: string
          enum:
          - copod
        window:
          default: null
          description: 'Rolling window size — how many historical data points to train on (default: based on calculation interval)'
          title: Window
          type: integer
          nullable: true
      title: COPODDetectorConfig
      type: object
    ECODDetectorConfig:
      additionalProperties: false
      properties:
        preprocessing:
          default: null
          description: Preprocessing transforms applied before detection
          allOf:
          - $ref: '#/components/schemas/PreprocessingConfig'
          nullable: true
        threshold:
          default: null
          description: 'Anomaly probability threshold (default: 0.9)'
          title: Threshold
          type: number
          nullable: true
        type:
          default: ecod
          title: Type
          type: string
          enum:
          - ecod
        window:
          default: null
          description: 'Rolling window size — how many historical data points to train on (default: based on calculation interval)'
          title: Window
          type: integer
          nullable: true
      title: ECODDetectorConfig
      type: object
    AlertCheck:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        calculated_value:
          type: number
          format: double
          readOnly: true
          nullable: true
        state:
          allOf:
          - $ref: '#/components/schemas/AlertCheckStateEnum'
          readOnly: true
        targets_notified:
          type: boolean
          readOnly: true
        anomaly_scores:
          readOnly: true
          nullable: true
        triggered_points:
          readOnly: true
          nullable: true
        triggered_dates:
          readOnly: true
          nullable: true
        interval:
          type: string
          readOnly: true
          nullable: true
        triggered_metadata:
          readOnly: true
          nullable: true
        investigation_status:
          readOnly: true
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/InvestigationStatusEnum'
          - $ref: '#/components/schemas/NullEnum'
        investigation_verdict:
          readOnly: true
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/InvestigationVerdictEnum'
          - $ref: '#/components/schemas/NullEnum'
        investigation_summary:
          type: string
          readOnly: true
          nullable: true
        investigation_notebook_short_id:
          type: string
          nullable: true
          readOnly: true
          description: Short ID of the Notebook produced by the investigation agent, when the agent ran for this check.
        notification_sent_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        notification_suppressed_by_agent:
          type: boolean
          readOnly: true
      required:
      - anomaly_scores
      - calculated_value
      - created_at
      - id
      - interval
      - investigation_notebook_short_id
      - investigation_status
      - investigation_summary
      - investigation_verdict
      - notification_sent_at
      - notification_suppressed_by_agent
      - state
      - targets_notified
      - triggered_dates
      - triggered_metadata
      - triggered_points
    InsightThresholdType:
      enum:
      - absolute
      - percentage
      title: InsightThresholdType
      type: string
    NullEnum:
      enum:
      - null
    PatchedAlert:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        created_by:
          allOf:
          - $ref: '#/components/schemas/UserBasic'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        insight:
          type: integer
          description: 'Insight ID monitored by this alert. Note: Response returns full InsightBasicSerializer object.'
        name:
          type: string
          description: Human-readable name for the alert.
        subscribed_users:
          type: array
          items:
            type: integer
          description: 'User IDs to subscribe to this alert. Note: Response returns full UserBasicSerializer object.'
        threshold:
          allOf:
          - $ref: '#/components/schemas/Threshold'
          description: Threshold configuration with bounds and type for evaluating the alert.
        condition:
          allOf:
          - $ref: '#/components/schemas/AlertCondition'
          nullable: true
          description: 'Alert condition type. Determines how the value is evaluated: absolute_value, relative_increase, or relative_decrease.'
        state:
          type: string
          readOnly: true
          description: 'Current alert state: Firing, Not firing, Errored, or Snoozed.'
        enabled:
          type: boolean
          description: Whether the alert is actively being evaluated.
        last_notified_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_checked_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        next_check_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        checks:
          type: array
          items:
            $ref: '#/components/schemas/AlertCheck'
          readOnly: true
          description: Alert check results. By default returns the last 5. Use checks_date_from and checks_date_to (e.g. '-24h', '-7d') to get checks within a time window, checks_limit to cap how many are returned (default 5, max 500), and checks_offset to skip the newest N checks for pagination (0-based). Newest checks first. Only populated on retrieve.
        checks_total:
          type: integer
          nullable: true
          readOnly: true
          description: Total alert checks matching the retrieve filters (date window). Only set on alert retrieve; omitted otherwise.
        config:
          allOf:
          - $ref: '#/components/schemas/TrendsAlertConfig'
          nullable: true
          description: Trends-specific alert configuration. Includes series_index (which series to monitor) and check_ongoing_interval (whether to check the current incomplete interval).
        detector_config:
          allOf:
          - $ref: '#/components/schemas/DetectorConfig'
          nullable: true
        calculation_interval:
          allOf:
          - $ref: '#/components/schemas/CalculationIntervalEnum'
          description: 'How often the alert is checked: hourly, daily, weekly, or monthly.


            * `hourly` - hourly

            * `daily` - daily

            * `weekly` - weekly

            * `monthly` - monthly'
        snoozed_until:
          type: string
          nullable: true
          description: Snooze the alert until this time. Pass a relative date string (e.g. '2h', '1d') or null to unsnooze.
        skip_weekend:
          type: boolean
          nullable: true
          description: Skip alert evaluation on weekends (Saturday and Sunday, local to project timezone).
        schedule_restriction:
          allOf:
          - $ref: '#/components/schemas/AlertScheduleRestriction'
          nullable: true
          description: 'Blocked local time windows (HH:MM in the project timezone). Interval is half-open [start, end): start inclusive, end exclusive. Use blocked_windows array of {start, end}. Null disables.'
        last_value:
          type: number
          format: double
          readOnly: true
          nullable: true
          description: The last calculated value from the most recent alert check.
        investigation_agent_enabled:
          type: boolean
     

# --- truncated at 32 KB (55 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/posthog/refs/heads/main/openapi/posthog-alerts-api-openapi.yml