Receiver Groups
Receiver groups define where your alerts should be sent (Slack, Email, PagerDuty, etc.).
Authentication
These APIs can be accessed programmatically using the Admin Port 3199.
Headers Required:
- (Optional)
Authorization: Bearer <ADMIN_TOKEN> Content-Type: application/json
When http-token-admin is enabled in CubeAPM's config.properties, requests must include the corresponding token in the Authorization header when using curl to CREATE, UPDATE, or DELETE receiver groups.
Create Receiver Group
When creating a receiver group, one or multiple receivers of the same or different types can be mapped to a single receiver group.
Endpoint: POST http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups
Request Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | A descriptive name for the notification group. |
receiver.slack_configs | array | Contains Slack configurations. Requires channel (e.g., "#alerts"). |
receiver.email_configs | array | Contains email configurations. Requires to (e.g., "team@company.com"). |
receiver.pagerduty_configs | array | Requires service_name and routing_key. |
receiver.webhook_configs | array | Requires url to send a POST request. Optionally accepts custom headers (key-value pairs) and a custom body string. |
receiver.msteamsv2_configs | array | Requires webhook_url for Microsoft Teams incoming webhook integration. |
receiver.jira_configs | array | Requires project and issue_type to automatically create Jira tickets. |
receiver.opsgenie_configs | array | Requires api_key for OpsGenie routing. |
receiver.googlechat_configs | array | Requires url for Google Chat webhooks. |
Since CubeAPM uses the standard Alertmanager schema, you can refer to the official Prometheus Alertmanager Documentation for detailed descriptions and additional integration fields (like send_resolved, text, title, etc.) for MS Teams, Jira, Slack, PagerDuty, and more!
Common Integration Parameters
In addition to standard Alertmanager fields, CubeAPM supports specific parameters inside your receiver configurations (e.g., inside a slack_configs object):
| Parameter | Type | Description |
|---|---|---|
send_resolved | boolean | Whether or not to notify when the alert is resolved (e.g. returns to a healthy state). Default is true. |
cube_show_query | boolean | If true, includes the raw PromQL/Metrics query that triggered the alert inside the notification payload. Default is false. |
cube_show_sample_log | boolean | If true, includes a sample log line from the evaluation (if applicable for Log-based alerts). Default is false. |
Curl Example
- Slack
- PagerDuty
- OpsGenie
- Jira
- MS Teams
- Webhook
- Google Chat
curl -X POST "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"name": "Slack Alerts",
"receiver": {
"slack_configs": [
{
"channel": "production-alerts",
"send_resolved":true,
"cube_show_query":false,
"cube_show_sample_log":false
}
]
}
}'
curl -X POST "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"name": "Email Alerts",
"receiver": {
"email_configs": [
{
"to": "devops@yourcompany.com",
"send_resolved":true
}
]
}
}'
curl -X POST "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"name": "PagerDuty Alerts",
"receiver": {
"pagerduty_configs": [
{
"service_name": "Database Team",
"routing_key": "YOUR_PD_ROUTING_KEY",
"send_resolved":true
}
]
}
}'
curl -X POST "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"name": "OpsGenie Alerts",
"receiver": {
"opsgenie_configs": [
{
"api_key": "YOUR_OPSGENIE_API_KEY",
"send_resolved":true
}
]
}
}'
curl -X POST "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"name": "Jira Tickets",
"receiver": {
"jira_configs": [
{
"project": "PROJ",
"issue_type": "Bug",
"send_resolved":true
}
]
}
}'
curl -X POST "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"name": "Teams Alerts",
"receiver": {
"msteamsv2_configs": [
{
"webhook_url": "ms-teams webhook url",
"send_resolved":true,
"cube_show_query":false
}
]
}
}'
curl -X POST "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"name": "Custom Webhook",
"receiver": {
"webhook_configs": [
{
"url": "https://api.yourcompany.com/alerts",
"headers": {
"Content-Type": "application/json"
},
"body": "{ \"alert_status\": \"triggered\", \"details\": \"Custom payload\" }",
"send_resolved":true
}
]
}
}'
curl -X POST "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"name": "Google Chat Alerts",
"receiver": {
"googlechat_configs": [
{
"url": "google webhook url",
"send_resolved":true,
"cube_show_query":false,
"cube_show_sample_log":false
}
]
}
}'
Response Format
The response is a JSON object with the following structure:
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier for the receiver group. |
name | string | The name of the notification group. |
receiver | object | The saved configuration for the integrations (e.g., slack_configs, email_configs). |
For example:
{
"id": 3,
"name": "Slack Alerts",
"receiver": {
"slack_configs": [
{
"channel": "production-alerts"
}
]
}
}
Fetch All Receiver Groups
Endpoint: GET http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups
Curl Example
Fetch all receiver groups:
curl -X GET "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups"
Response Format
The response format is a JSON array of receiver group objects. See Create Receiver Group Response Format for the schema structure.
For example:
[
{
"id": 3,
"name": "Slack Alerts",
"receiver": {
"slack_configs": [
{
"channel": "production-alerts"
}
]
}
}
]
Fetch Specific Receiver Group
Endpoint: GET http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups
Curl Example
Fetch a specific receiver group by ID:
curl -X GET "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups?id=1"
Response Format
The response is a JSON object representing the specific receiver group. See Create Receiver Group Response Format for the schema structure.
For example:
{
"id": 3,
"name": "Slack Alerts",
"receiver": {
"slack_configs": [
{
"channel": "production-alerts"
}
]
}
}
Update / Delete Receiver Groups
The PUT request replaces the entire Receiver Group configuration. You must include all existing configurations (such as the receiver integrations) in your payload; otherwise, they will be overwritten and removed!
Update a Receiver Group (PUT)
Endpoint: PUT http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups
curl -X PUT "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups" \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"name": "Updated Name",
"receiver": {
"slack_configs": [
{ "channel": "production-alerts-v2" }
]
}
}'
Delete a Receiver Group (DELETE)
Endpoint: DELETE http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups?id=1
curl -X DELETE "http://<cubeapm-admin-host>:3199/api/alerts/api/v1/receivergroups?id=1"