Create a maintenance window
const url = 'https://api.perstat.io/organizations/example/maintenance-windows';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"body":"example","monitors":["example"],"public_visible":true,"scheduled_end":1,"scheduled_start":1,"title":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.perstat.io/organizations/example/maintenance-windows \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "body": "example", "monitors": [ "example" ], "public_visible": true, "scheduled_end": 1, "scheduled_start": 1, "title": "example" }'Schedules a maintenance window with title, body, start and end (Unix seconds), and the affected monitors. Alerts are suppressed during the window; with public_visible false the window stays internal and is not shown on status pages. End must be after start (400 otherwise), and monitor ids that do not belong to the organization are ignored. Returns 201 with the created window. Requires project management rights.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Betroffene Monitore (public_ids; fremde IDs werden ignoriert).
Auf den Status-Seiten anzeigen (Default true). false = internes Fenster:
Alarme bleiben unterdrückt, aber die öffentliche Seite zeigt nichts.
Unix-Sekunden (UTC).
Examplegenerated
{ "body": "example", "monitors": [ "example" ], "public_visible": true, "scheduled_end": 1, "scheduled_start": 1, "title": "example"}Responses
Section titled “Responses”object
Fenster-public_id.
object
Monitor-public_id.
Erscheint das Fenster auf den Status-Seiten? (Alarm-Unterdrückung und SLA-Ausschluss gelten unabhängig davon.)
Unix-Sekunden (UTC).
Examplegenerated
{ "body": "example", "cancelled": true, "id": "example", "monitors": [ { "id": "example", "name": "example" } ], "public_visible": true, "scheduled_end": 1, "scheduled_start": 1, "title": "example"}