Raise an alert on an agent instance
POST
/api/v1/alerts/raise
const url = 'https://app.prefactorai.com/api/v1/alerts/raise';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '"013xrzp12g3nqk8ns6jadrqmpgrjkeny"'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.prefactorai.com/api/v1/alerts/raise \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '"013xrzp12g3nqk8ns6jadrqmpgrjkeny"'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”AgentInstance_Id
A valid agent instance ID
string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyResponses
Section titled “Responses”Success
Media typeapplication/json
object
details
required
Alert_Details
object
account_id
required
Account_Id
A valid account ID
string
agent_id
required
Agent_Id
A valid agent ID
string
agent_instance_id
required
AgentInstance_Id
A valid agent instance ID
string
cleared_at
required
environment_id
required
Environment_Id
A valid environment ID
string
id
required
Alert_Id
A valid alert ID
string
inserted_at
required
When the alert row was created
string format: date-time
name
required
Name of the alert (key in the agent schema version alert_schemas)
string
payload
required
Alert payload data (arbitrary JSON object)
object
key
additional properties
any
payload_sensitive_encoding
required
When true, payload should be interpreted as containing sensitive markers as per the specification
boolean
raised_at
required
When the alert was raised
string format: date-time
severity
required
Severity of the alert
string
status
required
Lifecycle status of the alert: ‘raised’ or ‘cleared’
string
summary
required
title
required
Human-readable title from the alert schema (defaults to name when the schema has no title)
string
type
required
Type of resource (always ‘alert’)
string
updated_at
required
When the alert row was last updated
string format: date-time
version
required
Monotonic version of this alert row. Starts at 1 and increments on each real update.
integer
status
required
string
Example
{ "details": { "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 }, "status": "success"}default
Section titled “default”Error
Media typeapplication/json
One of:
object
code
required
string
message
required
string
status
required
string
object
code
required
string
errors
required
object
key
additional properties
object recursive
message
required
string
status
required
string
object
code
required
string
message
required
string
retry_after_ms
required
Milliseconds until the client may retry.
integer
status
required
string
Example
{ "code": "bad_request", "status": "error"}