# List Alerts

Retrieves a paginated list of alerts matching the specified search criteria. Supports filtering by entity type, entity IDs, enabled status, events, and name search.

Endpoint: POST /gateway/lw/api/accounts/{account_id}/alerts/list
Version: 1.0
Security: x-api-key

## Path parameters:

  - `account_id` (string, required)
    Unique identifier of the Harness account
    Example: "px7xd_BFRCi-pfWPYXVjvw"

## Query parameters:

  - `accountIdentifier` (string, required)
    Account Identifier for authentication and authorization
    Example: "px7xd_BFRCi-pfWPYXVjvw"

## Request fields (application/json):

  - `page` (integer)
    Page number for pagination (1-indexed)
    Example: 1

  - `limit` (integer)
    Number of records per page
    Example: 10

  - `sort` (object)
    Sorting options for the results
    Example: {"field":"updated_at","type":"DESC"}

  - `sort.field` (string)
    Field to sort by
    Enum: "updated_at", "created_at"

  - `sort.type` (string)
    Sort direction
    Enum: "ASC", "DESC"

  - `filters` (array)
    Advanced filters for querying alerts

  - `filters.field` (string)
    Field name to filter on

  - `filters.fields` (array)
    Multiple fields to filter with OR clause (higher priority than single field)

  - `filters.operator` (string)
    Filter operator
    Enum: "equals", "not_equals"

  - `filters.values` (array)
    Values to filter by

  - `entity_type` (string)
    Filter by entity type
    Enum: "autostopping_rule"

  - `entity_id` (array)
    Filter by specific entity IDs (AutoStopping rule IDs)
    Example: ["4519","4487"]

  - `enabled` (boolean)
    Filter by enabled status
    Example: true

  - `events` (array)
    Filter by event types
    Enum: "autostopping_warmup_failed", "autostopping_cooldown_failed", "autostopping_rule_created", "autostopping_rule_updated", "autostopping_rule_deleted"

  - `query` (string)
    Search query to filter alerts by name (case-insensitive partial match)
    Example: "production"

## Response 200 fields (application/json):

  - `response` (object, required)

  - `response.records` (array, required)
    List of alerts matching the search criteria

  - `response.records.id` (string)
    Unique identifier of the alert

  - `response.records.account_id` (string)
    ID of the account this alert belongs to

  - `response.records.name` (string)
    Name of the alert

  - `response.records.enabled` (boolean)
    Whether the alert is enabled

  - `response.records.entity_type` (string)
    Type of entity the alert is associated with
    Enum: "autostopping_rule"

  - `response.records.recipients` (array)
    List of notification recipients

  - `response.records.recipients.type` (string, required)
    Type of notification channel
    Enum: "email", "slack"

  - `response.records.recipients.ids` (array, required)
    List of recipient identifiers. For email: email addresses. For slack: Slack channel IDs or webhook URLs.
    Example: ["user@example.com"]

  - `response.records.events` (array)
    List of events that trigger the alert

  - `response.records.events.id` (string, required)
    Unique identifier for this event configuration. Can be any string to identify this event entry.
    Example: "event-warmup-failed"

  - `response.records.events.event` (string, required)
    Type of event that triggers the alert
    Enum: "autostopping_warmup_failed", "autostopping_cooldown_failed", "autostopping_rule_created", "autostopping_rule_updated", "autostopping_rule_deleted"

  - `response.records.created_at` (string)
    Timestamp when the alert was created

  - `response.records.updated_at` (string)
    Timestamp when the alert was last updated

  - `response.records.associated_entities` (array)
    List of entities associated with this alert

  - `response.total` (integer, required)
    Total number of alerts matching the criteria

  - `response.pages` (integer, required)
    Total number of pages


## Response 400 fields
