Skip to main content
POST
/
alert-rules
Create alert rule
curl --request POST \
  --url https://api.qovery.com/alert-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "description": "<string>",
  "tag": "<string>",
  "condition": {
    "kind": "CUSTOM",
    "promql": "<string>",
    "operator": "NONE",
    "threshold": 123,
    "function": "NONE"
  },
  "for_duration": "<string>",
  "severity": "LOW",
  "presentation": {
    "summary": "<string>",
    "runbook_url": "<string>"
  },
  "enabled": true,
  "alert_receiver_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "target": {
    "target_type": " CLUSTER",
    "target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "service": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "description": "<string>",
      "icon_uri": "<string>",
      "service_type": "APPLICATION",
      "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "project_name": "<string>",
      "environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "environment_name": "<string>",
      "cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "job_type": "CRON"
    }
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "source": "MANAGED",
  "name": "<string>",
  "state": "UNDEPLOYED",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>",
  "tag": "<string>",
  "condition": {
    "kind": "CUSTOM",
    "promql": "<string>",
    "operator": "NONE",
    "threshold": 123,
    "function": "NONE"
  },
  "for_duration": "<string>",
  "severity": "LOW",
  "enabled": true,
  "alert_receiver_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "presentation": {
    "summary": "<string>",
    "runbook_url": "<string>"
  },
  "target": {
    "target_type": " CLUSTER",
    "target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "service": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "description": "<string>",
      "icon_uri": "<string>",
      "service_type": "APPLICATION",
      "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "project_name": "<string>",
      "environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "environment_name": "<string>",
      "cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "job_type": "CRON"
    }
  },
  "is_up_to_date": true,
  "updated_at": "2023-11-07T05:31:56Z",
  "starts_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

JWT tokens should be used with OIDC account (human to machine). JWT tokens used by the Qovery console to communicate with the API have a TTL. Curl Example ' curl https://console.qovery.com/organization -H "Authorization: Bearer $qovery_token" '

Body

application/json
organization_id
string<uuid>
required

Organization identifier

cluster_id
string<uuid>
required

Cluster identifier where the rule will be deployed

name
string
required

Name of the alert rule

description
string
required

Description of what the alert monitors

tag
string
required
condition
AlertRuleCondition · object
required
for_duration
string<duration>
required

Duration the condition must be true before firing (ISO-8601 duration format)

severity
enum<string>
required

Alert severity level: - LOW: Minor issues or informational alerts that don't require immediate attention. Can be addressed during normal business hours. - MEDIUM: Moderate issues that should be investigated soon but don't impact critical services. May cause degraded performance or minor service disruption. - HIGH: Serious issues affecting service quality or availability. Requires prompt attention and resolution within hours. - CRITICAL: Critical issue requiring immediate action. Service outage, data loss risk, or severe performance degradation affecting users.

Available options:
LOW,
MEDIUM,
HIGH,
CRITICAL
presentation
AlertPresentation · object
required
enabled
boolean
required

Whether the alert rule is enabled

alert_receiver_ids
string<uuid>[]
required

List of alert receiver IDs to send notifications to

Minimum array length: 1
target
AlertTarget · object
required

Response

Created

Base schema for alert rule responses with discriminator

id
string<uuid>
required
created_at
string<date-time>
required
source
enum<string>
required

Source of the alert rule:

  • MANAGED: Alert rule created and managed through the Qovery API
  • GHOST: Alert rule that exists in Prometheus but has been deleted from the database
Available options:
MANAGED,
GHOST
name
string
required

Name of the alert rule

state
enum<string>
required
Available options:
UNDEPLOYED,
OK,
TRIGGERED,
PENDING_NOTIFICATION,
NOTIFIED,
SUPPRESSED,
UNROUTED
organization_id
string<uuid>
required

Organization identifier

cluster_id
string<uuid>
required

Cluster identifier

description
string
required

Description of what the alert monitors

tag
string
required
condition
AlertRuleCondition · object
required
for_duration
string<duration>
required

Duration the condition must be true before firing (ISO-8601 duration format)

severity
enum<string>
required

Alert severity level: - LOW: Minor issues or informational alerts that don't require immediate attention. Can be addressed during normal business hours. - MEDIUM: Moderate issues that should be investigated soon but don't impact critical services. May cause degraded performance or minor service disruption. - HIGH: Serious issues affecting service quality or availability. Requires prompt attention and resolution within hours. - CRITICAL: Critical issue requiring immediate action. Service outage, data loss risk, or severe performance degradation affecting users.

Available options:
LOW,
MEDIUM,
HIGH,
CRITICAL
enabled
boolean
required

Whether the alert rule is enabled

alert_receiver_ids
string<uuid>[]
required

List of alert receiver IDs to send notifications to

presentation
AlertPresentationResponse · object
required
target
AlertTarget · object
required
is_up_to_date
boolean
required

Indicates whether the current version of the alert has been synced with the alerting system. If false, an outdated version is currently deployed.

updated_at
string<date-time>
starts_at
string<date-time>

when the alert starts firing