Cancel a VPS
POST /api/v2/vps/{id}/actions/cancel
Ask for a VPS to be cancelled. With cancelType: "end_of_period" (the default) the VPS runs until the end of the paid period. With "immediate" it ends without waiting for the period to end. Only the account holder can cancel. A contact on the account gets 403.
Hostup withdraws the VPS’s unpaid renewal invoice and e-mails the account holder a confirmation. While revokable is true you can withdraw the cancellation with DELETE /api/v2/vps/{id}/cancellation. A VPS that is still an unpaid order is not cancelled as a service. The order and its invoice are cancelled instead. The response then has cancelledPendingOrder: true.
The call returns 201 with the cancellation. It returns 200 with cancellationLookupPending: true when the request was accepted but cannot be read back yet. Read GET /api/v2/vps/{id}/cancellation shortly after. A scheduled switch to Cloud VPS blocks the cancellation with 409 scheduled_change_in_progress. Remove it first with DELETE /api/v2/vps/{id}/actions/upgrade.
Authentication: An API key with the scope write:billing. About keys and scopes
Request
Path parameters
idstringrequiredvps_…).Body
reasonstringNo longer needed, Found a better alternative, Too expensive, Poor performance, Technical issues, Moving to different provider, Business closure or other. Any text of 1 to 500 characters is accepted.cancelTypestringend_of_period: cancel at the end of the current billing period. immediate: cancel as soon as it is processed. One of immediate, end_of_period.otherReasonstringreason is other. Leave it out for the standard reasons.Example
curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/cancel" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "reason": "Moving to different provider", "cancelType": "end_of_period" }'curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/cancel" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "reason": "other", "otherReason": "Consolidating workloads into another environment.", "cancelType": "immediate" }'Responses
200 The request was accepted but cannot be read back yet (cancellationLookupPending: true). Or an unpaid order was cancelled instead (cancelledPendingOrder: true).
{ "vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m3", "status": "none", "cancelledAt": null, "scheduledAt": null, "reason": null, "cancelType": null, "revokable": false, "cancellationLookupPending": true, "submissionAccepted": true, "notice": { "code": "cancellation_record_pending", "detail": "Cancellation request accepted, but the stored cancellation record is not available yet. Re-read the cancellation status shortly." }}{ "vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m3", "status": "none", "cancelledAt": null, "scheduledAt": null, "reason": null, "cancelType": null, "revokable": false, "cancelledPendingOrder": true, "cancelledOrderId": "ord_01hxa3b4c5d6e7f8g9h0j1k2m3", "notice": { "code": "pending_order_cancelled", "detail": "Pending order and related invoice have been cancelled." }}Response fields
vpsIdstringvps_…).statusstringnone means there is no cancellation. The status endpoint still returns 200 with the same shape. One of pending, scheduled, completed, revoked, none.cancelledAtstring or nullscheduledAtstring or nullend_of_period it is the end of the paid period. For immediate it equals cancelledAt, the time of the request.reasonstring or nullcancelTypestring or nullimmediate, end_of_period.revokablebooleanDELETE /api/v2/vps/{id}/cancellation.cancelledPendingOrderbooleancancelledOrderIdstringcancelledPendingOrder is true.cancellationLookupPendingbooleanGET /api/v2/vps/{id}/cancellation again shortly.submissionAcceptedbooleancancellationLookupPending. Confirms that the request was accepted.noticeobjectcodestringpending_order_cancelled, cancellation_record_pending.detailstring201 The cancellation is recorded.
{ "vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m3", "status": "pending", "cancelledAt": "2026-04-27T12:00:00.000Z", "scheduledAt": "2026-05-27T00:00:00.000Z", "reason": "Moving to different provider", "cancelType": "end_of_period", "revokable": true}Response fields
vpsIdstringvps_…).statusstringnone means there is no cancellation. The status endpoint still returns 200 with the same shape. One of pending, scheduled, completed, revoked, none.cancelledAtstring or nullscheduledAtstring or nullend_of_period it is the end of the paid period. For immediate it equals cancelledAt, the time of the request.reasonstring or nullcancelTypestring or nullimmediate, end_of_period.revokablebooleanDELETE /api/v2/vps/{id}/cancellation.cancelledPendingOrderbooleancancelledOrderIdstringcancelledPendingOrder is true.cancellationLookupPendingbooleanGET /api/v2/vps/{id}/cancellation again shortly.submissionAcceptedbooleancancellationLookupPending. Confirms that the request was accepted.noticeobjectcodestringpending_order_cancelled, cancellation_record_pending.detailstringErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is vps_not_found. |
| 409 | The cancellation is blocked. scheduled_change_in_progress: remove the scheduled change first. Another 409 means another billing update is running. Try again shortly. |
| 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. |