Delete a backup
POST/api/v1/vps/{vps_uuid}/backups/delete
Deletes one backup.
Parameters
| Name | In | Description |
|---|---|---|
| vps_uuid | path, stringrequired | VPS id, from Create a VPS or List VPS |
Request body
| Field | Type | Description |
|---|---|---|
| backup_id | string, optionalrequired | A backup id from GET /vps/{vps_uuid}/backups |
Example request
curl -X POST "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID/backups/delete" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"backup_id": "bk-3f9a1c0d2e4b5a69"
}'import os, requests
token = os.environ["API_TOKEN"]
vps_uuid = "12d46f8c-d66e-4163-99aa-1245d5b06e5b"
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps/{vps_uuid}/backups/delete",
headers={"Authorization": f"Bearer {token}"},
json={
"backup_id": "bk-3f9a1c0d2e4b5a69"
},
)
r.raise_for_status()
print(r.json())const vpsUuid = '12d46f8c-d66e-4163-99aa-1245d5b06e5b';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vps/${vpsUuid}/backups/delete`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"backup_id": "bk-3f9a1c0d2e4b5a69"
}),
});
console.log(r.status, await r.json());Answer
Status 200 with this body.
| Field | Type | Description |
|---|---|---|
| vps_uuid | stringrequired | |
| deleted | stringrequired | Id of the deleted backup |
{
"vps_uuid": "12d46f8c-d66e-4163-99aa-1245d5b06e5b",
"deleted": "bk-3f9a1c0d2e4b5a69"
}Errors
| Status | When |
|---|---|
401 | No token, or a token that is not valid |
404 | No such backup of this VPS |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors