# Checkpoints

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.

## Checkpoints of every running or sleeping sandbox (up to 25), asked of each host; does not wake any[#]

GET`/v1/checkpoints`scope sandboxes:read

Responses

200401403

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

## Checkpoints, oldest first; does not wake a sleeping sandbox[#]

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

Parameters

`id`requiredpath · string

Sandbox id (sbx_…)

Responses

200401403404409501502

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

## Save memory, processes and disk as a checkpoint; the newest 10 are kept[#]

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

Parameters

`id`requiredpath · string

Sandbox id (sbx_…)

JSON body

`label`string

Max length 200.

Responses

201400401402403404409501502

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

## Go back to a checkpoint; the sandbox as it was is first saved as an automatic checkpoint (backup)[#]

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

Parameters

`id`requiredpath · string

Sandbox id (sbx_…)

JSON body

`checkpoint_id`requiredstring

—

Responses

200400401402403404409501502

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

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