BGP API
Submit ASNs and create or delete BGP sessions. In Flux, see BGP and Servers → BGP.
All endpoints require Bearer-token authentication.
GET /bgp
The response contains:
asn: every ASN on the account, whatever its state, with IRR information,status,rejected_reasonandauth_token. An ASN waiting for verification hasstatuspending.prefix_lists: the IPv4 and IPv6 prefix lists.sessions: configured BGP sessions across all servers.
curl https://api.gigahost.no/api/v0/bgp \
-H "Authorization: Bearer $TOKEN"POST /bgp/asn
Submit an ASN for approval. Maximum 5 ASNs per customer.
The body is form-encoded (application/x-www-form-urlencoded), not JSON.
| Field | Type | Description |
|---|---|---|
asn | number or string | 212345 or AS212345 (the AS prefix is optional). |
curl -X POST https://api.gigahost.no/api/v0/bgp/asn \
-H "Authorization: Bearer $TOKEN" \
-d 'asn=AS212345'Response:
{
"meta": {
"status": 200,
"status_message": "200 OK",
"message": "ASN and LOA has been submitted for review."
},
"data": {
"id": 42,
"asn": 212345,
"asn_name": "EXAMPLE-AS",
"asn_country": "NO",
"status": "pending",
"auth_token": "<40 hex characters>"
}
}Add auth_token to the aut-num object for the ASN at your RIR. The token is also emailed to the account's email address and returned in GET /bgp. Gigahost checks the token and approves the ASN manually; until then status stays pending.
The limit counts every ASN on the account, rejected ones included. Only support can remove an ASN.
Errors (400):
ASN is not validOnly five ASNs can be configured at a time. Contact support to remove an ASN first.The ASN already exists in the database.(the ASN is already on your account)
POST /bgp/{asn_id}/session
Create a BGP peering session for an approved ASN. {asn_id} is the ID from GET /bgp, not the AS number.
| Field | Type | Description |
|---|---|---|
redundant | number | 0 or 1. |
defaultroute | number | 0 (full table) or 1 (default route only). |
ip_id_v4 | number | Optional. IPv4 ID for the local endpoint. |
ip_id_v6 | number | Optional. IPv6 ID for the local endpoint. |
At least one of ip_id_v4 or ip_id_v6 must be provided.
curl -X POST https://api.gigahost.no/api/v0/bgp/42/session \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"redundant": 0,
"defaultroute": 0,
"ip_id_v4": 12345,
"ip_id_v6": 12346
}'DELETE /bgp/{session_id}/session
Mark a session for deletion. Deletion is processed asynchronously: the session enters a Deletion state and is removed from the router on the next pass.
curl -X DELETE https://api.gigahost.no/api/v0/bgp/9001/session \
-H "Authorization: Bearer $TOKEN"
