Skip to content

Allocate an IPv6 /48 or route a subnet

POST /api/v2/routed-ipv6

Add a routed IPv6 /48 to your account or route part of it to a VPS. action picks which.

Send action: "allocate_pool" to get the account’s /48. It works only while the account has none. Otherwise the call returns 409 routed_ipv6_pool_exists.

Send action: "create_route" with poolId, vpsId and prefixLength to route a /48, /56 or /64 to a VPS. Without prefix, Hostup picks the first free prefix of that length in the /48. A prefix you send must have that length and lie inside the /48. The VPS must be active with IPv6 turned on. Its main IPv6 address becomes the route’s next hop. Hostup also adds the prefix to the VPS anti-spoofing IP set. The VPS can then send traffic from addresses in the prefix. label is an optional name for the route, cut at 120 characters. The route reaches the network a short time after the response.

Both actions return 201 with the whole routed IPv6 state, as GET /api/v2/routed-ipv6 returns it.

Authentication: An API key with the scope write:network. About keys and scopes

Request

Body

actionstring
One of allocate_pool, create_route.
poolIdstring
The pool ID (ripv6_…). Required for create_route.
vpsIdstring
The VPS ID (vps_…) to route the prefix to. Required for create_route. The VPS must be one of the eligible destinations[].
prefixLengthinteger
Size of the prefix to route. Required for create_route. One of 48, 56, 64.
prefixstring
The exact prefix to route. Leave it out to get the first free prefix of that size.
labelstring
Your own label for the route.

Example

POST /api/v2/routed-ipv6
curl -X POST "https://cloud.hostup.se/api/v2/routed-ipv6" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "allocate_pool"
}'

Responses

201 The change is saved. Returns the whole routed IPv6 state with the new pool or route.

{
"available": true,
"reason": null,
"allowedPrefixLengths": [
48,
56,
64
],
"pools": [
{
"id": "ripv6_01hxa3b4c5d6e7f8g9h0j1k2m3",
"parentCidr": "2001:db8:1000::/48",
"prefixLength": 48,
"status": "active",
"allocatedAt": "2026-06-15T12:00:00.000Z",
"updatedAt": "2026-06-15T12:00:00.000Z",
"routes": [],
"actions": {
"canCreateRoute": {
"allowed": true,
"reason": null
},
"canRelease": {
"allowed": true,
"reason": null
}
}
}
],
"destinations": [
{
"vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m5",
"name": "web-01",
"hostname": "web-01.example.com",
"primaryIp": "192.0.2.10",
"nextHop": "2001:db8::10",
"serviceStatus": "active",
"actions": {
"canReceiveRoute": {
"allowed": true,
"reason": null
}
}
}
],
"actions": {
"canAllocatePool": {
"allowed": false,
"reason": "This account already has a routed /48."
},
"canCreateRoute": {
"allowed": true,
"reason": null
}
}
}
Response fields
availableboolean
reasonstring or null
allowedPrefixLengthsarray of integer
poolsarray of object
idstring
parentCidrstring
prefixLengthinteger
One of 48.
statusstring
One of active.
allocatedAtstring or null
updatedAtstring or null
routesarray of object
idstring
prefixstring
prefixLengthinteger
One of 48, 56, 64.
nextHopstring
labelstring or null
vpsIdstring
vpsNamestring
statusstring
One of active.
allocatedAtstring or null
updatedAtstring or null
actionsobject
canDeleteobject
Whether one routed IPv6 action is available now.
allowedboolean
reasonstring or null
actionsobject
canCreateRouteobject
Whether one routed IPv6 action is available now.
allowedboolean
reasonstring or null
canReleaseobject
Whether one routed IPv6 action is available now.
allowedboolean
reasonstring or null
destinationsarray of object
vpsIdstring
namestring
hostnamestring or null
The hostname set on the VPS. Null when none is set. Show name instead.
primaryIpstring or null
nextHopstring or null
serviceStatusstring
actionsobject
canReceiveRouteobject
Whether one routed IPv6 action is available now.
allowedboolean
reasonstring or null
actionsobject
canAllocatePoolobject
Whether one routed IPv6 action is available now.
allowedboolean
reasonstring or null
canCreateRouteobject
Whether one routed IPv6 action is available now.
allowedboolean
reasonstring or null

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400code is invalid_request. action must be allocate_pool or create_route. create_route needs poolId, vpsId and a prefixLength of 48, 56 or 64. A prefix outside the /48 also returns it.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404routed_ipv6_pool_not_found: no such /48 in your account. vps_not_found: no such VPS in your account.
409Nothing was changed. routed_ipv6_pool_exists: the account already has a /48. vps_not_active: the VPS is not active. routed_ipv6_next_hop_missing: IPv6 is not turned on for the VPS. routed_ipv6_conflict: the VPS is not ready for routed IPv6 or prefix overlaps an existing route. routed_ipv6_capacity_exhausted: no free prefix of that length is left in the /48. After allocate_pool it means no /48 is free.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.