Skip to content

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

idstringrequired
The VPS ID (vps_…).

Body

reasonstring
Why you cancel. The client area sends values such as No 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.
cancelTypestring
end_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.
otherReasonstring
Your own explanation when reason is other. Leave it out for the standard reasons.

Example

POST /api/v2/vps/{id}/actions/cancel
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"
}'

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."
}
}
Response fields
vpsIdstring
The VPS ID (vps_…).
statusstring
none means there is no cancellation. The status endpoint still returns 200 with the same shape. One of pending, scheduled, completed, revoked, none.
cancelledAtstring or null
When the cancellation was requested, if known.
scheduledAtstring or null
When the cancellation takes effect, if known. For end_of_period it is the end of the paid period. For immediate it equals cancelledAt, the time of the request.
reasonstring or null
The cancellation reason. Null when there is no cancellation.
cancelTypestring or null
When the cancellation takes effect. Null when there is no cancellation or the timing was not recorded. One of immediate, end_of_period.
revokableboolean
True while the cancellation is pending or scheduled. Remove it with DELETE /api/v2/vps/{id}/cancellation.
cancelledPendingOrderboolean
Present only when the VPS was still a pending order. The order was then cancelled instead of the service.
cancelledOrderIdstring
The order ID when cancelledPendingOrder is true.
cancellationLookupPendingboolean
Present only when the request was accepted but the cancellation could not be read back yet. Call GET /api/v2/vps/{id}/cancellation again shortly.
submissionAcceptedboolean
Present with cancellationLookupPending. Confirms that the request was accepted.
noticeobject
codestring
One of pending_order_cancelled, cancellation_record_pending.
detailstring

201 The cancellation is recorded.

Response 201
{
"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
vpsIdstring
The VPS ID (vps_…).
statusstring
none means there is no cancellation. The status endpoint still returns 200 with the same shape. One of pending, scheduled, completed, revoked, none.
cancelledAtstring or null
When the cancellation was requested, if known.
scheduledAtstring or null
When the cancellation takes effect, if known. For end_of_period it is the end of the paid period. For immediate it equals cancelledAt, the time of the request.
reasonstring or null
The cancellation reason. Null when there is no cancellation.
cancelTypestring or null
When the cancellation takes effect. Null when there is no cancellation or the timing was not recorded. One of immediate, end_of_period.
revokableboolean
True while the cancellation is pending or scheduled. Remove it with DELETE /api/v2/vps/{id}/cancellation.
cancelledPendingOrderboolean
Present only when the VPS was still a pending order. The order was then cancelled instead of the service.
cancelledOrderIdstring
The order ID when cancelledPendingOrder is true.
cancellationLookupPendingboolean
Present only when the request was accepted but the cancellation could not be read back yet. Call GET /api/v2/vps/{id}/cancellation again shortly.
submissionAcceptedboolean
Present with cancellationLookupPending. Confirms that the request was accepted.
noticeobject
codestring
One of pending_order_cancelled, cancellation_record_pending.
detailstring

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is vps_not_found.
409The cancellation is blocked. scheduled_change_in_progress: remove the scheduled change first. Another 409 means another billing update is running. Try again shortly.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.