---
title: "Create snapshot"
method: POST
path: "/api/v1/snapshots"
tags: ["Snapshots"]
---

# Create snapshot

`POST /api/v1/snapshots`

Create a snapshot of a VM or a volume.

- For a **VM snapshot**, set `resource_type` to `vm` and pass the VM UUID as `resource_id`.
- For a **volume snapshot**, set `resource_type` to `volume` and pass the integer `volume_id`.

## Headers

- `X-Project-ID` string, uuid, required

## Request body

- CreateSnapshotRequest
  - `resource_type` 'vm' | 'volume', required — Source type for the snapshot
  - `resource_id` string, uuid — Source VM UUID. Required when `resource_type` is `vm`.
  - `volume_id` integer — Source volume ID. Required when `resource_type` is `volume`.
  - `name` string, required — Snapshot display name

## Response `201`

Snapshot created

- object
  - `success` boolean
  - `data` Snapshot
    - `id` integer, required — Snapshot ID
    - `account_id` string, uuid — Account that owns the snapshot
    - `project_id` string, uuid — Project the snapshot belongs to
    - `created_by` string — User ID that created the snapshot
    - `type` 'vm' | 'volume', required — Snapshot source type
    - `name` string, required — Snapshot display name
    - `size` string — Current snapshot size
    - `target_size` string — Provisioned size of the source disk at snapshot time
    - `status` '' | 'active' — Indicates whether the source VM or volume is currently running on this snapshot: - `active` — this snapshot is **in use**. The source VM/volume has been reverted to it and is running on it now. Deleting an active snapshot is blocked. - `""` (empty) — this snapshot is saved but **not in use**. The source has not been reverted to it (or has been reverted to a different snapshot since). Only one snapshot per source can be `active` at a time. Calling [Restore Snapshot](#tag/Snapshots/operation/restoreSnapshot) flips that snapshot to `active` and clears the previous active one.
    - `product_vm` string, uuid — Source VM UUID (when `type` is `vm`)
    - `price_per_hour` string — Hourly storage cost in USD
    - `created_at` string, date-time

## Other responses

- `400` — Invalid request parameters
- `401` — Authentication required
- `402` — Account balance is insufficient for this operation. Top up the balance and retry.
- `403` — Billing validation failed. The account is not in good standing. Check the `reason` field: - `banned` — account suspended - `failed` — last payment failed; top up the account balance - `no_billing_customer` — billing not set up

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) · [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rafftechnologies/raff-api/revisions/2f4df56be77c/schema)
