---
title: "Make object enter or leave maintenance mode, immediately or on schedule"
method: POST
path: "/v1/objects/{object-id}/set-maintenance"
tags: ["Objects"]
---

# Make object enter or leave maintenance mode, immediately or on schedule

`POST /v1/objects/{object-id}/set-maintenance`

Without time fields, immediately changes object maintenance state according to the "maintenance" field.
If "startTime" and/or "endTime" is provided, maintenance is scheduled instead by creating one-time
scheduled tasks (visible in scheduled task list and cancellable via the scheduled tasks API):
  * startTime + endTime - schedule maintenance window (enter at startTime, leave at endTime);
  * startTime only - schedule maintenance entry, leave manually;
  * endTime only - schedule maintenance exit; combined with "maintenance": true the object
    enters maintenance immediately and leaves at endTime.
Scheduling requires the "schedule object maintenance" system access right.

## Path parameters

- `object-id` integer, required

## Request body

- object
  - `maintenance` boolean — true - if object should enter maintenance mode, false - if leave (ignored if startTime is provided)
  - `comments` string — Optional maintenance comments (also set on created scheduled tasks)
  - `startTime` union — Scheduled maintenance start time - UNIX timestamp, ISO 8601 string, or relative time ("+30m", "now")
    - integer
    - string
  - `endTime` union — Scheduled maintenance end time - UNIX timestamp, ISO 8601 string, or relative time ("+2h")
    - integer
    - string

## Response `204`

Maintenance mode changed or scheduled successfully

## Other responses

- `400` — Invalid arguments
- `401` — Unauthorized
- `403` — User does not have control access to given object or scheduling rights
- `404` — Object with given ID does not exist

## Changes

- **2026-06-12** `6ef72b83c12a` — 2 info
  - added the new optional request property `endTime`
  - added the new optional request property `startTime`
- **2026-06-10** `30e75dc6a94c` — 1 breaking, 1 info
  - removed the success response with the status `200`
  - added the success response with the status `204`
- **2026-05-08** `c6aaf3632e48` — 1 breaking, 2 warning, 1 info
  - removed the success response with the status `204`
  - removed the request property `endTime`
  - removed the request property `startTime`
  - added the success response with the status `200`

[Change history](https://skmtc.dev/netxms/apis/netxms-api/changes/v1/objects/:object-id/set-maintenance/post.md)

---

[API](https://skmtc.dev/netxms/apis/netxms-api.md) · [All operations](https://skmtc.dev/netxms/apis/netxms-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/netxms/netxms-api/revisions/71dbc43f5eda/schema)
