Monitors API
Set up continuous monitoring for browser extensions and receive alerts via webhooks.
The Monitors API allows you to set up continuous monitoring for browser extensions. Receive alerts when extensions update, change permissions, or exhibit suspicious behavior.
Overview
Extension monitors track:
- Version updates
- Permission changes
- Manifest modifications
- Status changes (active/obsolete)
- Publisher updates
List Monitors
Retrieve all monitors for your account.
GET /api/v1/monitors
Example Request
curl -X GET "https://extensionauditor.com/api/v1/monitors" \ -H "Cookie: session=your_session_cookie"
Example Response
{
"success": true,
"data": {
"monitors": [
{
"id": "monitor-uuid-1",
"account_id": "account-uuid",
"extension_id": "blemhmgimpnomifkjoinlelbmgoljddm",
"enabled": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "monitor-uuid-2",
"account_id": "account-uuid",
"extension_id": "abcdefghijklmnopqrstuvwxyz123456",
"enabled": false,
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-12T14:30:00Z"
}
]
}
}
Create Monitor
Create a new extension monitor.
POST /api/v1/monitors
Request Body
{
"extension_id": "blemhmgimpnomifkjoinlelbmgoljddm",
"enabled": true
}
| Field | Type | Default | Description |
|---|---|---|---|
extension_id | string | required | Extension ID to monitor |
enabled | boolean | true | Whether monitor is active |
Example Request
curl -X POST "https://extensionauditor.com/api/v1/monitors" \
-H "Cookie: session=your_session_cookie" \
-H "Content-Type: application/json" \
-d '{"extension_id": "blemhmgimpnomifkjoinlelbmgoljddm", "enabled": true}'
Example Response
{
"success": true,
"data": {
"monitor": {
"id": "new-monitor-uuid",
"account_id": "account-uuid",
"extension_id": "blemhmgimpnomifkjoinlelbmgoljddm",
"enabled": true,
"created_at": "2024-01-20T12:00:00Z",
"updated_at": "2024-01-20T12:00:00Z"
}
}
}
Error: Monitor Already Exists
{
"success": false,
"error": "A monitor already exists for this extension"
}
Get Monitor
Retrieve a specific monitor by ID.
GET /api/v1/monitors/{monitorId}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
monitorId | string (UUID) | Monitor identifier |
Example Request
curl -X GET "https://extensionauditor.com/api/v1/monitors/monitor-uuid" \ -H "Cookie: session=your_session_cookie"
Update Monitor
Update monitor settings.
PATCH /api/v1/monitors/{monitorId}
Request Body
{
"enabled": false
}
Delete Monitor
Delete a monitor.
DELETE /api/v1/monitors/{monitorId}
Example Request
curl -X DELETE "https://extensionauditor.com/api/v1/monitors/monitor-uuid" \ -H "Cookie: session=your_session_cookie"
Webhooks
Configure webhook destinations to receive alerts when monitored extensions change.
List Webhooks
GET /api/v1/monitors/{monitorId}/webhooks
Create Webhook
POST /api/v1/monitors/{monitorId}/webhooks
Request Body
{
"url": "https://your-server.com/webhook/extension-alerts",
"events": ["version_update", "permission_change", "status_change"],
"secret": "your-webhook-secret"
}
| Field | Type | Description |
|---|---|---|
url | string | Webhook endpoint URL |
events | array | Event types to receive |
secret | string | Secret for HMAC signature verification |
Event Types
| Event | Description |
|---|---|
version_update | Extension version changed |
permission_change | Permissions added or removed |
manifest_change | Manifest file modified |
status_change | Extension status changed (active/obsolete) |
security_alert | Security issue detected |
Webhook Payload
{
"event": "permission_change",
"timestamp": "2024-01-20T12:00:00Z",
"monitor_id": "monitor-uuid",
"extension_id": "blemhmgimpnomifkjoinlelbmgoljddm",
"data": {
"extension_name": "Example Extension",
"previous_version": "1.0.0",
"new_version": "1.1.0",
"permissions_added": ["tabs", "history"],
"permissions_removed": [],
"risk_level_change": {
"from": "low",
"to": "medium"
}
}
}
Webhook Signature
Webhooks include an HMAC-SHA256 signature for verification:
X-Signature: sha256=<hmac_signature>
Verify the signature:
import hmac
import hashlib
def verify_signature(payload, signature, secret):
expected = 'sha256=' + hmac.new(
secret.encode(),
payload.encode(),
hashlib.sha256
).hexdigest()
return hmac.compare_digest(signature, expected)
Delete Webhook
DELETE /api/v1/monitors/{monitorId}/webhooks/{webhookId}
Monitor Events
Query historical events for a monitor.
GET /api/v1/monitors/{monitorId}/events
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number |
page_size | integer | Items per page |
event_type | string | Filter by event type |
start_date | string | Start date (ISO 8601) |
end_date | string | End date (ISO 8601) |
Example Response
{
"success": true,
"result": [
{
"id": "event-uuid",
"monitor_id": "monitor-uuid",
"event_type": "version_update",
"extension_id": "blemhmgimpnomifkjoinlelbmgoljddm",
"details": {
"from_version": "1.0.0",
"to_version": "1.1.0"
},
"created_at": "2024-01-20T12:00:00Z"
}
],
"page": 1,
"page_size": 25,
"total_count": 15,
"total_pages": 1
}
Detect Changes
Manually trigger change detection for a monitor.
POST /api/v1/monitors/{monitorId}/detect
This endpoint checks for changes immediately rather than waiting for the scheduled check.
Use Cases
Monitor Critical Business Extensions
# Create monitors for critical extensions
curl -X POST "https://extensionauditor.com/api/v1/monitors" \
-H "Cookie: session=your_session_cookie" \
-H "Content-Type: application/json" \
-d '{"extension_id": "your-critical-extension-id"}'
# Set up webhook for alerts
curl -X POST "https://extensionauditor.com/api/v1/monitors/{monitorId}/webhooks" \
-H "Cookie: session=your_session_cookie" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-siem.com/webhook",
"events": ["permission_change", "security_alert"],
"secret": "your-secret"
}'
Integrate with Slack
Configure a webhook to post to Slack when extensions change:
{
"url": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
"events": ["version_update", "permission_change"]
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Invalid request parameters |
| 401 | Authentication required |
| 404 | Monitor not found |
| 409 | Monitor already exists |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Next Steps
- Extensions API - Query extension data
- PermHash API - Analyze permission patterns
- Risk Engine - Security analysis
