Skip to main content

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 returned by 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 the global list (act=ostemplates, 255+ OS) was returned, and when a reseller picked the wrong OS and rebuilt, Virtualizor threw "The OS you submitted is invalid". 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. A global key is NOT A SOLUTION because different VPSes can be in different media groups. Two VPSes in the same media group do not benefit from this cache — practical impact zero (the OS list updates about once a month).

Cache invalidation: Becomes visible within max 5 minutes after an operator adds a new OS image. An admin CLI hook for urgent invalidation is coming (Phase 4).

Rate limit: Default bucket (60 req/min).

vps_id null case: Returns 422 service_not_provisioned — a rebuild cannot be done for a service still awaiting provisioning anyway.

Request

Responses

OS template list

Response Headers
    X-RateLimit-Limit

    The per-minute limit defined for this key

    X-RateLimit-Remaining

    Number of requests remaining in the current window

    X-RateLimit-Reset

    Unix epoch of the start of the next window (UTC seconds)