---
title: "Create a new maintenance window"
method: POST
path: "/operations/v1/maintenances"
tags: ["Maintenance"]
---

# Create a new maintenance window

`POST /operations/v1/maintenances`

Use this call to create a new maintenance window for the given unit. You can only create maintenances for today and days in the future.<br>You must have at least one of these scopes: 'maintenances.create, maintenances.manage'.

## Headers

- `Idempotency-Key` string

## Request body

- CreateMaintenanceModel — With this request you can create a maintenance window for a unit
  - `unitId` string, required — The id of the unit
  - `from` string, date-time, required — Date and time the maintenance begins. Has to be today or on a day in the future<br />A date and time (without fractional second part) in UTC or with UTC offset as defined in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a>
  - `to` string, date-time, required — Date and time the maintenance ends. Has to be later than from<br />A date and time (without fractional second part) in UTC or with UTC offset as defined in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a>
  - `type` 'OutOfService' | 'OutOfOrder' | 'OutOfInventory', required — The type of maintenance that is planned for the unit. A small repair (OutOfService), a bigger disfunction that does not allow to sell the unit (OutOfOrder) or is it under construction (OutOfInventory)
  - `description` string, nullable — Description of the maintenance

## Response `201`

Creation of the new maintenance was successful.

- MaintenanceCreatedModel
  - `id` string, required — The id for the scheduled maintenance

## Other responses

- `400` — Bad request.
- `401` — You are unauthorized.
- `403` — Forbidden.
- `404` — The Request-URI could not be found.
- `415` — Unsupported media type.
- `422` — Validation errors in the request body or query params.
- `499` — Client closed request.
- `500` — An unexpected error occurred.
- `503` — The server is currently unavailable. Please try later.

---

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