---
title: "Terminate/cancel a service (destructive)"
method: POST
path: "/v1/vps/{service_id}/terminate"
tags: ["VPS"]
---

# Terminate/cancel a service (destructive)

`POST /v1/vps/{service_id}/terminate`

## Request

- Base URL: `https://developers.servera.co.uk`
- URL: `https://developers.servera.co.uk/v1/vps/{service_id}/terminate`
- Auth: HTTP bearer

⚠️ Terminate/cancel one of your services. **Destructive.** Uses the SAME flow as the
customer panel - VM destroy + **IP release** + refund handling.

`mode=immediate` destroys now (backgrounded); `mode=end_of_period` cancels at the end
of the paid period (VM keeps running until then); `mode=scheduled` terminates on
`scheduled_date` (YYYY-MM-DD). Requires `confirm: true`. An `Idempotency-Key` header is
required. A service already terminated/cancelled or with a pending termination returns
an error rather than acting twice.

## Path parameters

- `service_id` integer, required

## Headers

- `Idempotency-Key` string, nullable

## Request body

- TerminateBody
  - `mode` 'immediate' | 'end_of_period' | 'scheduled': immediate = destroy the VM now (backgrounded); end_of_period = cancel at the end of the paid billing period; scheduled = terminate on `scheduled_date`.
  - `scheduled_date` string, nullable: YYYY-MM-DD; required when mode='scheduled'.
  - `reason` string, nullable: Optional reason, stored with the request.
  - `refund_as_credit` boolean: If a refund applies, add it to the account credit balance instead of refunding the payment gateway.
  - `confirm` boolean: Must be true - termination is irreversible.

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/servera/apis/servera-developers-api.md) · [All operations](https://skmtc.dev/servera/apis/servera-developers-api/llms.txt) · [OpenAPI document](https://skmtc.dev/servera/apis/servera-developers-api/revisions/a196f94eee59?raw)
