Enable DDoS scrubbing
POST /api/v2/vps/{id}/ddos-scrubbing
Start DDoS scrubbing for the VPS’s primary IPv4 address. Traffic to the address is then filtered before it reaches the VPS. Send duration in seconds for a session of 1, 3, 6, 12 or 24 hours. Send permanent: true for always-on scrubbing that runs until you stop it with DELETE /api/v2/vps/{id}/ddos-scrubbing. Check available on GET /api/v2/vps/{id}/ddos-scrubbing first. A VPS in a location without scrubbing answers 403. So does an address that is excluded from scrubbing. An address outside the ranges that can be scrubbed answers 400 invalid_request. When the filter cannot take the address range yet, the call answers 409 ddos_scrubbing_unavailable_for_ip and nothing is started. When protection is already on for the address, the call answers 409 ddos_mitigation_active.
Authentication: An API key with the scope write:vm. About keys and scopes
Request
Path parameters
idstringrequiredvps_…).Body
durationintegerpermanent. One of 3600, 10800, 21600, 43200, 86400.permanentbooleantrue for always-on scrubbing without an end time. It runs until you stop it. Not together with duration. One of true.Example
curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/ddos-scrubbing" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "duration": 3600 }'curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/ddos-scrubbing" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "permanent": true }'Responses
200 Scrubbing started.
{ "available": true, "reason": null, "ip": "192.0.2.10", "active": true, "durationSeconds": 3600, "createdAt": null, "expiresAt": "2026-06-22T13:07:03.000Z", "networkMitigation": { "status": "unknown", "action": null, "automatic": null, "createdAt": null, "expiresAt": null }}Response fields
availablebooleanreasonstring or nullipstring or nullactivebooleandurationSecondsinteger or nullcreatedAtstring or nullexpiresAtstring or nullnetworkMitigationobjectstatus: "unknown" in this response. Read GET /api/v2/vps/{id}/ddos-scrubbing for the verified state.statusstringactive when protection is on. none when checked and clear. unknown when it could not be checked, which never means clear. One of active, none, unknown.actionstring or nullblackhole: all internet traffic to the address is dropped. scrub: traffic is filtered before it reaches the VPS. Null unless status is active. One of blackhole, scrub.automaticboolean or nullcreatedAtstring or nullexpiresAtstring or nullErrors
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 | ddos_mitigation_active: protection is already on for this address. ddos_scrubbing_unavailable_for_ip: the address range cannot be scrubbed yet. Nothing was started in either case. |
| 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. |