Piloterr
Referencia de la 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).

Autorización

ApiKeyAuth
headerX-Api-Key<token>

Parámetros de ruta

id*string

The project's id

Length1 <= length

Cuerpo de la solicitud

application/json
  1. body
items*array<>

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

Itemsitems <= 20

Cuerpo de la respuesta

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
    }
  ]
}