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
actionstringallocate_pool, create_route.poolIdstringripv6_…). Required for create_route.vpsIdstringvps_…) to route the prefix to. Required for create_route. The VPS must be one of the eligible destinations[].prefixLengthintegercreate_route. One of 48, 56, 64.prefixstringlabelstringExample
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" }'curl -X POST "https://cloud.hostup.se/api/v2/routed-ipv6" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "action": "create_route", "poolId": "ripv6_01hxa3b4c5d6e7f8g9h0j1k2m3", "vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m5", "prefixLength": 64, "label": "web subnet" }'curl -X POST "https://cloud.hostup.se/api/v2/routed-ipv6" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "action": "create_route", "poolId": "ripv6_01hxa3b4c5d6e7f8g9h0j1k2m3", "vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m5", "prefixLength": 56, "prefix": "2001:db8:1000:100::/56" }'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 } }}{ "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": [ { "id": "ripv6rt_01hxa3b4c5d6e7f8g9h0j1k2m4", "prefix": "2001:db8:1000::/64", "prefixLength": 64, "nextHop": "2001:db8::10", "label": "web subnet", "vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m5", "vpsName": "web-01", "status": "active", "allocatedAt": "2026-06-15T12:01:00.000Z", "updatedAt": "2026-06-15T12:01:00.000Z", "actions": { "canDelete": { "allowed": true, "reason": null } } } ], "actions": { "canCreateRoute": { "allowed": true, "reason": null }, "canRelease": { "allowed": false, "reason": "Remove routed subnets before releasing this /48." } } } ], "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
availablebooleanreasonstring or nullallowedPrefixLengthsarray of integerpoolsarray of objectidstringparentCidrstringprefixLengthinteger48.statusstringactive.allocatedAtstring or nullupdatedAtstring or nullroutesarray of objectidstringprefixstringprefixLengthinteger48, 56, 64.nextHopstringlabelstring or nullvpsIdstringvpsNamestringstatusstringactive.allocatedAtstring or nullupdatedAtstring or nullactionsobjectcanDeleteobjectallowedbooleanreasonstring or nullactionsobjectcanCreateRouteobjectallowedbooleanreasonstring or nullcanReleaseobjectallowedbooleanreasonstring or nulldestinationsarray of objectvpsIdstringnamestringhostnamestring or nullname instead.primaryIpstring or nullnextHopstring or nullserviceStatusstringactionsobjectcanReceiveRouteobjectallowedbooleanreasonstring or nullactionsobjectcanAllocatePoolobjectallowedbooleanreasonstring or nullcanCreateRouteobjectallowedbooleanreasonstring or nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | code 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. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | routed_ipv6_pool_not_found: no such /48 in your account. vps_not_found: no such VPS in your account. |
| 409 | Nothing 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. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |