Piloterr
Référence de l'APIAlerts

Set a project's alert subscriptions

PUT
/v1/projects/{id}/alerts

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).

Authentification

ApiKeyAuth
headerX-Api-Key<token>

Paramètres de chemin

id*string

The project's id

Length1 <= length

Corps de la requête

application/json
  1. body
items*array<>

The project's subscriptions, at most 20, one per channel; they replace the current ones

Itemsitems <= 20

Corps de la réponse

Saved

application/json
  1. response
items*array<>
Example Request
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
    }
  ]
}