errors.alert-rules.createCreate an alert rule
Request syntax
POST /errors/api/projects/{id}/alert-rules
{
"name": "string",
"enabled": "boolean",
"trigger": "object",
"filters": "object",
"actions": "array of json",
"throttleMinutes": "number"
}Path parameters
idRequiredstring
Constraints: uuid
Request body
nameRequiredstring
Name of the rule, 1–120 characters (surrounding spaces trimmed)
Constraints: 1-120 chars
enabledOptionalboolean
Whether the rule is evaluated; default true. false keeps it without firing
Default:
truetriggerRequiredobject
When the rule fires, by kind: {kind: "issue", events: ["new" | "regression" | "escalating", …]} (at least one); {kind: "frequency", events, windowMinutes} (an issue’s events in the window reach events, 1–10 000 000, window 1–1440 minutes); {kind: "users", users, windowMinutes} (an issue’s distinct users reach users); {kind: "crash_free", belowPercent, minSessions?} (a release’s crash-free sessions over the last hour fall below belowPercent, 1–99.99, with at least minSessions sessions, default 100); {kind: "dropped", events?, windowHours?, outcomes?} (what the project sent that was refused or lost after acceptance reaches events, 1–10 000 000, default 1, within the current hour and the windowHours − 1 before it, 1–24, default 1; outcomes "refused" and/or "lost", default both; the SDK’s own drops and profile milliseconds never count; filters do not apply)
Constraints: JSON
filtersOptionalobject
Which issues the rule applies to; every filter given must match, an empty one matches all (none given on create: all empty): levels (fatal, error, warning, info, debug), environments (up to 20), tags (up to 10 {key, value}, matched against the issue’s latest event), titleContains (up to 200 characters)
Constraints: JSON
Default:
{"levels":[],"environments":[],"tags":[]}actionsRequiredarray of json
What the rule does, 1–10 actions: {kind: "email", admins?, addresses?} (admins, default true, mails the organization’s owners and admins; up to 20 further addresses) or {kind: "webhook", url, format?} (an https URL, else 400; format auto (default, chosen by the URL’s host: Slack, Teams, Discord, else JSON), slack, teams, discord or json)
throttleMinutesOptionalnumber
Quiet period: the rule fires at most once per issue (or release) within it. 1–10 080 minutes (a week), default 30
Constraints: integer, 1-10080
Default:
30
Response
201 with the rule as `list` describes it, defaults filled in. 404 when the project does not exist.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow errors:PutAlertRule on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud errors alert-rules create id --name example --trigger '{}' --actions '["example"]'curl -X POST "https://console.platform.deutschecloud.app/errors/api/projects/id/alert-rules" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"example","trigger":{},"actions":["example"]}'Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_errors_alert-rules_create.