Webhooks Integration
Laritor supports custom webhook integrations to deliver alert data to any external system or service that accepts POST requests. This is ideal for routing alerts to your own APIs, internal tools, or third-party platforms not natively integrated with Laritor.
🔧 How to Use Webhooks with Alerts
Section titled “🔧 How to Use Webhooks with Alerts”-
Go to Alerts
- Click on Alerts in the left navigation menu.
- Click the Create Alert button.
-
Enable Webhook Channel
- On the alert creation form, toggle the Webhooks option under “Notification Channels.”
-
Enter Your Webhook URL
- A field will appear prompting you to enter a valid webhook URL.
- Paste your target webhook URL (must support HTTP POST).
-
Save the Alert
- Once saved, Laritor will send a webhook request whenever this alert is triggered.
🔄 How Laritor Sends Webhooks
Section titled “🔄 How Laritor Sends Webhooks”- Method:
POST
- Content-Type:
application/json
- User-Agent:
laritor-bot
- Payload Format:
JSON
(see below)
📦 Payload Structure
Section titled “📦 Payload Structure”The payload includes metadata about the alert, application, and environment. If the alert is triggered by an
exceptions resource, an exceptions
array is also included.
Payload Schema
Section titled “Payload Schema”{ "application_id": "application id", "application": "application name", "environment_id": "environment id", "environment": "environment name", "alert_id": "alert id", "alert": "alert name", "resource": "resource name (e.g. requests, queries, jobs, exceptions, etc.)", "criteria": "alert trigger criteria (e.g. Avg Request Duration ≥ 500ms for 5 Minutes)", "value": "triggered value (e.g. 625)", "exceptions": [ { "id": "exception id", "message": "exception message", "file": "file name", "line": "line number", "total": "total occurrences" } ]}
ℹ️ Note: The exceptions field is only included when the resource is exceptions.
🧪 Example Payloads
Section titled “🧪 Example Payloads”Non-exception Alert
Section titled “Non-exception Alert”{ "application_id": "1", "application": "Weather API", "environment_id": "1", "environment": "production", "alert_id": "1", "alert": "High API Failure Rate", "resource": "requests", "criteria": "When Total Requests with 5xx status code is Greater Than or Equal To 10 for 1 Minute", "value": "17"}
Exception Alert
Section titled “Exception Alert”{ "application_id": "1", "application": "Weather API", "environment_id": "1", "environment": "production", "alert_id": "1", "alert": "High Exception Rate", "resource": "exceptions", "criteria": "When Total Exceptions is Greater Than or Equal To 3 for 5 Minutes", "value": "54", "exceptions": [ { "id": "1", "message": "Call to undefined function", "file": "/var/www/app/Handlers/ErrorHandler.php", "line": "78", "total": "54" } ]}
💡 Use Cases
Section titled “💡 Use Cases”- Integrate with PagerDuty or your custom incident system
- Log alerts to your internal analytics platform
- Trigger CI/CD pipelines, feature flags, or rollback tools
- Feed alerts into dashboards or custom UI components