Documentation Index Fetch the complete documentation index at: https://mintlify.com/lamassuiot/lamassuiot/llms.txt
Use this file to discover all available pages before exploring further.
Get Latest Events
Retrieve the latest event per event type, including metadata about when the event was last seen and how many times it has occurred.
Response
Returns an array of latest events grouped by event type.
CloudEvent payload for the latest event
Timestamp when the event was last seen
Number of times this event type has occurred
Example Request
curl -X GET "https://api.lamassu.io/api/alerts/v1/events/latest" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Example Response
[
{
"event_type" : "certificate.issued" ,
"event" : {
"specversion" : "1.0" ,
"type" : "certificate.issued" ,
"source" : "ca-service" ,
"id" : "evt-123" ,
"time" : "2025-11-08T10:30:00Z" ,
"data" : {
"certificate_id" : "cert-789" ,
"ca_id" : "ca-1" ,
"subject" : "CN=device-001"
}
},
"seen_at" : "2025-11-08T10:30:00Z" ,
"counter" : 42
},
{
"event_type" : "device.enrolled" ,
"event" : {
"specversion" : "1.0" ,
"type" : "device.enrolled" ,
"source" : "dms-service" ,
"id" : "evt-456" ,
"time" : "2025-11-08T09:15:00Z" ,
"data" : {
"device_id" : "device-123" ,
"dms_id" : "dms-1"
}
},
"seen_at" : "2025-11-08T09:15:00Z" ,
"counter" : 15
}
]
List User Subscriptions
Retrieve all alert subscriptions for a specific user.
Response
Returns an array of subscription objects.
Event type this subscription monitors
Timestamp when subscription was created
Array of condition objects for filtering events Condition type: JSON-SCHEMA, JSON-PATH, or JAVASCRIPT
Notification channel configuration Channel type: EMAIL, MSTEAMS, or WEBHOOK
Human-readable channel name
Channel-specific configuration (email address, webhook URL, etc.)
Example Request
curl -X GET "https://api.lamassu.io/api/alerts/v1/user/user-123/subscriptions" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Example Response
[
{
"id" : "sub-789" ,
"user_id" : "user-123" ,
"event_type" : "certificate.revoked" ,
"subscription_ts" : "2025-11-01T10:00:00Z" ,
"conditions" : [
{
"type" : "JSON-PATH" ,
"condition" : "$.data.ca_id == 'root-ca-1'"
}
],
"channel" : {
"type" : "EMAIL" ,
"name" : "Security Alerts" ,
"config" : {
"email" : "admin@example.com"
}
}
},
{
"id" : "sub-456" ,
"user_id" : "user-123" ,
"event_type" : "device.enrolled" ,
"subscription_ts" : "2025-10-15T14:30:00Z" ,
"conditions" : [],
"channel" : {
"type" : "MSTEAMS" ,
"name" : "Operations Channel" ,
"config" : {
"webhook_url" : "https://outlook.office.com/webhook/..."
}
}
}
]
Subscribe to Event Type
Create a new alert subscription for a user.
Request Body
Event type to subscribe to (e.g., certificate.issued, device.enrolled, certificate.expiring)
Optional array of conditions to filter events Condition type: JSON-SCHEMA, JSON-PATH, or JAVASCRIPT
Condition expression as a string
Notification channel configuration Channel type: EMAIL, MSTEAMS, or WEBHOOK
Human-readable channel name
Channel-specific configuration Email address for notifications (required for EMAIL channel)
Microsoft Teams webhook URL (required for MSTEAMS channel)
Webhook endpoint URL (required for WEBHOOK channel)
HTTP method: GET, POST, PUT, PATCH, or DELETE (default: POST)
Response
Returns the updated list of all subscriptions for the user.
Example Request - Simple Email Subscription
curl -X POST "https://api.lamassu.io/api/alerts/v1/user/user-123/subscribe" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event_type": "certificate.expiring",
"channel": {
"type": "EMAIL",
"name": "Certificate Expiration Alerts",
"config": {
"email": "admin@example.com"
}
}
}'
Example Request - Conditional MS Teams Subscription
curl -X POST "https://api.lamassu.io/api/alerts/v1/user/user-123/subscribe" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event_type": "certificate.revoked",
"conditions": [
{
"type": "JSON-PATH",
"condition": "$.data.ca_id == '"'"'root-ca-1'"'"'"
}
],
"channel": {
"type": "MSTEAMS",
"name": "Critical Security Alerts",
"config": {
"webhook_url": "https://outlook.office.com/webhook/abc123..."
}
}
}'
Example Request - Webhook with JavaScript Filter
curl -X POST "https://api.lamassu.io/api/alerts/v1/user/user-123/subscribe" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event_type": "device.enrolled",
"conditions": [
{
"type": "JAVASCRIPT",
"condition": "event.data.tags && event.data.tags.includes('"'"'production'"'"') && event.data.metadata.region === '"'"'us-east-1'"'"'"
}
],
"channel": {
"type": "WEBHOOK",
"name": "Custom Integration",
"config": {
"webhook_url": "https://api.example.com/alerts/device-enrolled",
"webhook_method": "POST"
}
}
}'
Unsubscribe from Event
Remove an alert subscription.
Response
Returns the updated list of all subscriptions for the user.
Example Request
curl -X POST "https://api.lamassu.io/api/alerts/v1/user/user-123/unsubscribe/sub-789" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Condition Types Reference
JSON Schema
Validate event payload against a JSON Schema. The condition should be a JSON Schema object as a string.
Example : Only notify if severity is critical or high
{
"type" : "JSON-SCHEMA" ,
"condition" : "{ \" type \" : \" object \" , \" properties \" :{ \" severity \" :{ \" enum \" :[ \" critical \" , \" high \" ]}}}"
}
JSONPath
Use JSONPath expressions to filter events. The condition should evaluate to a boolean or match a value.
Example : Only notify for specific CA
{
"type" : "JSON-PATH" ,
"condition" : "$.data.ca_id == 'root-ca-1'"
}
Example : Only notify if count exceeds threshold
{
"type" : "JSON-PATH" ,
"condition" : "$.data.failed_attempts > 5"
}
JavaScript
Use JavaScript expressions for complex filtering logic. The event is available as the event variable.
Example : Multiple conditions
{
"type" : "JAVASCRIPT" ,
"condition" : "event.data.tags.includes('production') && event.data.severity === 'critical'"
}
Example : Time-based filtering
{
"type" : "JAVASCRIPT" ,
"condition" : "new Date(event.time).getHours() >= 9 && new Date(event.time).getHours() <= 17"
}
Channel Configuration Examples
Email Channel
{
"type" : "EMAIL" ,
"name" : "Admin Notifications" ,
"config" : {
"email" : "admin@example.com"
}
}
Microsoft Teams Channel
Create an Incoming Webhook in your Teams channel
Copy the webhook URL
Configure the channel:
{
"type" : "MSTEAMS" ,
"name" : "Security Team Channel" ,
"config" : {
"webhook_url" : "https://outlook.office.com/webhook/abc-123-def-456/IncomingWebhook/xyz-789/uuid"
}
}
Webhook Channel (POST)
{
"type" : "WEBHOOK" ,
"name" : "Custom API Integration" ,
"config" : {
"webhook_url" : "https://api.example.com/alerts" ,
"webhook_method" : "POST"
}
}
Webhook Channel (GET)
{
"type" : "WEBHOOK" ,
"name" : "Trigger External System" ,
"config" : {
"webhook_url" : "https://api.example.com/trigger?event={event_type}" ,
"webhook_method" : "GET"
}
}
Best Practices
Use Conditions to Reduce Noise
Instead of receiving notifications for every event, use conditions to filter only critical or relevant events. This prevents alert fatigue and ensures important notifications don’t get missed.
Test Subscriptions with Non-Critical Events
Before subscribing to critical events, test your channel configuration with less critical event types to ensure notifications are delivered correctly.
Email : Good for alerts that can be handled asynchronously
MS Teams : Best for team notifications and collaboration
Webhooks : Ideal for automated responses and integrations
Monitor Subscription Health
Regularly review your subscriptions to ensure they’re still relevant and that channel configurations (webhook URLs, email addresses) are up to date.
Combine Multiple Conditions
Use JavaScript conditions to combine multiple filters for precise control over which events trigger notifications.