---
title: "Create"
method: POST
path: "/projects/{project_id}/log_streams/{log_stream_id}/alerts"
tags: ["log_stream_alerts"]
---

# Create

`POST /projects/{project_id}/log_streams/{log_stream_id}/alerts`

Create alert.

## Path parameters

- `project_id` string, uuid4, required
- `log_stream_id` string, uuid4, required

## Request body

- union
  - CreateAlertConfigurationV1Request
    - `conditions` AlertCondition[], required
      - `field` string, required
      - `aggregation` union, required
        - 'count' | 'sum' | 'avg' | 'max' | 'min' | 'percentage_true' | 'percentage_false' — Aggregation functions for alert conditions.
        - string
      - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like', required
      - `value` union, required
        - number
        - integer
        - string
      - `filter_value` union
        - string
        - number
        - integer
      - `filter_operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like'
      - `window` integer, required
      - `condition_type` 'metric/numeric/1' | 'metric/string/1' | 'metric/array_string/1' | 'root/numeric/1' | 'metric/numeric/v2' | 'metric/boolean/v2' | 'metric/categorical/v2' | 'metric/multilabel/v2' | 'root/column/v2' | 'root/record_count/v2'
      - `metric_id` string, nullable
      - `legacy_metric_name` string, nullable
    - `filters` AlertNameFilter[]
      - `name` 'node_name'
      - `operator` 'eq' | 'ne' | 'contains' | 'one_of' | 'not_in', required
      - `value` union, required
        - string
        - string[]
      - `case_sensitive` boolean
    - `interval` integer, required
    - `schema_version` 'multi_condition/object/1'
    - `active` boolean
    - `project_id` string, uuid4, nullable
    - `run_id` string, uuid4, nullable
    - `created_by` string, uuid4, nullable
  - CreateAlertConfigurationV2Request
    - `schema_version` 'multi_condition/object/2'
    - `conditions` union[], required
      - union
        - NumericMetricConditionV2
          - `field` string, required
          - `metric_id` string, nullable
          - `legacy_metric_name` string, nullable
          - `output_type` 'boolean' | 'categorical' | 'count' | 'discrete' | 'freeform' | 'percentage' | 'multilabel' | 'retrieved_chunk_list_boolean' | 'boolean_multilabel' — Enumeration of output types.
          - `scoreable_node_types` string[], nullable
          - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like', required
          - `window` integer, required
          - `type` 'metric/numeric/v2'
          - `aggregation` 'avg' | 'max' | 'min' | 'sum', required
          - `value` union, required
            - number
            - integer
        - BooleanMetricConditionV2
          - `field` string, required
          - `metric_id` string, nullable
          - `legacy_metric_name` string, nullable
          - `output_type` 'boolean' | 'categorical' | 'count' | 'discrete' | 'freeform' | 'percentage' | 'multilabel' | 'retrieved_chunk_list_boolean' | 'boolean_multilabel' — Enumeration of output types.
          - `scoreable_node_types` string[], nullable
          - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like', required
          - `window` integer, required
          - `type` 'metric/boolean/v2'
          - `aggregation` 'count_true' | 'count_false' | 'percentage_true' | 'percentage_false', required
          - `value` union, required
            - number
            - integer
        - CategoricalMetricConditionV2
          - `field` string, required
          - `metric_id` string, nullable
          - `legacy_metric_name` string, nullable
          - `output_type` 'boolean' | 'categorical' | 'count' | 'discrete' | 'freeform' | 'percentage' | 'multilabel' | 'retrieved_chunk_list_boolean' | 'boolean_multilabel' — Enumeration of output types.
          - `scoreable_node_types` string[], nullable
          - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like', required
          - `window` integer, required
          - `type` 'metric/categorical/v2'
          - `aggregation` 'count', required
          - `target_value` string, required
          - `value` integer, required
        - MultilabelMetricConditionV2
          - `field` string, required
          - `metric_id` string, nullable
          - `legacy_metric_name` string, nullable
          - `output_type` 'boolean' | 'categorical' | 'count' | 'discrete' | 'freeform' | 'percentage' | 'multilabel' | 'retrieved_chunk_list_boolean' | 'boolean_multilabel' — Enumeration of output types.
          - `scoreable_node_types` string[], nullable
          - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like', required
          - `window` integer, required
          - `type` 'metric/multilabel/v2'
          - `aggregation` 'count', required
          - `target_value` string, required
          - `value` integer, required
        - RootColumnConditionV2
          - `field` string, required
          - `metric_id` string, nullable
          - `legacy_metric_name` string, nullable
          - `output_type` 'boolean' | 'categorical' | 'count' | 'discrete' | 'freeform' | 'percentage' | 'multilabel' | 'retrieved_chunk_list_boolean' | 'boolean_multilabel' — Enumeration of output types.
          - `scoreable_node_types` string[], nullable
          - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like', required
          - `window` integer, required
          - `type` 'root/column/v2'
          - `aggregation` 'avg' | 'max' | 'min' | 'sum' | 'count', required
          - `value` union, required
            - number
            - integer
          - `target_value` union
            - number
            - integer
          - `target_operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like'
        - RecordCountConditionV2
          - `field` string
          - `metric_id` string, nullable
          - `legacy_metric_name` string, nullable
          - `output_type` 'boolean' | 'categorical' | 'count' | 'discrete' | 'freeform' | 'percentage' | 'multilabel' | 'retrieved_chunk_list_boolean' | 'boolean_multilabel' — Enumeration of output types.
          - `scoreable_node_types` string[], required
          - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'has_all' | 'between' | 'like', required
          - `window` integer, required
          - `type` 'root/record_count/v2'
          - `aggregation` 'count'
          - `value` integer, required
    - `interval` integer, required
    - `active` boolean
    - `project_id` string, uuid4, nullable
    - `run_id` string, uuid4, nullable
    - `created_by` string, uuid4, nullable

## Response `200`

Successful Response

- AlertConfigurationResponse
  - `conditions` object[], required
  - `filters` AlertNameFilter[]
    - `name` 'node_name'
    - `operator` 'eq' | 'ne' | 'contains' | 'one_of' | 'not_in', required
    - `value` union, required
      - string
      - string[]
    - `case_sensitive` boolean
  - `interval` integer, required
  - `schema_version` 'multi_condition/object/1' | 'multi_condition/object/2'
  - `active` boolean
  - `id` string, uuid4, required
  - `created_by` string, uuid4, required
  - `project_id` string, uuid4, required
  - `run_id` string, uuid4, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-07-26** `05003e7835a2` — 4 info
  - the endpoint scheme security `ClassicAPIKeyHeader` was added to the API
  - added `root/record_count/v2` discriminator mapping keys to the `anyOf[subschema #2: CreateAlertConfigurationV2Request]/conditions/items/` request property
  - added the new `root/record_count/v2` enum value to the request property `anyOf[subschema #1: CreateAlertConfigurationV1Request]/conditions/items/condition_type`
  - added `#/components/schemas/RecordCountConditionV2` to the `anyOf[subschema #2: CreateAlertConfigurationV2Request]/conditions/items/` request property `oneOf` list

[Change history](https://skmtc.dev/galileo/apis/galileo-api-server/changes/projects/:project_id/log_streams/:log_stream_id/alerts/post.md)

---

[API](https://skmtc.dev/galileo/apis/galileo-api-server.md) · [All operations](https://skmtc.dev/galileo/apis/galileo-api-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/galileo/galileo-api-server/revisions/4bc031507246/schema)
