List all alert histories
GET /api/alert/policies/histories
GET /api/alert/policies/historiesInteractive request editor loads with JavaScript.
In: header
Query Parameters
Alert policy ID.
Alert severity.
Start at timestamp to filter the audit logs.
End at timestamp to filter the audit logs.
Gateway group ID.
1 <= lengthIndex to order alerts by.
"alert_time"Value in
- "alert_time"
Order to list the resources by. The sorting index follows the configuration of order_by.
"desc"Value in
- "asc"
- "desc"
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.
int321 <= valuePage 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.
int321 <= valueCondition to search resources by.
Response Body
application/json
application/json
curl -X GET "$API_BASE_URL/api/alert/policies/histories?search=version%253Dv2"Successfully retrieved the paginated list of alert history entries.
{
"total": 1,
"list": [
{
"id": "ce6dbbb2-b8bc-4df8-b3e3-5af09c4a045f",
"alert_policy_id": "72a2186a-f249-4da1-a2ec-a186150895b2",
"alert_policy_name": "500 status code",
"trigger_gateway_groups": [
{
"gateway_group_id": "bc1b95c9-b348-4832-acc3-e257d2342df1",
"gateway_group_name": "us-west-rsc"
}
],
"severity": "high",
"alert_time": 0,
"alert_detail": "string",
"notification_logs": [
{
"id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
"created_at": 1742288232,
"updated_at": 1742288235,
"contact_point_name": "cp-docs-test",
"resource_type": "alert_policy",
"resource_id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
"resource_name": "Weather Insights API",
"status": "failed",
"send_time": 1759649130,
"request": "{\"from\": \"test.send@api7.ai\", \"to\": \"test.receive@api7.ai\", \"subject\": \"API7 Notification\", \"content\": \"This is a test notification.\"}",
"response": "450 The domain must be verified in your account to send emails."
}
],
"debug_session_logs": [
{
"id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
"success": true,
"error": "string",
"debug_session_id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
"gateway_group_id": "bc1b95c9-b348-4832-acc3-e257d2342df1"
}
],
"created_at": 1742288232,
"updated_at": 1742288235
}
]
}Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
{
"value": {},
"error_msg": "error message"
}Complete operation details and schema variants
GET /api/alert/policies/histories
List all alert histories
List historical alert events triggered by alert policies, including occurrence time, severity, and related gateway group context. Use time-range and policy filters to investigate incidents and alert trends.
Required IAM Permission: Action gateway:GetAlertPolicy, Resource arn:api7:gateway:alert/*
Parameters
alert_policy_id(query, string, optional): Alert policy ID.severity(query, array, optional): Alert severity.start_at(query, integer, optional): Start at timestamp to filter the audit logs.end_at(query, integer, optional): End at timestamp to filter the audit logs.gateway_group_id(query, string, optional): Gateway group ID.order_by(query, string, optional): Index to order alerts by.direction(query, string, optional): Order to list the resources by. The sorting index follows the configuration oforder_by.page_size(query, integer, optional): Number of resources listed per page. Used together withpage. For example, when there are 13 resources in total, if the query parameters arepage=1&page_size=10, the GET response will show the routetotalas13and display 10 resources in the first page. If the query parameters arepage=2&page_size=10, the GET response will show the routetotalas13and display 3 resources in the second page.page(query, integer, optional): Page number of the listed resources. Used together withpage_size. For example, when there are 13 resources in total, if the query parameters arepage=1&page_size=10, the GET response will show the routetotalas13and display 10 resources in the first page. If the query parameters arepage=2&page_size=10, the GET response will show the routetotalas13and display 3 resources in the second page.search(query, string, optional): Condition to search resources by.
Responses
200: Successfully retrieved the paginated list of alert history entries.- allOf variant 1
list(array, optional): An array of resources.total(integer, optional): Total number of objects.- allOf variant 2
list(array, optional): An array of alert policy history.list[].id(string, optional): ID of the alert.list[].alert_policy_id(string, optional): Alert policy ID.list[].alert_policy_name(string, optional): The alert policy name.list[].trigger_gateway_groups(array, optional): An array of gateway groups that triggered the alerts.list[].trigger_gateway_groups[].gateway_group_id(string, optional): The gateway group ID.list[].trigger_gateway_groups[].gateway_group_name(string, optional): The object name.list[].severity(string, optional): The alert severity level.list[].alert_time(integer, optional): The alert time.list[].alert_detail(string, optional): The alert detail.list[].notification_logs(array, optional): An array of notification logs.list[].notification_logs[].id(string, optional): The object ID.list[].notification_logs[].created_at(integer, optional): The object created timestamp.list[].notification_logs[].updated_at(integer, optional): The object updated timestamp.list[].notification_logs[].contact_point_name(string, optional): Name of the contact point.list[].notification_logs[].resource_type(string, optional): Type of notification.list[].notification_logs[].resource_id(string, optional): The resource ID.list[].notification_logs[].resource_name(string, optional): The object name.list[].notification_logs[].status(string, optional): Notification sending status.list[].notification_logs[].send_time(integer, optional): The time when the notification is sent.list[].notification_logs[].request(string, optional): Request information.list[].notification_logs[].response(string, optional): Response from the server.list[].debug_session_logs(array, optional): An array of logs recording the debug sessions created when the alert was triggered.list[].debug_session_logs[].id(string, optional): The object ID.list[].debug_session_logs[].success(boolean, optional): Whether the debug session was created successfully.list[].debug_session_logs[].error(string, optional): The error message if the debug session creation failed.list[].debug_session_logs[].debug_session_id(string, optional): The ID of the debug session created. Only present when success is true.list[].debug_session_logs[].gateway_group_id(string, optional): The gateway group ID for which the debug session was created.list[].created_at(integer, optional): The object created timestamp.list[].updated_at(integer, optional): The object updated timestamp.400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.value(object, optional): The specific resource.error_msg(string, optional): The error message.
cURL
curl -X GET '$API_BASE_URL/api/alert/policies/histories'