# Add a planned-downtime window (/docs/api-reference/planned-downtime/PlannedDowntimeController_create)

`POST /api/factories/{factoryId}/planned-downtime`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `factoryId` | path | yes | string | Factory ID |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Downtime kind.",
      "enum": [
        "holiday",
        "maintenance",
        "meeting"
      ],
      "example": "holiday"
    },
    "startsAt": {
      "type": "string",
      "description": "Window start (ISO 8601).",
      "example": "2026-08-31T00:00:00Z"
    },
    "endsAt": {
      "type": "string",
      "description": "Window end (ISO 8601).",
      "example": "2026-09-01T00:00:00Z"
    },
    "machineId": {
      "type": "string",
      "description": "Machine code; omit for factory-wide.",
      "example": "SA01"
    },
    "reason": {
      "type": "string",
      "description": "Label, e.g. \"National Day\".",
      "example": "National Day"
    }
  },
  "required": [
    "kind",
    "startsAt",
    "endsAt"
  ]
}
```

## Responses

### 201: Created window