Skip to content

Create maintenance period

POST
/maintenance-periods
curl --request POST \
--url https://example.com/api/maintenance-periods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "ends_at": "2026-10-20 23:00", "monitor_id": 1, "name": "Planned deploy", "starts_at": "2026-10-20 22:00" }'

Schedules a one-time window for one monitor. starts_at and ends_at are UTC with minute precision, for example 2026-10-20 22:00. Send an Idempotency-Key: a retry without it creates a second window.

Token abilities: maintenance:write.

Idempotency-Key
string
/^[\x21-\x7E]{1,128}$/

Optional. One stable key per intended write, reused on every retry of it. A repeat within 24 hours returns the stored response; the same key with a different request returns 409 idempotency_conflict.

Media typeapplication/json
object
ends_at
required

UTC wall time with minute precision, format Y-m-d H:i: no seconds, no T, no offset. Seconds return 422.

string
/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$/
monitor_id
required
integer
name
string | null
<= 255 characters
starts_at
required

UTC wall time with minute precision, format Y-m-d H:i: no seconds, no T, no offset. Seconds return 422.

string
/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$/

Example

{
"ends_at": "2026-10-20 23:00",
"monitor_id": 1,
"name": "Planned deploy",
"starts_at": "2026-10-20 22:00"
}

The scheduled window. With Idempotency-Key, a repeat returns the stored response.

Media typeapplication/json
MaintenancePeriodResource
object
ends_at
required

UTC, Y-m-d H:i:s.

string
id
required
integer
monitor_id
required
integer | null
name
required
string | null
scope
required
string
shared
required
boolean
starts_at
required

UTC, Y-m-d H:i:s.

string

Example

{
"ends_at": "2026-10-20 23:00:00",
"id": 500,
"monitor_id": 1,
"name": "Planned deploy",
"scope": "site",
"shared": false,
"starts_at": "2026-10-20 22:00:00"
}
X-RateLimit-Limit
integer

Requests per minute allowed by the limit this response counts against.

X-RateLimit-Remaining
integer

Requests left in the current minute.

Missing, invalid, expired or session-only credentials, or a disabled user.

Media typeapplication/json
Unauthenticated
object
error
required
string

Examples

ExampleUnauthenticated

Missing or invalid token

{
"error": "Unauthenticated."
}

The token lacks a required ability, or the user’s role or client access does not allow this action.

Media typeapplication/json
ErrorMessage
object
message
required
string

Examples

ExampleForbidden

The token lacks the ability

{
"message": "Invalid ability provided."
}

Not found or not visible to this token.

Media typeapplication/json
ErrorMessage
object
message
required
string

Examples

ExampleNotFound

Missing or hidden

{
"message": "No query results for model [Heptapod\\Models\\Site] 12"
}

Domain error.

  • idempotency_conflict: The Idempotency-Key was used for another operation, target or request.
  • busy_try_again: A change of sites, clients or access was being saved for longer than this write waits for it; retry after Retry-After.
Media typeapplication/json
object
code
required
string
details
required

Code-specific details; may be empty.

object
error
required
string
code
required
string
Allowed values: idempotency_conflict busy_try_again

Example

{
"code": "idempotency_conflict"
}
Retry-After
integer

Seconds to wait before retrying.

Invalid input.

  • invalid_idempotency_key: Idempotency-Key must be 1 to 128 visible ASCII characters.
Media typeapplication/json
Any of:
ValidationError
object
errors
required

Field name => messages.

object
key
additional properties
Array<string>
message
required
string

Examples

ExampleValidationFailed

Invalid input

{
"errors": {
"starts_at": [
"The starts at field must match the format Y-m-d H:i."
]
},
"message": "The starts at field must match the format Y-m-d H:i."
}

Rate limited: 60 requests per minute per source IP before authentication, and 60 per minute per user and per token. See Retry-After.

Media typeapplication/json
TooManyRequests
object
error
required
string

Examples

ExampleTooManyRequests

Rate limited

{
"error": "Too Many Attempts."
}
Retry-After
integer

Seconds to wait before retrying.

X-RateLimit-Reset
integer

Unix time when the request limit resets. Only on request rate limits, not on refused manual runs.