GET /bgp/history/scenario

Replay payload for a single prefix over a time window, reconstructed from the bitemporal best-path/peer history (bgp_best_path_history, bgp_peer_history). Backs the BGP change-animation replay panel. Shaped like the RIPEstat bgplay data call: the state open at from, plus the ordered transitions within the window.

Auth: all authenticated roles

Query params:

Param Type Required Description
as_id UUID Yes Autonomous-system scope
prefix CIDR Yes The prefix to replay (guided-attention surface — a prefix is mandatory; use /bgp/history/bins for an AS-wide overview)
from, to RFC 3339 Yes Window bounds; from must be strictly before to
match string No exact (default) or covering (prefix >>= $)
routing_domain_id UUID No Restrict to one routing domain
device_id UUID No Restrict to one selecting device's perspective
cap int No Max events (default 5000, max 20000); when hit, truncated=true

Response: 200 OK

{
  "initial_state": [ { "prefix": "10.0.0.0/24", "device_id": "…", "next_hop": "198.51.100.1", "as_path": "65001 65002", "…": "…" } ],
  "events": [
    { "type": "announce", "event_time": "2026-07-01T10:00:00Z", "prefix": "10.0.0.0/24", "device_id": "…", "origin": "change", "new": { "next_hop": "198.51.100.1", "…": "…" } },
    { "type": "change",   "event_time": "2026-07-01T10:05:00Z", "prefix": "10.0.0.0/24", "device_id": "…", "origin": "change", "new": { "next_hop": "198.51.100.2" }, "old": { "next_hop": "198.51.100.1" } },
    { "type": "withdraw", "event_time": "2026-07-01T10:10:00Z", "prefix": "10.0.0.0/24", "device_id": "…", "origin": "change", "old": { "next_hop": "198.51.100.2" } }
  ],
  "peer_events": [ { "event_time": "…", "device_id": "…", "peer_ip": "198.51.100.1", "address_family": "ipv4", "peer_as": 65002, "peer_type": "ebgp", "state": "down", "origin": "change" } ],
  "truncated": false
}

Errors: 400 if as_id, prefix, or the window is missing/invalid.