Get Alert
Retrieve a specific alert by ID.
Endpoint
Retrieves a single alert with its complete configuration including conditions and notification settings.
Authentication
Requires any valid API Key. All keys have read access.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id |
UUID | Alert ID |
Response
Returns the complete alert object:
Response Format
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "High-Volume PII Detection",
"description": "Alert when >10 PII detections in 5 minutes",
"enable": true,
"notificationTypes": ["email", "slack"],
"emailRecipients": ["security@company.com"],
"slackChannels": ["channel-uuid"],
"thresholdTime": "5",
"thresholdType": "minutes",
"conditions": [
{
"type": "detected",
"values": ["true"],
"isNot": false
}
],
"createdAt": 1704067200,
"updatedAt": 1704153600
}
Examples
Get Alert by ID
Retrieve a specific alert to view its configuration.
import requests
BASE_URL = "https://your-shield-host:8080"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
alert_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.get(f"{BASE_URL}/api/alerts/{alert_id}", headers=HEADERS)
alert = response.json()
print(f"Alert: {alert['name']}")
print(f"Enabled: {alert['enable']}")
print(f"Conditions: {len(alert['conditions'])}")
const axios = require('axios');
const BASE_URL = 'https://your-shield-host:8080';
const HEADERS = { 'Authorization': 'Bearer YOUR_API_KEY' };
const alertId = '550e8400-e29b-41d4-a716-446655440000';
const response = await axios.get(`${BASE_URL}/api/alerts/${alertId}`, { headers: HEADERS });
const alert = response.data;
console.log(`Alert: ${alert.name}`);
console.log(`Enabled: ${alert.enable}`);
console.log(`Conditions: ${alert.conditions.length}`);
Error Responses
| Status Code | Description |
|---|---|
401 |
Invalid or expired API key |
404 |
Alert not found |
Related Topics
- List Alerts - Query all alerts
- Update Alert - Modify this alert
- Delete Alert - Remove this alert
- Enable/Disable Alert - Control alert activation
- Alert Logs - View alert execution history