VPS OS reinstall (asynchronous, 202 Accepted)
POST/services/:id/rebuild
Reinstalls the VPS with the selected OS template. ALL data on the disk is deleted. Async job — the Virtualizor rebuildvps operation takes 5-30 minutes; the API returns 202 Accepted immediately and the reseller module then tracks it with GET /services/{id}/status.
SECURITY: confirm: true (strict bool) in the body is REQUIRED. If false or missing it returns 400 confirmation_required and NO call is made to Virtualizor (client-side guard).
Idempotency-Key REQUIRED.
Rate limit: services_changes_120rpm bucket.
vps_id null: 422 service_not_provisioned.
Request
Responses
- 202
- 400
- 401
- 403
- 422
- 429
- 502
Rebuild scheduled (asynchronous job started)
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)
true on a cache-hit replay.
Idempotency-Key missing / confirm=false / body validation error
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).
VPS not provisioned OR the selected os_id is not allowed in this VPS's media group.
os_not_allowed (security): Even though the GET /os-templates list is media-group-filtered, the rebuild action is validated server-side — if an os_id not in the list (forged) is sent, NO call is made to Virtualizor and 422 is returned.
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)
Virtualizor upstream error