Delete a snapshot
/v1/servers/{serverId}/snapshots/{snapshotId} Deletes a snapshot. This can't be undone. Automatic backups can't be deleted, the cloud's or Rabbitflare's (they're replaced as new ones are taken), nor the one snapshot Linode keeps of a server (a new one replaces it). A Linode server on Rabbitflare's backups has Rabbitflare's snapshots instead (takenBy: "rabbitflare"), and each of those can be deleted.
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
servers:write - Manage servers. Power, reboot, snapshots and restores, log settings, restarting PHP, server security (Imunify360), and connecting your own servers.
Headers
| Field | Type and description |
|---|---|
Idempotency-Key | string 1 to 255 characters A key of your own for this request, like a UUID: letters, digits and |
Path parameters
| Field | Type and description |
|---|---|
serverId Required | string The server's id. |
snapshotId Required | string The snapshot's |
Example request
curl -X DELETE "https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots/171824639" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots/171824639", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
await rf.servers.snapshots.delete({
serverId: "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
snapshotId: "171824639",
}); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots/171824639');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
} import os
import requests
response = requests.delete(
"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots/171824639",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status() Response
204 No Content The answer has no body.
Example response
No content: the answer has no body.
Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |
409 not_ | The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory). Use what the cloud offers instead: for snapshots, site backups. Imunify360 needs a server Rabbitflare creates, with Intel or AMD processors and 2 GB or more ( |
409 server_ | The server is being restored, and nothing else can change it or its sites until that's done. Wait until the restore finishes (the server's |