*Cloud › Volumes*

# Create a backup

```http
POST https://devapi.dispralabs.com/v1/cloud/volumes/:vol/backups
```

Backs up the volume now. A `volume.backup.succeeded` or `volume.backup.failed` event follows.

Needs a key with `full` access.

- **Authentication:** Secret key (send it as `Authorization: Bearer <key>`)
- **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result.

## Parameters

- `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx`

## Returns

- **202** [The backup object](https://docs.dispralabs.com/objects/the-backup-object.md): The backup, running.

## Errors

| Status | Code | When |
|---|---|---|
| 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). |
| 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. |

## Request samples

### Dispra Cloud CLI

```bash
dcloud volume backup uploads
```

### cURL

```bash
curl -X POST "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups" \
  -H "Authorization: Bearer dsp_live_YOUR_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

### Node

```javascript
const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", {
  method: "POST",
  headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() },
});
console.log(await res.json());
```

### Python

```python
import uuid, requests
res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())})
print(res.json())
```

### Go

```go
req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", nil)
req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY")
req.Header.Set("Idempotency-Key", uuid.NewString())
res, _ := http.DefaultClient.Do(req)
```

## Responses

### 202

```json
{
  "data": {
    "bkp": "bkp_01jdk5c7v9b1n3m5q7w9e1r3ty",
    "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx",
    "state": "succeeded",
    "size_bytes": 1288490188,
    "trigger": "schedule",
    "taken_at": "2026-12-05T10:15:02Z"
  }
}
```

### 404 not_found

```json
{
  "error": {
    "code": "not_found",
    "message": "No such object in the key's project (or environment).",
    "request_id": "req_7f3a9c21d84be056"
  }
}
```

### 409 account_frozen

```json
{
  "error": {
    "code": "account_frozen",
    "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.",
    "request_id": "req_7f3a9c21d84be056"
  }
}
```
