API-ReferenzAlerts
Set a project's alert subscriptions
PUT
Replaces them all, one item per channel (an empty list removes them). error_rate_pct (default 10) applies to run.error_rate_exceeded, max_duration_min to run.slow. A channel that is not the workspace's, or one given twice, is refused (422 validation_failed, error.details[].path such as items.0.channel_id).
ApiKeyAuthheader
X-Api-Key<token>id*stringThe project's id
Length
1 <= lengthapplication/json- body
items*array<>The project's subscriptions, at most 20, one per channel; they replace the current ones
Items
items <= 20Saved
application/json- response
items*array<>curl -X PUT 'https://dataflow.piloterr.com/v1/projects/string/alerts' \
-H 'Content-Type: application/json' \
-d '{
"items": [
{
"channel_id": "cm4kq2d5e000cl208m7va4jzh",
"events": [
"run.failed",
"run.completed",
"run.error_rate_exceeded"
],
"error_rate_pct": 20,
"max_duration_min": null
}
]
}'Example Response
{
"items": [
{
"channel_id": "cm4kq2d5e000cl208m7va4jzh",
"events": [
"run.failed",
"run.completed",
"run.error_rate_exceeded"
],
"error_rate_pct": 20,
"max_duration_min": null
}
]
}