API Reference

Automains provides a robust REST API for managing Anycast routing policies, BGP sessions, and telemetry streams programmatically.

Authentication

All API requests must be authenticated via a Bearer token in the Authorization header.

# Example HTTP Header Authorization: Bearer am_live_83hf9283hfn2938fhn23

BGP Announcements

Dynamically announce or withdraw a /24 prefix from specific POPs to shape traffic.

// POST /v1/routing/bgp/announce { "prefix": "198.51.100.0/24", "action": "announce", "communities": ["65000:100", "65000:200"], "pops": ["FRA", "AMS", "LHR"] }

Webhooks

Subscribe to webhook events to receive immediate notifications when DDoS mitigation rules are triggered.

// Payload: ddos.mitigation.started { "event_id": "evt_983247293", "type": "ddos.mitigation.started", "target_ip": "198.51.100.5", "peak_bandwidth_gbps": 45.2 }