# Snapshots

4 endpoints at `https://api.kosa8.com`, sent with `Authorization: Bearer $KOSA8_API_KEY`. Generated from the API's own [OpenAPI description](https://api.kosa8.com/openapi.json), which a test holds to the router.

## The org's snapshots, newest first[#]

GET`/v1/snapshots`scope sandboxes:read

Parameters

`sandbox_id`query · string

Only those taken from this sandbox

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/snapshots \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Get a snapshot[#]

GET`/v1/snapshots/{id}`scope sandboxes:read

Parameters

`id`requiredpath · string

Snapshot id (snap_…)

Responses

200401403404

```
curl -s -X GET https://api.kosa8.com/v1/snapshots/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Delete a snapshot: its bytes leave its host and its storage stops being billed; sandboxes made from it are not touched[#]

DELETE`/v1/snapshots/{id}`scope sandboxes:write

Parameters

`id`requiredpath · string

Snapshot id (snap_…)

Responses

200401403404502

```
curl -s -X DELETE https://api.kosa8.com/v1/snapshots/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Save the sandbox as a snapshot of the org's: memory, processes and disk, kept until deleted, whatever happens to the sandbox[#]

POST`/v1/sandboxes/{id}/snapshots`scope sandboxes:write

The sandbox keeps running (a sleeping one is woken). Make sandboxes from it with POST /v1/sandboxes {"snapshot": id}; it outlives the sandbox it came from (unlike a checkpoint, which goes with its sandbox). Kept on the source's host, and sandboxes made from it run there. Its bytes are billed as storage until it is deleted (https://kosa8.com/pricing/). At most 50 per org (429 snapshot_limit). Not for dedicated-cores sandboxes or ones with secrets (409).

Parameters

`id`requiredpath · string

Sandbox id (sbx_…)

JSON body

`name`string

—

Responses

201400401402403404409429501502

```
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/snapshots \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json
```

---
Source: https://docs.kosa8.com/api/snapshots/
