Skip to content
Skip to Content
Coder Docs

Update user quiet hours schedule

PUT
/api/v2/users/{user}/quiet-hours

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

user*string

User ID

Formatuuid

Request Body

Update schedule request

application/json
  1. body
schedule*string

Schedule is a cron expression that defines when the user's quiet hours window is. Schedule must not be empty. For new users, the schedule is set to 2am in their browser or computer's timezone. The schedule denotes the beginning of a 4 hour window where the workspace is allowed to automatically stop or restart due to maintenance or template schedule.

The schedule must be daily with a single time, and should have a timezone specified via a CRON_TZ prefix (otherwise UTC will be used).

If the schedule is empty, the user will be updated to use the default schedule.

Response Body

OK

application/json
  1. response
[index: integer]?

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X PUT \	"$CODER_URL/api/v2/users/{user}/quiet-hours" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "schedule": "string"}'
Example Response200
[  {    "next": "2019-08-24T14:15:22Z",    "raw_schedule": "string",    "time": "string",    "timezone": "string",    "user_can_set": true,    "user_set": true  }]