---
title: "Query alert logs"
method: POST
path: "/alerts/search"
tags: ["Alerts"]
---

# Query alert logs

`POST /alerts/search`

Use when viewing or searching alert history (e.g. support triage or customer-facing alert log). Returns a paginated list; supports filtering by type, customer, subscription.

## Request body

- TypesAlertLogFilter
  - `alert_status` 'ok' | 'info' | 'warning' | 'in_alarm'
  - `alert_type` 'low_ongoing_balance' | 'low_credit_balance' | 'feature_wallet_balance' | 'subscription_spend' | 'subscription_line_item_spend' | 'subscription_group_spend' | 'entitlement_grant_threshold' | 'entitlement_grant_exhausted'
  - `customer_id` string
  - `end_time` string, date-time
  - `entity_id` string
  - `entity_type` 'wallet' | 'feature' | 'subscription' | 'subscription_line_item' | 'group' | 'entitlement_grant'
  - `expand` string
  - `filters` TypesFilterCondition[] — filters allows complex filtering based on multiple fields
    - `data_type` 'string' | 'number' | 'date' | 'array'
    - `field` string
    - `operator` 'eq' | 'contains' | 'not_contains' | 'gt' | 'lt' | 'gte' | 'in' | 'not_in' | 'before' | 'after'
    - `value` TypesValue
      - `array` string[]
      - `boolean` boolean
      - `date` string
      - `number` number
      - `string` string
  - `limit` integer
  - `offset` integer
  - `order` 'asc' | 'desc'
  - `sort` TypesSortCondition[]
    - `direction` 'asc' | 'desc'
    - `field` string
  - `start_time` string, date-time
  - `status` 'published' | 'deleted' | 'archived'

## Response `200`

OK

- ListAlertLogsResponse
  - `items` AlertLogResponse[]
    - `alert_info` TypesAlertInfo
      - `alert_settings` TypesAlertSettings
        - `alert_enabled` boolean
        - `critical` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
        - `info` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
        - `warning` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
      - `timestamp` string
      - `value_at_time` string, date-time
    - `alert_status` 'ok' | 'info' | 'warning' | 'in_alarm'
    - `alert_type` 'low_ongoing_balance' | 'low_credit_balance' | 'feature_wallet_balance' | 'subscription_spend' | 'subscription_line_item_spend' | 'subscription_group_spend' | 'entitlement_grant_threshold' | 'entitlement_grant_exhausted'
    - `created_at` string, date-time
    - `created_by` string
    - `customer` CustomerResponse — Customer response object containing all customer information
      - `address_city` string — AddressCity is the city of the customer's address
      - `address_country` string — AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2)
      - `address_line1` string — AddressLine1 is the first line of the customer's address
      - `address_line2` string — AddressLine2 is the second line of the customer's address
      - `address_postal_code` string — AddressPostalCode is the postal code of the customer's address
      - `address_state` string — AddressState is the state of the customer's address
      - `contact` string — Contact is an optional contact number for the customer (e.g. phone)
      - `created_at` string, date-time
      - `created_by` string
      - `email` string — Email is the email of the customer
      - `environment_id` string — EnvironmentID is the environment identifier for the customer
      - `external_id` string — ExternalID is the external identifier for the customer
      - `id` string — ID is the unique identifier for the customer
      - `integrations` EntityIntegrationMappingResponse[]
        - `created_at` string, date-time
        - `created_by` string
        - `entity_id` string
        - `entity_type` 'customer' | 'plan' | 'invoice' | 'subscription' | 'payment' | 'credit_note' | 'addon' | 'item' | 'item_price' | 'price' | 'invoice_line_item'
        - `environment_id` string
        - `id` string
        - `metadata` object
        - `provider_entity_id` string
        - `provider_type` string
        - `status` 'published' | 'deleted' | 'archived'
        - `tenant_id` string
        - `updated_at` string, date-time
        - `updated_by` string
      - `metadata` object — Metadata
      - `name` string — Name is the name of the customer
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `timezone` string — Timezone is the customer's IANA timezone name (e.g. "Asia/Kolkata"). Defaults to "UTC". Inherited by subscriptions at creation time.
      - `updated_at` string, date-time
      - `updated_by` string
    - `customer_id` string
    - `entity_id` string
    - `entity_type` 'wallet' | 'feature' | 'subscription' | 'subscription_line_item' | 'group' | 'entitlement_grant'
    - `environment_id` string
    - `feature` FeatureResponse
      - `alert_settings` TypesAlertSettings
        - `alert_enabled` boolean
        - `critical` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
        - `info` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
        - `warning` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
      - `created_at` string, date-time
      - `created_by` string
      - `description` string
      - `environment_id` string
      - `group` GroupResponse
        - `created_at` string, date-time
        - `entity_ids` string[]
        - `entity_type` string
        - `id` string
        - `lookup_key` string
        - `metadata` object
        - `name` string
        - `status` string
        - `updated_at` string, date-time
      - `group_id` string
      - `id` string
      - `lookup_key` string
      - `metadata` TypesMetadata
      - `meter` MeterResponse
        - `aggregation` MeterAggregation
          - `bucket_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'
          - `expression` string — Expression is an optional CEL expression to compute per-event quantity from event.properties. When set, it replaces Field-based extraction. Property names are used directly (e.g., token * duration * pixel).
          - `field` string — Field is the key in $event.properties on which the aggregation is to be applied For ex if the aggregation type is sum for API usage, the field could be "duration_ms" Ignored when Expression is set.
          - `group_by` string — GroupBy is the property name in event.properties to group by before aggregating. Currently only supported for MAX aggregation with bucket_size. When set, aggregation is applied per unique value of this property within each bucket, then the per-group results are summed to produce the bucket total.
          - `multiplier` string — Multiplier is the multiplier for the aggregation For ex if the aggregation type is sum_with_multiplier for API usage, the multiplier could be 1000 to scale up by a factor of 1000. If not provided, it will be null.
          - `type` 'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM'
        - `created_at` string, date-time
        - `event_name` string
        - `filters` MeterFilter[]
          - `key` string — Key is the key for the filter from $event.properties Currently we support only first level keys in the properties and not nested keys
          - `values` string[] — Values are the possible values for the filter to be considered for the meter For ex "model_name" could have values "o1-mini", "gpt-4o" etc
        - `id` string
        - `name` string
        - `reset_usage` 'BILLING_PERIOD' | 'NEVER'
        - `status` string
        - `tenant_id` string
        - `updated_at` string, date-time
      - `meter_id` string
      - `name` string
      - `reporting_unit` TypesReportingUnit
        - `conversion_rate` number — Multiplier: reporting_unit_value = unit_value * conversion_rate; must be > 0
        - `unit_plural` string — Display unit label, plural (e.g. "seconds")
        - `unit_singular` string — Display unit label, singular (e.g. "second")
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `type` 'metered' | 'boolean' | 'static' | 'config'
      - `unit_plural` string
      - `unit_singular` string
      - `updated_at` string, date-time
      - `updated_by` string
    - `id` string
    - `parent_entity_id` string
    - `parent_entity_type` string
    - `status` string
    - `tenant_id` string
    - `updated_at` string, date-time
    - `updated_by` string
    - `wallet` WalletResponse
      - `alert_settings` TypesAlertSettings
        - `alert_enabled` boolean
        - `critical` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
        - `info` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
        - `warning` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
      - `alert_state` 'ok' | 'info' | 'warning' | 'in_alarm'
      - `auto_topup` TypesAutoTopup
        - `amount` number
        - `cooldown` TypesDuration
          - `unit` 'second' | 'minute' | 'hour' | 'day'
          - `value` integer
        - `enabled` boolean
        - `invoicing` boolean
        - `threshold` number
      - `balance` string
      - `config` TypesWalletConfig
        - `allowed_price_types` TypesWalletConfigPriceType[] — AllowedPriceTypes is a list of price types that are allowed for the wallet nil means all price types are allowed
      - `conversion_rate` string — amount in the currency = number of credits * conversion_rate ex if conversion_rate is 1, then 1 USD = 1 credit ex if conversion_rate is 2, then 1 USD = 0.5 credits ex if conversion_rate is 0.5, then 1 USD = 2 credits
      - `created_at` string, date-time
      - `created_by` string
      - `credit_balance` string
      - `credits_available_breakdown` TypesCreditBreakdown
        - `free` string
        - `purchased` string
      - `currency` string
      - `customer_id` string
      - `description` string
      - `environment_id` string
      - `id` string
      - `metadata` TypesMetadata
      - `name` string
      - `real_time_balance` string
      - `real_time_credit_balance` string
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `topup_conversion_rate` string — topup_conversion_rate is the conversion rate for the topup to the currency ex if topup_conversion_rate is 1, then 1 USD = 1 credit ex if topup_conversion_rate is 2, then 1 USD = 0.5 credits ex if topup_conversion_rate is 0.5, then 1 USD = 2 credits
      - `updated_at` string, date-time
      - `updated_by` string
      - `wallet_status` 'active' | 'frozen' | 'closed'
      - `wallet_type` 'PRE_PAID' | 'POST_PAID'
  - `pagination` TypesPaginationResponse
    - `limit` integer
    - `offset` integer
    - `total` integer

## Other responses

- `400` — Invalid request
- `500` — Server error

---

[API](https://skmtc.net/flexprice/apis/flexprice-api.md) · [All operations](https://skmtc.net/flexprice/apis/flexprice-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/flexprice/flexprice-api/revisions/f0601ed97bd3/schema)
