Clear a raised alert on an agent instance
const url = 'https://app.prefactorai.com/api/v1/alerts/clear';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/clear \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '"013xrzp12g3nqk8ns6jadrqmpgrjkeny"'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”A valid agent instance ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyResponses
Section titled “Responses”Success
object
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)
Alert payload data (arbitrary JSON object)
object
When true, payload should be interpreted as containing sensitive markers as per the specification
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
{ "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
object
object
object
object
Milliseconds until the client may retry.
object
A valid knowledgebase document revision ID
Example
{ "code": "bad_request", "status": "error"}