---
title: "Set webhook URL"
method: PUT
path: "/alerts-api/webhooks"
tags: ["alerts-api---webhooks"]
---

# Set webhook URL

`PUT /alerts-api/webhooks`

## Request

- Base URL: `https://api.casafari.com`
- URL: `https://api.casafari.com/alerts-api/webhooks`
- Auth: HTTP bearer

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

## Request body

- AlertsApiSetWebhookRequestSchema
  - `url` string, uri, required

## Response `200`

Successful Response

- AlertsApiSetWebhookResponseSchema
  - `url` string, required
  - `secret` string, nullable, required

## Other responses

- `400`: Webhook URL verification failed.
- `422`: Validation Error

---

[API](https://skmtc.dev/casafari/apis/casafari-api.md) · [All operations](https://skmtc.dev/casafari/apis/casafari-api/llms.txt) · [OpenAPI document](https://skmtc.dev/casafari/apis/casafari-api/revisions/6743b99d4bf9?raw)
