Set webhook URL
https://api.casafari.com/alerts-api/webhooksLegacy API (api.casafari.com). Una ruta de la API existente para clientes de Casafari con contrato, no de la plataforma. En la plataforma: todavía no hay ruta de plataforma.
En la Legacy API en https://api.casafari.com (clientes con contrato): envíe Authorization: Bearer $CASAFARI_TOKEN; consulte cómo obtener un token. Nuevos usuarios: la API REST de la plataforma, claves de API de plataforma.
Description
Sets (or replaces) the delivery URL for all your alert feeds.
Before saving, a GET request is sent to the URL — your server must respond with HTTP 200, otherwise this endpoint returns 400.
Alert deliveries themselves arrive as POST requests with a JSON array body.
The URL is stored per user: changing it here instantly affects every feed, including alerts already queued for delivery. Feeds cannot be created until the webhook is configured.
A signing secret is provisioned on the first call and returned in secret once; later calls return secret: null. Lost it? Use POST /webhooks/rotate-secret.
Cuerpo de la solicitud
Tipo de contenido application/json. Obligatorio. Tipo: object.
urlstring (uri)obligatorioEjemplo de solicitud
Solo marcadores de posición: reemplace el token y los valores por los suyos.
curl -X PUT "https://api.casafari.com/alerts-api/webhooks" \
-H "Authorization: Bearer $CASAFARI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "<url>"
}'Respuestas
200 Respuesta correcta
Tipo: object.
Mostrar la estructura de la respuesta (2 campos)
urlstringobligatoriosecretstringobligatorio400 Webhook URL verification failed.
Tipo: object.
Mostrar la estructura de la respuesta (1 campo)
detailstringobligatorioEjemplo de la descripción de la API
{
"detail": "Webhook URL verification failed: Expected HTTP 200, got 404."
}422 Error de validación
Tipo: object.
Mostrar la estructura de respuesta (6 campos)
detailobject[]5 propiedades
loc(string | integer)[]obligatoriomsgstringobligatoriotypestringobligatorioinputanyctxobject