Skip to content

Replace a maintenance window

PUT
/api/v1/maintenance/{windowId}
curl --request PUT \
--url https://app.monitorly.cloud/api/v1/maintenance/WINDOW_ID \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "checkIds": [ "ID" ], "schedule": { "endsAt": "example", "kind": "once", "startsAt": "example" }, "timezone": "example", "title": "example" }'

Replaces the window. Checks taken out of a running occurrence leave maintenance at once. Needs the editor role.

windowId
required
string format: uuid

The maintenance window’s id.

Example

WINDOW_ID
Media typeapplication/json
object
checkIds
required
Array<string>
schedule
required
One of:

RFC 3339 instants.

object
endsAt
required
string
kind
required
string
Allowed values: once
startsAt
required
string
timezone

IANA zone; the workspace’s when absent.

string | null
title
required
string

The window.

Media typeapplication/json
object
checkIds
required
Array<string>
createdAt
required
string
id
required
string format: uuid
managedBy

config when a config apply manages the window, ui otherwise. Always sent; optional in the schema because it was added after the first clients.

string
Allowed values: ui config
projectId
required
string format: uuid
ref

The window’s key in a config file; null until a config apply creates or adopts it. Always sent; optional in the schema because it was added after the first clients.

string | null
schedule
required
One of:

RFC 3339 instants.

object
endsAt
required
string
kind
required
string
Allowed values: once
startsAt
required
string
timezone
required
string
title
required
string
upcoming
required

The running occurrence first (if any), then the next ones; empty once a one-off window is over.

Array<object>
object
active
required
boolean
endsAt
required
string
localEndsAt
required
string
localStartsAt
required

The same instants in the window’s zone, with offset.

string
startsAt
required
string

Example

{
"checkIds": [
"ID"
],
"id": "ID",
"managedBy": "ui",
"projectId": "PROJECT_ID",
"schedule": {
"kind": "once"
}
}

Bad Request.

  • request.malformed: the body or a parameter is not of the expected shape
  • auth.credentials_conflict: the request carries both a session cookie and a token
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}

Unauthorized.

  • auth.unauthenticated, auth.session_expired: no session, or it ended
  • token.invalid: the token is malformed, unknown, revoked or expired, or its creator left the workspace
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}

Forbidden.

  • auth.forbidden: your role is too low for this
  • token.scope_missing: the token lacks the scope this needs; detail names it
  • request.origin_mismatch, request.header_required: a changing request with a session comes from another site or lacks X-Monitorly-Request: 1
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}

Not Found.

  • request.not_found: it does not exist, or you cannot see it
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}

Payload Too Large.

  • request.too_large: the body is larger than 256 KiB
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}

Unprocessable Entity.

  • field.required, field.too_long, field.invalid: a field breaks a rule; errors points at it
  • maintenance.ends_before_start: window end is not later than its start
  • maintenance.ends_in_past: one-time window has already ended
  • maintenance.weekdays_invalid: weekdays are empty, repeated, or outside 1–7
  • maintenance.duration_out_of_range: weekly window duration is outside 1–10080 minutes
  • maintenance.check_not_in_project: check is not from the window’s project or is repeated
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}

Too Many Requests.

  • token.rate_limited: more than 10 requests a second with this token
  • session.rate_limited: more than 5 changes a second from your sessions
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}
Retry-After
integer
>= 1

Seconds to wait before trying again.