List alerts
const url = 'https://app.prefactorai.com/api/v1/alerts';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://app.prefactorai.com/api/v1/alerts \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”A valid agent instance ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyNull
A valid environment ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyNull
Sort order; a field name, optionally prefixed with - for descending (e.g. -id). Supported fields: id, raised_at, cleared_at, name, severity. Descending severity puts critical first because severity is stored as a magnitude. When omitted, the default order is raised first, then severity descending, then cleared_at descending, then name ascending.
Sort order; a field name, optionally prefixed with - for descending (e.g. -id). Supported fields: id, raised_at, cleared_at, name, severity. Descending severity puts critical first because severity is stored as a magnitude. When omitted, the default order is raised first, then severity descending, then cleared_at descending, then name ascending.
Zero-based offset of the first item to return.
Number of items to return per page (1-100).
Responses
Section titled “Responses”Success
object
Pagination information
object
The total number of items
The index of the last item in the page (one-based)
The index of the first item in the page (one-based)
The total number of pages
The index of the current page (one-based)
The offset of the first item in the page (zero-based)
The number of items per page
Null
object
A valid account ID
A valid agent ID
A valid agent instance ID
A valid environment ID
A valid alert ID
When the alert row was created
Name of the alert (key in the agent schema version alert_schemas)
When the alert was raised
Severity of the alert
Lifecycle status of the alert: ‘raised’ or ‘cleared’
Human-readable title from the alert schema (defaults to name when the schema has no title)
Type of resource (always ‘alert’)
When the alert row was last updated
Monotonic version of this alert row. Starts at 1 and increments on each real update.
Example
{ "pagination": { "item_count": 200, "item_end": 100, "item_start": 91, "next_page_offset": 110, "page_count": 20, "page_index": 10, "page_offset": 90, "page_size": 10, "previous_page_offset": 80 }, "sorting": null, "status": "success", "summaries": [ { "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_instance_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "cleared_at": "2024-01-01T00:00:00Z", "environment_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "inserted_at": "2024-01-01T00:00:00Z", "name": "high_error_rate", "raised_at": "2024-01-01T00:00:00Z", "severity": "critical", "status": "raised", "summary": "Error rate exceeded threshold", "title": "High error rate", "type": "alert", "updated_at": "2024-01-01T00:00:00Z", "version": 1 } ]}default
Section titled “default”Error