Alerts API
Use the Alerts API to manage configuration, validate drafts, inspect alert instances, and manage the tenant's background metrics connection.
Base URL and Authentication
Use the Alerts API base URL supplied by your administrator. The base URL includes /api/v1, as in https://alerts.example.com/api/v1. Replace the example hostname with your assigned host.
Direct requests require a bearer token accepted by that service's configured audience and an organization ID in x-org-id. The service verifies organization membership and operation permissions.
In shell examples, set ALERTS_BASE_URL, ALERTS_TOKEN, and ALERTS_ORG_ID securely for direct API requests. Use no trailing slash in the base URL. This read-only request lists templates:
curl --fail-with-body --silent --show-error \
"$ALERTS_BASE_URL/templates" \
-H "Authorization: Bearer $ALERTS_TOKEN" \
-H "x-org-id: $ALERTS_ORG_ID"
Do not put tokens or destination URLs in committed files or shared logs. URL-encode IDs used in route segments and preserve their case.
Swagger UI and OpenAPI
The Alerts service hosts Swagger UI at /api-docs/ and its OpenAPI 3.1 document at /api-docs/openapi.json. For a service hosted at https://alerts.example.com, the URLs are https://alerts.example.com/api-docs/ and https://alerts.example.com/api-docs/openapi.json. Replace the example hostname with your assigned host. These paths are outside /api/v1; do not append them to the API base. Ask your administrator for the documentation URL if these paths are unavailable.
The documentation endpoints are public. API operations still require authentication, organization membership, permissions, and enabled capabilities. To use Try it out, select Authorize, enter an accepted access token without the Bearer prefix, and supply x-org-id for the operation. Write operations change tenant configuration, and destination reveal operations return real credentials.
Use the served contract for the deployed version's operation schemas, parameters, permissions, and responses. This guide explains workflows and interpretation; it complements the machine-readable contract. The contract covers metrics enrollment as well as the other Alerts operations.
References
- Configuration: templates, rules, destinations, subscriptions, silences, and declarative apply.
- Rule Validation and Preview Endpoints: authoring checks and bounded historical observations.
- Alert Operations: active alerts, history, delivery details, and dismissal.
- Metrics Enrollment: status, setup, reconnect, notifications, and cleanup.
Errors and Availability
Errors use application/json with code (a string or number), message, and optional errors. For example, validation failures use code: validation_error. Preserve the HTTP status, response body, and relevant headers such as Retry-After when diagnosing a request; do not expect RFC 7807 type or detail fields.
| Status | Typical cause |
|---|---|
400 |
Invalid input or unsupported authoring shape |
401 |
Missing or invalid authentication |
403 |
Missing membership, permissions, or access |
404 |
Resource not found in the accessible scope |
409 |
Operation conflicts with state, including enrollment required or ineligible dismissal |
412 |
Stale hash on a guarded write |
429 |
Request admission limit; inspect Retry-After |
501 |
Preview capability unavailable for the requested source/history |
502 / 503 |
Upstream evidence, dependency, or temporary availability failure |
Where available, GET /capabilities reports access, capability state (enabled, paused, or unavailable), and permitted actions such as inspect, author, and cleanup. A known pause can still permit inspection and narrowly defined disable or delete operations. Use the reported permissions and availability to determine what the API allows.