Skip to main content
POST
Set the automatic-sleep preference

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

Makes the request retry-safe. Sail remembers the answer it sent under a key, including a 400 or a 409, and replays it with Idempotent-Replayed: true for a retry that repeats the key, the method, the path, and the body. Bodies are compared byte for byte. Reusing a key for a different request returns 409, so send a corrected request under a new key. A key that is blank or only spaces is ignored, and the request runs without idempotency.

Any string of up to 255 bytes works, and characters outside ASCII count for more than one. A UUID is a good default. Keys are remembered for at least 24 hours and scoped to the API key that sent them.

A server error, or a failure to record the answer, can leave a key unsettled, and creating a Sailbox is where that matters. See Retrying safely.

Maximum string length: 255

Path Parameters

sailbox_id
string
required

Id of the Sailbox, as returned by create. It is sb_ followed by a UUID.

Pattern: ^sb_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

Body

application/json

A Sailbox's automatic-sleep preference, in both directions: send it to choose, and read it back to see the choice in effect. It only ever makes Sail sleep the Sailbox less often, and it can never cause a sleep. Your own sleep, pause, resume, and scheduled wakes work the same whatever it says.

automatic
boolean
default:true

true lets Sail sleep the Sailbox automatically when that is safe, which is the default. false turns automatic sleeping off. Omitting it when you write means true. Reads always include it.

min_seconds_before_sleep
integer

How long Sail must wait before an automatic sleep, in seconds, at most 3600. It only lengthens the wait: Sail already waits before sleeping an idle Sailbox, so a value below its own wait changes nothing. Send it only with automatic: true; sent alongside automatic: false the request is rejected, because a caller who meant to set a wait would otherwise have silently turned automatic sleeping off. Reads leave it out when no wait was set.

Required range: 0 <= x <= 3600
Example:

300

Response

The operation was accepted.

sailbox_id
string
required

Id of the Sailbox.

auto_sleep
object
required

The automatic-sleep preference now in effect.