# Sleep

The sleep policy of an SVM

Source: https://slashinfra.com/docs/api-reference/control/sleep
Last modified: 2026-11-30T16:36:19.000Z

The sleep policy of an SVM

Resource, request and plan limits are listed on [Limits](https://slashinfra.com/docs/reference/limits).

[Download OpenAPI specification](https://slashinfra.com/docs/control.openapi.json) · Version 0.1.0

[PUTChange the sleep policy of an SVM](https://slashinfra.com/docs/api-reference/control/sleep#putSvmsByRefSleep)

### Change the sleep policy of an SVM

PUT

/svms/{ref}/sleep

Sets the sleep policy and sends it to the node at once: `auto` sleeps when the workload is idle, `timer` sleeps `after_s` seconds after the last external activity, and `on` never sleeps. A sleeping SVM takes the new policy at its next wake; see [sleep and wake](https://slashinfra.com/docs/how/sleep-and-wake).

#### Authorization

`apiKey`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/api).

#### Path Parameters

`ref*`string

The SVM id, or its name in the organization of the key: ten symbols of `0123456789abcdefghjkmnpqrstvwxyz` is an id, any other reference is a name.

Length`1 <= length`

#### Query Parameters

`project?`string

The project id or name, `default` when omitted; an unknown project answers 404 `project_not_found`.

#### Header Parameters

`if-match?`string

The generation that the change expects, the `generation` of the last answer for this SVM; a different stored generation answers 412 `generation_mismatch` and changes nothing, and without the header the change is unconditional.

#### Request Body

The sleep policy: `{"mode":"auto"}`, `{"mode":"timer","after_s":1800}` or `{"mode":"on"}`.

- body

- body
- …

The sleep policy: `{"mode":"auto"}`, `{"mode":"timer","after_s":1800}` or `{"mode":"on"}`.

`after_s?`number

The inactivity of a `timer` in seconds: an integer from 30 to 86400; only `timer` uses it.

`mode*`string

`auto` sleeps when the workload is idle; `timer` sleeps `after_s` seconds after the last external activity; `on` never sleeps and uses its memory all the time.

#### Response Body

The sleep policy of an SVM: `auto` follows the workload; `timer` ignores background signals; `on` never sleeps. An open terminal, or a preview that moves data, keeps the SVM awake in `auto` and `timer` modes.

`application/json`

- response

- response
- …

Sleep when the workload is idle; background work keeps the SVM awake.

`mode*`string

Example Request

```
curl -X PUT 'https://api.slashinfra.com/svms/build-1/sleep' \  -H 'Content-Type: application/json' \  -d '{  "mode": "timer"}'
```

Example ResponseSchema

```
{  "mode": "auto"}
```

PUT

/svms/{ref}/sleep

Example Request

```
curl -X PUT 'https://api.slashinfra.com/svms/build-1/sleep' \
-H 'Content-Type: application/json' \
-d '{
"mode": "timer"
}'
```

```
{
"mode": "auto"
}
```
