Crear un destino de alertas

Usalo para sumar un teléfono o un webhook HTTPS que reciba tus alertas operativas. Después hay que verificarlo; si es un webhook, guardá el secreto de firma, que se muestra una sola vez.

POST
/alerts/destinations

Escritura · requiere el permiso accounts:write.

Enforces, para webhook:

  • tope de {@see self::WEBHOOK_DESTINATION_LIMIT} destinos por cuenta;
  • SsrfGuard::assertSafe() ANTES de persistir. Hasta este incremento el unico chequeo en el alta era str_starts_with($destination, 'https://'), y el guard corria solo en el boton de prueba manual: se podia guardar tranquilamente un destino apuntando a https://127.0.0.1/... o al endpoint de metadata de la nube, y quedaba ahi esperando a que el transporte de entrega lo usara;
  • verified_at en null. Un webhook NO se auto-verifica: hay que pasar por POST alerts/destinations/{id}/verify, que exige que el destino devuelva un challenge firmado (ver AlertWebhookVerificationController);
  • generacion del secreto de firma, devuelto en texto plano UNA sola vez en esta respuesta 201 y nunca mas.

Autorización

http
headerAuthorizationBearer <clave>

Cuerpo del pedido

application/json
  1. body
type*AlertDestinationType
Valor en"phone""webhook"
destination*string
Largolength <= 255
name?|
Largolength <= 120

Cuerpo de la respuesta

application/json
  1. response
curl -X POST "https://example.com/alerts/destinations" \  -H "Content-Type: application/json" \  -d '{    "type": "phone",    "destination": "string"  }'
{}