Delete a VPS firewall rule
DELETE /api/v2/vps/{id}/firewall/{pos}
Delete the firewall rule at position pos. Read GET /api/v2/vps/{id}/firewall right before and take pos from the rule you mean. Rules have no ID and the call does not check for changes. If another client changed the list in between, it deletes whatever rule is at pos now. Delete only rules with editable: true. Outbound rules and group references answer 403. A key that also holds write:network and write:services skips that check. It deletes any rule at pos. The rules below it move up one place. A position with no rule answers 404.
Authentication: An API key with the scope write:vm. About keys and scopes
Request
Path parameters
idstringrequiredThe VPS ID (
vps_…).posintegerrequiredPosition of the rule,
rules[].pos in the rule list. The first rule is 0. At least 0.Example
curl -X DELETE "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/firewall/0" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
204 Rule deleted.
Errors
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 key lacks the scope, or the rule at pos is an outbound rule or a group reference. The body is the same in both cases. Check editable in the rule list. |
| 404 | vps_not_found: no VPS with this ID in your account. not_found: no rule at this position. |
| 409 | upstream_failed: the VPS is still being set up. Nothing was deleted. Try again when serviceStatus is active. |
| 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. |
| 503 | upstream_failed: the current rules could not be read. Nothing was deleted. Try again shortly. |