Webhook Format
bgp.tools has different ways to deliver webhooks. Here are some example payloads for each type
This format is the most basic, it puts the message body as a text/plain. You can replicate it using:
curl http://path/to/your?webhook=endpoint -X POST -H 'Content-Type: text/plain' -d 'Test Notification'
This format uses “application/json” as it’s content type, and wraps a number of parts of data, and includes a extra (unstable) data section where the contents change per alert.
{
"message": "This is a test to confirm that a bgp.tools communications endpoint for AS212232 is working!\n\nNot expecting this, or want to prevent more notifications? You can disable this now at https://bgp.tools/email/opt-out/xxxx",
"AlertType": "message",
"UnstableData": {
"ASN": "212232",
"Endpoint": "41d11226-2f15-4e5b-8167-fea86abfe2d2",
"OptOutUUID": "xxxx"
}
}
This format uses “application/json” as it’s content type, and wraps a number of parts of data, and attempts to be as compatible with librenms’s webhooks as possible
{
"AlarmPolicyName": "message",
"AlertPolicyName": "message",
"Description": "This is a test to confirm that a bgp.tools communications endpoint for AS212232 is working!\n\nNot expecting this, or want to prevent more notifications? You can disable this now at https://bgp.tools/email/opt-out/xxx",
"EventType": "alarm",
"IsActive": true,
"Links": {
"DashboardAlarmURL": "https://bgp.tools/authed/manage-alerts",
"DetailsAlarmURL": "https://bgp.tools/authed/manage-alerts?detail=082577ff-c040-4d70-9597-644c22fe1f14"
},
"StartTime": "2024-05-29 17:31:31 +00:00",
"Type": "alarm"
}
This format uses “application/json” as it’s content type, and wraps a number of parts of data, and attempts to be as compatible with kentik’s webhooks as possible
{
"ALERT_EMOJI": "",
"ALERT_EMOJI_NAME": "",
"ALERT_ID": "",
"ALERT_MESSAGE": "This is a test to confirm that a bgp.tools communications endpoint for AS212232 is working!\n\nNot expecting this, or want to prevent more notifications? You can disable this now at https://bgp.tools/email/opt-out/xxx",
"ALERT_SEVERITY": "Minor",
"ALERT_STATE": "FIRING",
"ALERT_STATUS": "1",
"ALERT_TIMESTAMP": "2024-05-29 17:31:16 +00:00",
"ALERT_TIMESTAMP_RFC2822": "Wed, 29 May 2024 17:31:16 +0000",
"ALERT_TIMESTAMP_RFC3339": "2024-05-29T17:31:16Z",
"ALERT_UNIXTIME": 1717003876,
"ALERT_URL": "https://bgp.tools/authed/manage-alerts?detail=082577ff-c040-4d70-9597-644c22fe1f14",
"TITLE": "This is a test to confirm that a bgp.tools communications endpoint for AS212232 is working!\n\nNot expecting this, or want to prevent more notifications? You can disable this now at https://bgp.tools/email/opt-out/xxx"
}
Much like the bgp.tools v1 format, except to make it easier to inject in platforms like Splunk, everything is wrapped in a “event” object.
{
"event": {
"message": "This is a test to confirm that a bgp.tools communications endpoint for AS212232 is working!\n\nNot expecting this, or want to prevent more notifications? You can disable this now at https://bgp.tools/email/opt-out/xxxx",
"AlertType": "message",
"UnstableData": {
"ASN": "212232",
"Endpoint": "41d11226-2f15-4e5b-8167-fea86abfe2d2",
"OptOutUUID": "xxxx"
}
}
}