For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
Usage
client.v2.insights.alertRules.byId(id).get(requestConfiguration?: RequestConfiguration<object>): Promise<undefined | AlertRulesGetResponse>
Description
To retrieve an alert rule, send a GET request to
/v2/insights/alert-rules/{id}.
Parameters
id string required
Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
A unique identifier for an alert rule.
Request Sample
Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
createDigitalOceanClient,
DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";
const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);
const response = await client.v2.insights.alertRules
.byId("a1b2c3d4-e5f6-7890-abcd-ef1234567890").get();
Response Example
Show Response Example
{
"alert_rule": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"spec": {
"name": "High CPU",
"query": {
"metric": "do.droplets.cpu_utilization",
"resource_urns": [
"do:droplet:12345"
],
"tags": [
"env:prod"
]
},
"condition": {
"window": "EVALUATION_WINDOW_5M"
},
"thresholds": {
"warning": 80,
"critical": 95,
"operator": "THRESHOLD_OPERATOR_GREATER_THAN"
},
"notification_channels": [
{
"notification_channel_id": "550e8400-e29b-41d4-a716-446655440000",
"notify_on": [
"SEVERITY_CRITICAL"
]
}
],
"re_alert_duration": "RE_ALERT_DURATION_4H"
},
"status": "ALERT_RULE_STATUS_ACTIVE",
"created_at": "2026-09-03T10:00:00Z",
"updated_at": "2026-09-03T10:00:00Z"
}
}
See /v2/insights/alert-rules/{id} in the API reference for additional detail on responses, headers, parameters, and more.