OS templates allowed for rebuild on this VPS (service-specific filter)
GET/services/:id/os-templates
Selection list for the VPS rebuild operation. ENH-001 (live test 2026-05-19):
the list is now service-specific — the ostemplates field from the Virtualizor
act=rebuild&vpsid=X form-load call is parsed. This is the list filtered by the media
group assigned to the VPS in Virtualizor. Previously a global list
(act=ostemplates, 255+ OS) was returned, and when the reseller picked the wrong OS and
rebuilt, Virtualizor returned the "The OS you submitted is invalid" error.
Now only allowed OSes are shown.
NOTE: The initial order (POST /orders) does NOT USE this endpoint. During
provisioning, the WHMCS Virtualizor module assigns the OS from its own config options. This
endpoint is only for the rebuild flow.
Cache: APCu, key os_templates:v2:vps:{vpsId} (per-VPS), TTL 300 seconds.
Since different VPSes can be in different media groups, a global key is NOT A SOLUTION.
Two VPSes in the same media group do not share this cache — practical impact is zero
(the OS list is updated about once a month).
Cache invalidation: After the operator adds a new OS image, it appears within at most 5 min. An admin CLI hook for urgent invalidation will come (Phase 4).
Rate limit: Default bucket (60 req/min).
management=basic: 409 management_unavailable.
vps_id null: returns 422 service_not_provisioned — rebuild is not possible anyway
for a service awaiting provisioning.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OS template list
Response Headers
The per-minute limit defined for this key
Number of requests remaining in the current window
Unix epoch of the start of the next window (UTC seconds)
Authentication failed — missing header, wrong credential, outside the IP whitelist, or a revoked key. No detail is leaked; all cases return a single message.
Response Headers
RFC 7617 Basic Auth challenge
Insufficient authorization — the reseller tried to access another reseller's service_id, or has insufficient scope for an endpoint requiring admin scope. The message is kept generic (ServiceOwnershipMiddleware prevents leakage).
Resource not found (or hidden from the reseller). To prevent inventory/resource leakage between resellers, "not found" and "not accessible" return a single response.
The VPS is still awaiting provisioning (vps_id null). Since a rebuild cannot be done, the OS list cannot be fetched either. The reseller module should show a "waiting for OS list" message until provisioning completes.
Per-minute limit exceeded
Response Headers
Seconds to wait before retrying after a 429 (RFC 7231 §7.1.3)
The per-minute limit defined for this key
Unix epoch of the start of the next window (UTC seconds)