Alert Rules

Update an alert rule

Changed on

Update an alert rule by ID.

Requires the alert_rules:write permission.

post/alert-rules/{alertRuleId}

Request

Path parameters

alertRuleIdinteger required

ID of the alert rule to update

Headers

X-Phare-Project-Idinteger
Example:1

A project header is required when using an organization-scoped API key.

X-Phare-Project-Slugstring
Example:luminous-guiding-tower

A project header is required when using an organization-scoped API key.

Request body

scope'organization' | 'project'

Scope of the alert rule, organization to execute it for the events of every project or project to only execute it for the events of the current project

event'uptime.monitor.created' | 'uptime.monitor.deleted' | 'uptime.monitor_certificate.discovered' | 'uptime.monitor_certificate.expiring' | 'uptime.incident.created' | 'uptime.incident.propagated' | 'uptime.incident.partially_recovered' | 'uptime.incident.recovered' | 'uptime.incident_comment.created' | 'uptime.incident_update.published' | 'uptime.maintenance_window.in_progress' | 'uptime.maintenance_window.completed' | 'uptime.maintenance_window.cancelled'
integration_idinteger

The ID of the integration used to send a notification when the alert rule is executed

rate_limit0 | 5 | 10 | 30 | 60 | 180 | 720 | 1440

Minimum time in minutes between two executions of the alert rule, used to minimize the number of alerts received.

Example request

{
  "scope": "organization",
  "integration_id": 1,
  "rate_limit": 5,
  "event_settings": {
    "type": "all"
  },
  "integration_settings": {
    "priority": "default"
  }
}

Response

Success, alert rule updated

idinteger
project_idinteger nullable

The ID of a project to use as a scope

event'uptime.monitor.created' | 'uptime.monitor.deleted' | 'uptime.monitor_certificate.discovered' | 'uptime.monitor_certificate.expiring' | 'uptime.incident.created' | 'uptime.incident.propagated' | 'uptime.incident.partially_recovered' | 'uptime.incident.recovered' | 'uptime.incident_comment.created' | 'uptime.incident_update.published' | 'uptime.maintenance_window.in_progress' | 'uptime.maintenance_window.completed' | 'uptime.maintenance_window.cancelled' required
integration_idinteger required

The ID of the integration used to send a notification when the alert rule is executed

rate_limit0 | 5 | 10 | 30 | 60 | 180 | 720 | 1440 required

Minimum time in minutes between two executions of the alert rule, used to minimize the number of alerts received.

created_atstring date-time

Date of creation for the entity

updated_atstring date-time

Date of last update for the entity

Example response

{
  "id": 1,
  "project_id": 1,
  "integration_id": 1,
  "rate_limit": 5,
  "event_settings": {
    "type": "all"
  },
  "integration_settings": {
    "priority": "default"
  }
}

Changes

    • info

      the endpoint scheme security BearerAuth was added to the API

    • breaking

      the request property / became not nullable

    • breaking

      the request property / became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property // became required

    • warning

      added the new uptime.maintenance_window.cancelled enum value to the response property for the response status

    • warning

      added the new uptime.maintenance_window.completed enum value to the response property for the response status

    • warning

      added the new uptime.maintenance_window.in_progress enum value to the response property for the response status

    • info

      added the new uptime.maintenance_window.cancelled enum value to the request property

    • info

      added the new uptime.maintenance_window.completed enum value to the request property

    • info

      added the new uptime.maintenance_window.in_progress enum value to the request property

    • info

      the response property // became required for the status