Skip to main content

Alerts API

The Alerts API allows you to manage alerts and contact points in Quave Cloud. Alerts notify you when your applications experience issues like high CPU, memory problems, or other conditions.

Make sure to read the Get Started document to understand how the API works.

Overview

The alerting system consists of two main components:

  1. Contact Points - Notification destinations (Slack, PagerDuty, Webhook, Email) where alerts are sent
  2. Alerts - Conditions that trigger notifications when met (e.g., CPU above 80% for 5 minutes)

Contact points are account-level resources, while alerts are scoped to specific app environments.


Contact Points

Contact points define where alert notifications are sent. They are created at the account level and can be used by alerts in any app environment within that account.

Supported Contact Point Types

TypeRequired FieldsOptional FieldsDescription
slackwebhookUrlchannel, mentionUsersSlack webhook notifications
pagerdutyintegrationKeyseverityPagerDuty incident notifications
webhookurlhttpMethod, username, passwordCustom webhook notifications
emailaddresses-Email notifications (array of emails)

List Contact Points

Lists all contact points for an account.

Endpoint: GET /api/public/v1/contact-points

Query Parameters:

FieldTypeRequiredDescription
accountIdStringYesThe ID of the account.

Example:

curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/contact-points?accountId=YOUR_ACCOUNT_ID'

Example Response:

{
"contactPoints": [
{
"contactPointId": "abc123",
"name": "Slack Alerts",
"type": "slack",
"accountId": "account123",
"grafanaDeployments": [
{ "region": "us-5", "grafanaContactPointUid": "graf123" }
],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
]
}

Get Contact Point

Gets details of a specific contact point. Use showSecrets=true to view the configuration (requires admin permission).

Endpoint: GET /api/public/v1/contact-point

Query Parameters:

FieldTypeRequiredDescription
contactPointIdStringYesThe ID of the contact point.
showSecretsBooleanNoInclude config field (requires admin permission).

Example:

curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/contact-point?contactPointId=abc123&showSecrets=true'

Example Response:

{
"contactPointId": "abc123",
"name": "Slack Alerts",
"type": "slack",
"config": {
"webhookUrl": "https://hooks.slack.com/services/...",
"channel": "#alerts"
},
"accountId": "account123",
"grafanaDeployments": [
{ "region": "us-5", "grafanaContactPointUid": "graf123" }
],
"createdAt": "2024-01-15T10:30:00Z"
}

Create Contact Point

Creates a new contact point for alert notifications.

Endpoint: POST /api/public/v1/contact-point

Request Body:

FieldTypeRequiredDescription
accountIdStringYesThe ID of the account.
nameStringYesName for the contact point (1-50 characters).
typeStringYesType: slack, pagerduty, webhook, email.
configObjectYesType-specific configuration (see above).

Example: Create Slack Contact Point

curl -X POST \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"accountId": "account123",
"name": "Slack Alerts",
"type": "slack",
"config": {
"webhookUrl": "https://hooks.slack.com/services/...",
"channel": "#alerts"
}
}' \
https://api.quave.cloud/api/public/v1/contact-point

Example: Create PagerDuty Contact Point

curl -X POST \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"accountId": "account123",
"name": "PagerDuty Oncall",
"type": "pagerduty",
"config": {
"integrationKey": "your-integration-key"
}
}' \
https://api.quave.cloud/api/public/v1/contact-point

Example Response:

{
"message": "Contact point created successfully",
"contactPoint": {
"contactPointId": "abc123",
"name": "Slack Alerts",
"type": "slack",
"accountId": "account123",
"grafanaDeployments": [],
"createdAt": "2024-01-15T10:30:00Z"
}
}

Update Contact Point

Updates a contact point name or configuration. Changes are propagated to all deployed Grafana instances.

Endpoint: PATCH /api/public/v1/contact-point

Request Body:

FieldTypeRequiredDescription
contactPointIdStringYesThe ID of the contact point to update.
nameStringNoNew name for the contact point.
configObjectNoUpdated configuration object.

Example:

curl -X PATCH \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"contactPointId": "abc123",
"name": "Slack Production Alerts",
"config": {
"webhookUrl": "https://hooks.slack.com/services/...",
"channel": "#production-alerts"
}
}' \
https://api.quave.cloud/api/public/v1/contact-point

Delete Contact Point

Deletes a contact point. Cannot delete if alerts are using this contact point.

Endpoint: DELETE /api/public/v1/contact-point

Query Parameters:

FieldTypeRequiredDescription
contactPointIdStringYesThe ID of the contact point to delete.

Example:

curl -X DELETE \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/contact-point?contactPointId=abc123'

Example Response:

{
"message": "Contact point deleted successfully"
}

Note: If alerts are using the contact point, you will receive an error:

{
"error": "Contact point in use",
"details": "3 alert(s) are using this contact point. Delete or update them first."
}

Alerts

Alerts monitor your app environments and send notifications when conditions are met.

Alert Metrics

MetricDescriptionDefault Threshold
cpu_percentCPU % (combined) - CPU usage as percentage of allocated limit80%
memory_percentMemory % (combined) - Memory usage as percentage of allocated limit80%
cpu_usageCPU millicores (combined) - CPU usage in millicores (1000 millicores = 1 CPU core)500m
memory_usageMemory MB (combined) - Memory usage in megabytes512MB
cpu_percent_per_podCPU % (individual) - CPU usage per pod - use with max aggregation to find busiest pod80%
memory_percent_per_podMemory % (individual) - Memory usage per pod - use with max aggregation to find busiest pod80%
cpu_usage_per_podCPU millicores (individual) - CPU usage per pod in millicores500m
memory_usage_per_podMemory MB (individual) - Memory usage per pod in MB512MB

Alert Operators

OperatorSymbolDescription
gt>Greater than
lt<Less than

Alert Durations

DurationDescription
1m1 minute
5m5 minutes (default)
10m10 minutes
15m15 minutes
30m30 minutes
1h1 hour

Alert Aggregations

When multiple containers exist, aggregation determines how to combine their values:

ValueLabelDescription
meanAverageAverage across all containers (default)
maxWorst (Max)Highest value among containers
minBest (Min)Lowest value among containers
lastLastMost recent value

Alert Query Ranges

How far back to look for metric data when evaluating the alert:

RangeDescription
5mLast 5 minutes
10mLast 10 minutes (default)
15mLast 15 minutes
30mLast 30 minutes
1hLast 1 hour
2hLast 2 hours

Alert States

StateDescription
NormalAlert condition is not met
PendingAlert condition met, waiting for duration
FiringAlert is active and notifications sent
NoDataNo data received for alert query
ErrorError evaluating alert query

List Alerts

Lists all alerts for an app environment.

Endpoint: GET /api/public/v1/app-env/alerts

Query Parameters:

FieldTypeRequiredDescription
appEnvIdStringYesThe ID of the app environment.

Example:

curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/app-env/alerts?appEnvId=YOUR_APP_ENV_ID'

Example Response:

{
"alerts": [
{
"alertId": "alert123",
"appEnvId": "env123",
"accountId": "account123",
"name": "High CPU Alert",
"description": "Alert when CPU exceeds 80%",
"metric": "cpu_percent",
"operator": "gt",
"threshold": 80,
"duration": "5m",
"aggregation": "mean",
"queryRange": "10m",
"contactPointIds": ["cp123"],
"contactPoints": [
{ "contactPointId": "cp123", "name": "Slack Alerts", "type": "slack" }
],
"enabled": true,
"lastKnownState": "Normal",
"lastStateCheck": "2024-01-15T10:30:00Z",
"region": "us-5",
"createdAt": "2024-01-15T10:00:00Z"
}
]
}

Get Alert

Gets detailed information about a specific alert.

Endpoint: GET /api/public/v1/alert

Query Parameters:

FieldTypeRequiredDescription
alertIdStringYesThe ID of the alert.

Example:

curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/alert?alertId=alert123'

Create Alert

Creates a new alert for an app environment. The contact point(s) must already exist.

Endpoint: POST /api/public/v1/app-env/alert

Request Body:

FieldTypeRequiredDescription
appEnvIdStringYesThe ID of the app environment.
nameStringYesName for the alert (1-100 characters).
descriptionStringNoDescription of the alert (max 500 characters).
metricStringYesMetric to alert on (see table above).
operatorStringYesComparison operator (see table above).
thresholdNumberYesThreshold value.
durationStringYesDuration condition must be true (see table above).
aggregationStringNoHow to aggregate values (see table above). Default: mean.
queryRangeStringNoHow far back to look for data (see table above). Default: 10m.
contactPointIdsString[]YesArray of contact point IDs for notifications.

Example: Create CPU Alert

curl -X POST \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "env123",
"name": "High CPU Alert",
"description": "Alert when CPU usage exceeds 80% for 5 minutes",
"metric": "cpu_percent",
"operator": "gt",
"threshold": 80,
"duration": "5m",
"aggregation": "mean",
"queryRange": "10m",
"contactPointIds": ["cp123"]
}' \
https://api.quave.cloud/api/public/v1/app-env/alert

Example Response:

{
"message": "Alert created successfully",
"alert": {
"alertId": "alert123",
"name": "High CPU Alert",
"metric": "cpu_percent",
"operator": "gt",
"threshold": 80,
"duration": "5m",
"aggregation": "mean",
"queryRange": "10m",
"enabled": true,
"lastKnownState": "Normal",
"contactPoints": [
{ "contactPointId": "cp123", "name": "Slack Alerts", "type": "slack" }
]
}
}

Update Alert

Updates an alert configuration.

Endpoint: PATCH /api/public/v1/alert

Request Body:

FieldTypeRequiredDescription
alertIdStringYesThe ID of the alert to update.
nameStringNoNew name for the alert.
descriptionStringNoNew description.
metricStringNoNew metric.
operatorStringNoNew operator.
thresholdNumberNoNew threshold value.
durationStringNoNew duration.
aggregationStringNoNew aggregation method.
queryRangeStringNoNew query range.
contactPointIdsString[]NoNew array of contact point IDs.
enabledBooleanNoEnable or disable the alert.

Example:

curl -X PATCH \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"alertId": "alert123",
"threshold": 90,
"duration": "10m"
}' \
https://api.quave.cloud/api/public/v1/alert

Delete Alert

Permanently deletes an alert.

Endpoint: DELETE /api/public/v1/alert

Query Parameters:

FieldTypeRequiredDescription
alertIdStringYesThe ID of the alert to delete.

Example:

curl -X DELETE \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/alert?alertId=alert123'

Toggle Alert

Enables or disables an alert. When disabled, the alert rule is paused in Grafana, which means:

  • The alert condition is no longer evaluated
  • No notifications will be sent
  • The alert state stops updating

This is useful for temporarily silencing alerts during maintenance windows or known issues without deleting the alert configuration.

Endpoint: POST /api/public/v1/alert/toggle

Request Body:

FieldTypeRequiredDescription
alertIdStringYesThe ID of the alert.
enabledBooleanYestrue to enable (unpause), false to disable (pause).

Example:

curl -X POST \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"alertId": "alert123",
"enabled": false
}' \
https://api.quave.cloud/api/public/v1/alert/toggle

Example Response:

{
"message": "Alert disabled successfully",
"enabled": false
}

Refresh Alert State

Fetches the current alert state directly from Grafana and updates the cached state. This is useful when:

  • You want to verify an alert is back to normal after fixing an issue
  • You want the latest state without waiting for the next automatic refresh
  • The cached state seems outdated

Endpoint: POST /api/public/v1/alert/refresh

Request Body:

FieldTypeRequiredDescription
alertIdStringYesThe ID of the alert.

Possible States:

StateDescription
NormalAlert condition is not met
PendingAlert condition met, waiting for duration
FiringAlert is active and notifications sent
NoDataNo data received for alert query
ErrorError evaluating alert query

Example:

curl -X POST \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"alertId": "alert123"
}' \
https://api.quave.cloud/api/public/v1/alert/refresh

Example Response:

{
"state": "Normal",
"previousState": "Firing",
"lastStateCheck": "2024-01-15T10:35:00Z"
}

Error Responses

All endpoints may return the following error responses:

StatusDescription
400Invalid request (missing required fields, invalid values).
401User not authenticated.
403User doesn't have permission (admin permission required for create/update/delete).
404Resource not found (contact point, alert, or app environment).