Send UniFi Protect Alerts to Web Services using Webhooks
UniFi Protect custom webhooks make it easy to connect UniFi Protect with other web services. They allow you to automatically respond to alerts, improve monitoring, and scale effortlessly. With webhooks, you can quickly act on important alerts, reduce manual work, and enhance your security and efficiency.
For details on using webhooks with Slack, read our article here.
Steps to Create a Custom Webhook in UniFi Protect
- Open UniFi Protect and go to the Alarm Manager section.
- Select an existing alarm or create a new one to open the Edit Alarms panel.
- In the Edit Alarms panel, you can:
- Set the alarm name.
- Edit the trigger settings, including selecting the devices (cameras & sensors) that will trigger alarms and setting an optional schedule.
- Scroll to the Action settings.
- Add an action and select Webhook from the dropdown menu.
- Choose Custom Webhook.
- Enter the Webhook Services URL.
- Click Save.
Advanced Settings
By default, the webhook will create an HTTP GET request each time an alarm is triggered.
For advanced cases, use the Advanced Settings:
- HTTP GET allows custom headers for security tokens or other additional information.
-
HTTP POST delivers additional information about the alarm to your service.
- Here is an example of the HTTP POST structure:
{
"alarm": {
"name": "test post",
"sources": [],
"conditions": [
{
"condition": {
"type": "is",
"source": "motion"
}
}
],
"triggers": [
{
"key": "motion",
"device": "74ACB99F4E24"
}
]
},
"timestamp": 1722526793954
}
- Here is an example of the HTTP POST structure: