API7 Docs
API7 GatewayAPI7 Enterprise Admin APIsList all alert policies

List all alert policies

GET /api/alert/policies

GET /api/alert/policies

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Query Parameters

order_by?string

Index to order alert policies by.

Default"updated_at"

Value in

  • "created_at"
  • "updated_at"
  • "name"
  • "severity"
direction?string

Order to list the resources by. The sorting index follows the configuration of order_by.

Default"desc"

Value in

  • "asc"
  • "desc"
page_size?integer

Number of resources listed per page. Used together with page. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.

Formatint32
Range1 <= value
page?integer

Page number of the listed resources. Used together with page_size. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.

Formatint32
Range1 <= value
search?string

Condition to search resources by.

labels?string

Label(s) to filter resources by. The format is labels[key]=value and should be URL-encoded.

Length1 <= length
status?array<>

Alert enablement status.

severity?array<>

Alert severity.

Response Body

application/json

curl -X GET "$API_BASE_URL/api/alert/policies?search=version%253Dv2"

Successfully retrieved the paginated list of alert policies.

{
  "total": 1,
  "list": [
    {
      "name": "500 status alert",
      "desc": "Object description.",
      "labels": {
        "version": "v2",
        "env": "prod"
      },
      "enable": true,
      "check_interval": 1,
      "severity": "high",
      "trigger_logical_operator": "All",
      "id": "509fd356-df70-480b-8622-c38e27cfdd99",
      "created_at": 1742288232,
      "updated_at": 1742288235
    }
  ]
}
Complete operation details and schema variants

GET /api/alert/policies

List all alert policies

List alert policies configured for monitoring conditions such as error rates, latency thresholds, and availability checks. Use query filters to narrow results by severity, status, labels, and search terms.

Required IAM Permission: Action gateway:GetAlertPolicy, Resource arn:api7:gateway:alert/%s

Parameters

  • order_by (query, string, optional): Index to order alert policies by.
  • direction (query, string, optional): Order to list the resources by. The sorting index follows the configuration of order_by.
  • page_size (query, integer, optional): Number of resources listed per page. Used together with page. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
  • page (query, integer, optional): Page number of the listed resources. Used together with page_size. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
  • search (query, string, optional): Condition to search resources by.
  • labels (query, string, optional): Label(s) to filter resources by. The format is labels[key]=value and should be URL-encoded.
  • status (query, array, optional): Alert enablement status.
  • severity (query, array, optional): Alert severity.

Responses

  • 200: Successfully retrieved the paginated list of alert policies.
  • allOf variant 1
  • list (array, optional): An array of resources.
  • total (integer, optional): Total number of objects.
  • allOf variant 2
  • list (array, optional): The definition of an alert policy.
  • list[].name (string, optional): The alert policy name.
  • list[].desc (string, optional): The alert policy description.
  • list[].labels (object, optional): Key-value pairs of labels.
  • list[].enable (boolean, optional): If true, enable the alert policy.
  • list[].check_interval (integer, optional): The check interval for the alert policy. The unit is second.
  • list[].severity (string, optional): The alert severity level.
  • list[].trigger_logical_operator (string, optional): The logical relationship between multiple triggers.
  • list[].id (string, optional): The alert policy ID.
  • list[].created_at (integer, optional): The create timestamp of an alert policy.
  • list[].updated_at (integer, optional): The update timestamp of an alert policy.

cURL

curl -X GET '$API_BASE_URL/api/alert/policies'