Skip to content

BGP monitoring ​

Manage the resources (ASes and prefixes) monitored by PacketVis for your organization.

Getting started ​

  1. Generate an API key (see Authentication).
  2. Build the request URL. Replace YOUR_API_KEY in the examples with your API key.

The POST, PUT, and DELETE endpoints require an API key with write access.

List monitored resources ​

GEThttps://api.packetvis.com/v1/bgp/resources/?key=YOUR_API_KEY

Returns all the ASes and prefixes monitored by your organization.

Parameters ​

NameDescriptionDefault
keyThe API key.

Response ​

200 OK

json
{
  "data": [
    {
      "asn": 64496,
      "excludeMonitors": [],
      "active": true,
      "monitorDownstreams": true,
      "monitorUpstreams": true,
      "downstreams": [],
      "upstreams": [],
      "suspensionReasons": [],
      "createdAt": "2025-01-10T09:12:41.981Z",
      "updatedAt": "2025-01-10T09:12:41.981Z"
    },
    {
      "prefix": "203.0.113.0/24",
      "asn": [64496],
      "description": "web service",
      "ignoreMorespecifics": false,
      "ignore": false,
      "excludeMonitors": [],
      "active": true,
      "suspensionReasons": [],
      "visible": true,
      "lastVisibilityCheck": "2025-01-10T10:00:00.000Z",
      "createdAt": "2025-01-10T09:12:42.101Z",
      "updatedAt": "2025-01-10T10:00:00.000Z"
    }
  ],
  "metadata": {}
}

Each item is either an AS or a prefix. Prefix items include the prefix field.

Prefix fields

FieldTypeDescription
prefixstringThe monitored prefix (CIDR).
asninteger[]The list of expected origin ASes.
descriptionstringA free-text description.
ignorebooleanWhether the prefix is ignored (no alerts are generated).
ignoreMorespecificsbooleanWhether more-specific prefixes are ignored.
visiblebooleanWhether the prefix is currently visible in the global routing table.
lastVisibilityCheckstring (ISO 8601)When the visibility was last checked.
excludeMonitorsstring[]The list of monitors excluded from the monitoring of this resource. See List available monitors.
activebooleanWhether the monitoring is active.
suspensionReasonsstring[]The reasons why the monitoring is suspended, if any.
createdAtstring (ISO 8601)When the resource was created.
updatedAtstring (ISO 8601)When the resource was last updated.

AS fields

FieldTypeDescription
asnintegerThe AS number.
downstreamsinteger[]The expected downstream ASes.
upstreamsinteger[]The expected upstream ASes.
monitorDownstreamsbooleanWhether the addition/removal of downstreams is monitored.
monitorUpstreamsbooleanWhether the addition/removal of upstreams is monitored.
excludeMonitorsstring[]The list of monitors excluded from the monitoring of this resource. See List available monitors.
activebooleanWhether the monitoring is active.
suspensionReasonsstring[]The reasons why the monitoring is suspended, if any.
createdAtstring (ISO 8601)When the resource was created.
updatedAtstring (ISO 8601)When the resource was last updated.

The response is cached for up to 30 seconds.

Monitor a new Autonomous System ​

POSThttps://api.packetvis.com/v1/bgp/resources/?key=YOUR_API_KEY

Starts monitoring a new AS.

Parameters ​

NameDescriptionDefault
keyThe API key. It must have write access.

Request body ​

json
{
  "asn": 64496,
  "name": "Example Network",
  "tag": "isp"
}
FieldTypeRequiredDescription
asnintegeryesThe AS number.
namestringyesA name for the AS.
tagstringyesA tag for the AS. Possible tags are: tier1, tier2, isp, cdn, content, hosting, rir, nren, ixp, university, enterprise, government, personal

PacketVis schedules the monitoring of the AS and generates its prefixes asynchronously.

The request fails if the AS is already monitored. To edit an already monitored AS, use PUT.

Response ​

200 OK

The data object contains the saved resource, with the fields described in List monitored resources.

Edit resources ​

PUThttps://api.packetvis.com/v1/bgp/resources/?key=YOUR_API_KEY

Edits an AS already monitored, and adds or edits prefixes. The request body describes a single resource. If the body contains prefix, the resource is a prefix, otherwise it is an AS. For existing resources, only the fields you send are changed.

Parameters ​

NameDescriptionDefault
keyThe API key. It must have write access.

Request body ​

To add or edit a prefix:

json
{
  "prefix": "203.0.113.0/24",
  "asn": [64496],
  "description": "web service",
  "ignoreMorespecifics": false,
  "ignore": false,
  "excludeMonitors": []
}
FieldTypeRequiredDescription
prefixstringyesThe prefix (CIDR).
asninteger[]yesThe list of expected origin ASes.
descriptionstringnoA free-text description.
ignorebooleannoWhether the prefix is ignored (no alerts are generated).
ignoreMorespecificsbooleannoWhether more-specific prefixes are ignored.
excludeMonitorsstring[]noThe list of monitors excluded from the monitoring of this prefix. Allowed values: the prefix monitors in List available monitors.

To edit an AS:

json
{
    "asn": 64496,
    "downstreams": [
        64500
    ],
    "upstreams": [
        64510
    ],
    "monitorDownstreams": true,
    "monitorUpstreams": true,
    "excludeMonitors": []
}
FieldTypeRequiredDescription
asnintegeryesThe AS number.
downstreamsinteger[]noThe expected downstream ASes.
upstreamsinteger[]noThe expected upstream ASes.
monitorDownstreamsbooleannoWhether the downstreams are monitored.
monitorUpstreamsbooleannoWhether the upstreams are monitored.
excludeMonitorsstring[]noThe list of monitors excluded from the monitoring of this AS. Allowed values: the asn monitors in List available monitors.

Notes:

  • Fields that are managed by PacketVis (active, suspensionReasons, visible, lastVisibilityCheck, createdAt, updatedAt) are ignored if sent.
  • Unknown fields, and fields of the wrong resource type (e.g., ignore on an AS), are rejected.
  • Editing an AS fails if the AS is not already monitored: use POST to start monitoring it.

Response ​

200 OK

json
{
    "data": {
        "prefix": "203.0.113.0/24",
        "asn": [
            64496
        ],
        "description": "web service",
        "ignoreMorespecifics": false,
        "ignore": false,
        "excludeMonitors": [],
        "active": true,
        "suspensionReasons": [],
        "createdAt": "2025-01-10T09:12:42.101Z"
    },
    "metadata": {}
}

The data object contains the saved resource, with the fields described in List monitored resources.

Delete a resource ​

DELETEhttps://api.packetvis.com/v1/bgp/resources/64496?key=YOUR_API_KEY
DELETEhttps://api.packetvis.com/v1/bgp/resources/203.0.113.0/24?key=YOUR_API_KEY

Stops monitoring an AS or a prefix. Deleting an AS also deletes all the prefixes associated with it.

Parameters ​

NameInDescriptionDefault
keyqueryThe API key. It must have write access.

Response ​

200 OK

json
{
  "data": {
    "deleted": true
  },
  "metadata": {}
}

List available monitors ​

GEThttps://api.packetvis.com/v1/bgp/monitors/?key=YOUR_API_KEY

Returns the monitors available for each resource type. The names returned are the ones that can be used in the excludeMonitors array of an AS or of a prefix.

Parameters ​

NameDescriptionDefault
keyThe API key.

Response ​

200 OK

json
{
  "data": {
    "asn": [
      "neighbors",
      "misconfiguration",
      "rpki-invalid",
      "rpki-unknown",
      "roa-diff",
      "roa-expire",
      "bogons",
      "upstreams-visibility",
      "upstreams-availability"
    ],
    "prefix": [
      "visibility",
      "hijack",
      "newprefix",
      "rpki-invalid",
      "rpki-unknown",
      "roa-expire"
    ]
  },
  "metadata": {}
}
FieldTypeDescription
asnstring[]The monitors available for ASes.
prefixstring[]The monitors available for prefixes.

Get the alerts ​

PacketVis does not have a BGP-specific alerts endpoint. All the services, BGP monitoring included, deliver their alerts through the generic notifications endpoint:

GEThttps://api.packetvis.com/v1/notifications/?key=YOUR_API_KEY

To receive only the notifications produced by the BGP monitoring, filter by service using services=bgp:

GEThttps://api.packetvis.com/v1/notifications/?services=bgp&key=YOUR_API_KEY

You can further narrow the results with the types parameter (e.g., types=hijack). The BGP notification types, the other parameters, and the response format are described in the Notifications documentation.

Also, read about interactive monitoring and integrations